当前位置: 首页>>代码示例>>Golang>>正文


Golang Echo.Post方法代码示例

本文整理汇总了Golang中github.com/labstack/echo.Echo.Post方法的典型用法代码示例。如果您正苦于以下问题:Golang Echo.Post方法的具体用法?Golang Echo.Post怎么用?Golang Echo.Post使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在github.com/labstack/echo.Echo的用法示例。


在下文中一共展示了Echo.Post方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。

示例1: SetupKeysRoutes

func SetupKeysRoutes(e *echo.Echo) {
	e.Get("", listKeys)
	e.Get("/:id", showKey)
	e.Post("", createKey)
	e.Put("/:id", updateKey)
	e.Delete("/:id", deleteKey)
}
开发者ID:cdwilhelm,项目名称:self-service-plugins,代码行数:7,代码来源:keys.go

示例2: RegisterRoutes

// RegisterRoutes sets up the http request handlers with Echo
func RegisterRoutes(e *echo.Echo, db *mgo.Database, basePieURL string, service service.RiskService, fnDelayer *FunctionDelayer) {
	e.Get("/pies/:id", func(c *echo.Context) (err error) {
		pie := &plugin.Pie{}
		id := c.Param("id")
		if bson.IsObjectIdHex(id) {
			query := db.C("pies").FindId(bson.ObjectIdHex(id))
			err = query.One(pie)
			if err == nil {
				c.JSON(200, pie)
			}
		} else {
			c.String(400, "Bad ID format for requested Pie. Should be a BSON Id")
		}
		return
	})

	e.Post("/calculate", func(c *echo.Context) (err error) {
		patientID := c.Form("patientId")
		fhirEndpointURL := c.Form("fhirEndpointUrl")
		key := fmt.Sprintf("%[email protected]%s", patientID, fhirEndpointURL)
		fnDelayer.Delay(key, func() {
			service.Calculate(patientID, fhirEndpointURL, basePieURL)
		})
		return
	})
}
开发者ID:intervention-engine,项目名称:riskservice,代码行数:27,代码来源:routes.go

示例3: SetupDropletsRoutes

// Setup routes for droplet actions
func SetupDropletsRoutes(e *echo.Echo) {
	e.Get("", listDroplets)
	e.Get("/:id", showDroplet)
	e.Post("", createDroplet)
	e.Delete("/:id", deleteDroplet)
	e.Get("/:id/kernels", listDropletKernels)
	e.Get("/:id/snapshots", listDropletSnapshots)
	e.Get("/:id/backups", listDropletBackups)
	e.Get("/:id/actions", listDropletActions)
	e.Get("/:id/neighbors", listDropletNeighbors)
}
开发者ID:cdwilhelm,项目名称:self-service-plugins,代码行数:12,代码来源:droplets.go

示例4: Set

func Set(e *echo.Echo) *echo.Echo {

	e.Favicon("static/favicon.ico")
	e.Static("/", "static")

	e.Get("/", controller.Index)
	e.Get("/eval/", controller.Eval)
	e.Post("/eval/", controller.PostEval)

	return e
}
开发者ID:sheercat,项目名称:evaltmpl,代码行数:11,代码来源:router.go

示例5: Configure

// Configure setups routes and templates
func Configure(r *render.BufferedRender, e *echo.Echo) error {
	// Add templates
	err := r.Load("index", utils.TmplAbs("index.tmpl"), utils.TmplAbs("layouts", "blog.tmpl"))
	if err != nil {
		return err
	}

	err = r.Load("post", utils.TmplAbs("post.tmpl"), utils.TmplAbs("layouts", "blog.tmpl"))
	if err != nil {
		return err
	}

	err = r.Load("archive", utils.TmplAbs("archive.tmpl"), utils.TmplAbs("layouts", "blog.tmpl"))
	if err != nil {
		return err
	}

	err = r.Load("category", utils.TmplAbs("category.tmpl"), utils.TmplAbs("layouts", "blog.tmpl"))
	if err != nil {
		return err
	}

	err = r.Load("profile", utils.TmplAbs("profile.tmpl"), utils.TmplAbs("layouts", "red_base.tmpl"))
	if err != nil {
		return err
	}

	err = r.Load("contact", utils.TmplAbs("contact.tmpl"), utils.TmplAbs("layouts", "blog.tmpl"))
	if err != nil {
		return err
	}

	// Add routes
	e.Get("/", Index)
	e.Get("/posts/:id", PostView)
	e.Get("/categories/:id", CategoryView)
	e.Get("/archive/:id", ArchiveView)
	e.Get("/profiles/:id", ProfileView)
	e.Post("/posts/:id/comments", AddComment)
	e.Get("/contact", ContactView)
	e.Post("/contact", DoContact)
	return nil
}
开发者ID:cedmundo,项目名称:site,代码行数:44,代码来源:handlers.go

示例6: Route

func Route(e *echo.Echo, a *AppContext) {
	//Quotes
	e.Post("/quotes", a.NewQuote)
	e.Get("/quotes", a.GetQuotes)
	e.Get("/quotes/:id", a.FindOneQuote)
	e.Put("/quotes/:id", a.EditQuote)
	e.Delete("/quotes/:id", a.DeleteQuote)

	//Slack specific api calls, uses incoming x-www-form-urlencoded post data instead of json
	e.Post("/slack/insertQuote", a.NewQuote)
	e.Get("/slack/searchQuote", a.SearchQuote)

	//Activity feed
	e.Post("/activities", a.NewActivity)
	e.Get("/activities", a.GetActivities)
	e.Get("/activities/:id", a.FindOneActivity)
	e.Delete("/activities/:id", a.DeleteActivity)

	//Debug
	e.Get("/debug", a.SendQuote)
}
开发者ID:wvdeutekom,项目名称:GoQuotes,代码行数:21,代码来源:api.go

示例7: RegisterRoutes

func RegisterRoutes(e *echo.Echo, config map[string][]echo.Middleware, dal DataAccessLayer, serverConfig Config) {

	// Batch Support
	batch := NewBatchController(dal)
	e.Post("/", batch.Post)

	// Resources

	RegisterController("Appointment", e, config["Appointment"], dal, serverConfig)
	RegisterController("ReferralRequest", e, config["ReferralRequest"], dal, serverConfig)
	RegisterController("Account", e, config["Account"], dal, serverConfig)
	RegisterController("Provenance", e, config["Provenance"], dal, serverConfig)
	RegisterController("Questionnaire", e, config["Questionnaire"], dal, serverConfig)
	RegisterController("ExplanationOfBenefit", e, config["ExplanationOfBenefit"], dal, serverConfig)
	RegisterController("DocumentManifest", e, config["DocumentManifest"], dal, serverConfig)
	RegisterController("Specimen", e, config["Specimen"], dal, serverConfig)
	RegisterController("AllergyIntolerance", e, config["AllergyIntolerance"], dal, serverConfig)
	RegisterController("CarePlan", e, config["CarePlan"], dal, serverConfig)
	RegisterController("Goal", e, config["Goal"], dal, serverConfig)
	RegisterController("StructureDefinition", e, config["StructureDefinition"], dal, serverConfig)
	RegisterController("EnrollmentRequest", e, config["EnrollmentRequest"], dal, serverConfig)
	RegisterController("EpisodeOfCare", e, config["EpisodeOfCare"], dal, serverConfig)
	RegisterController("OperationOutcome", e, config["OperationOutcome"], dal, serverConfig)
	RegisterController("Medication", e, config["Medication"], dal, serverConfig)
	RegisterController("Procedure", e, config["Procedure"], dal, serverConfig)
	RegisterController("List", e, config["List"], dal, serverConfig)
	RegisterController("ConceptMap", e, config["ConceptMap"], dal, serverConfig)
	RegisterController("Subscription", e, config["Subscription"], dal, serverConfig)
	RegisterController("ValueSet", e, config["ValueSet"], dal, serverConfig)
	RegisterController("OperationDefinition", e, config["OperationDefinition"], dal, serverConfig)
	RegisterController("DocumentReference", e, config["DocumentReference"], dal, serverConfig)
	RegisterController("Order", e, config["Order"], dal, serverConfig)
	RegisterController("Immunization", e, config["Immunization"], dal, serverConfig)
	RegisterController("Device", e, config["Device"], dal, serverConfig)
	RegisterController("VisionPrescription", e, config["VisionPrescription"], dal, serverConfig)
	RegisterController("Media", e, config["Media"], dal, serverConfig)
	RegisterController("Conformance", e, config["Conformance"], dal, serverConfig)
	RegisterController("ProcedureRequest", e, config["ProcedureRequest"], dal, serverConfig)
	RegisterController("EligibilityResponse", e, config["EligibilityResponse"], dal, serverConfig)
	RegisterController("DeviceUseRequest", e, config["DeviceUseRequest"], dal, serverConfig)
	RegisterController("DeviceMetric", e, config["DeviceMetric"], dal, serverConfig)
	RegisterController("Flag", e, config["Flag"], dal, serverConfig)
	RegisterController("RelatedPerson", e, config["RelatedPerson"], dal, serverConfig)
	RegisterController("SupplyRequest", e, config["SupplyRequest"], dal, serverConfig)
	RegisterController("Practitioner", e, config["Practitioner"], dal, serverConfig)
	RegisterController("AppointmentResponse", e, config["AppointmentResponse"], dal, serverConfig)
	RegisterController("Observation", e, config["Observation"], dal, serverConfig)
	RegisterController("MedicationAdministration", e, config["MedicationAdministration"], dal, serverConfig)
	RegisterController("Slot", e, config["Slot"], dal, serverConfig)
	RegisterController("EnrollmentResponse", e, config["EnrollmentResponse"], dal, serverConfig)
	RegisterController("Binary", e, config["Binary"], dal, serverConfig)
	RegisterController("MedicationStatement", e, config["MedicationStatement"], dal, serverConfig)
	RegisterController("Person", e, config["Person"], dal, serverConfig)
	RegisterController("Contract", e, config["Contract"], dal, serverConfig)
	RegisterController("CommunicationRequest", e, config["CommunicationRequest"], dal, serverConfig)
	RegisterController("RiskAssessment", e, config["RiskAssessment"], dal, serverConfig)
	RegisterController("TestScript", e, config["TestScript"], dal, serverConfig)
	RegisterController("Basic", e, config["Basic"], dal, serverConfig)
	RegisterController("Group", e, config["Group"], dal, serverConfig)
	RegisterController("PaymentNotice", e, config["PaymentNotice"], dal, serverConfig)
	RegisterController("Organization", e, config["Organization"], dal, serverConfig)
	RegisterController("ImplementationGuide", e, config["ImplementationGuide"], dal, serverConfig)
	RegisterController("ClaimResponse", e, config["ClaimResponse"], dal, serverConfig)
	RegisterController("EligibilityRequest", e, config["EligibilityRequest"], dal, serverConfig)
	RegisterController("ProcessRequest", e, config["ProcessRequest"], dal, serverConfig)
	RegisterController("MedicationDispense", e, config["MedicationDispense"], dal, serverConfig)
	RegisterController("DiagnosticReport", e, config["DiagnosticReport"], dal, serverConfig)
	RegisterController("ImagingStudy", e, config["ImagingStudy"], dal, serverConfig)
	RegisterController("ImagingObjectSelection", e, config["ImagingObjectSelection"], dal, serverConfig)
	RegisterController("HealthcareService", e, config["HealthcareService"], dal, serverConfig)
	RegisterController("DataElement", e, config["DataElement"], dal, serverConfig)
	RegisterController("DeviceComponent", e, config["DeviceComponent"], dal, serverConfig)
	RegisterController("FamilyMemberHistory", e, config["FamilyMemberHistory"], dal, serverConfig)
	RegisterController("NutritionOrder", e, config["NutritionOrder"], dal, serverConfig)
	RegisterController("Encounter", e, config["Encounter"], dal, serverConfig)
	RegisterController("Substance", e, config["Substance"], dal, serverConfig)
	RegisterController("AuditEvent", e, config["AuditEvent"], dal, serverConfig)
	RegisterController("MedicationOrder", e, config["MedicationOrder"], dal, serverConfig)
	RegisterController("SearchParameter", e, config["SearchParameter"], dal, serverConfig)
	RegisterController("PaymentReconciliation", e, config["PaymentReconciliation"], dal, serverConfig)
	RegisterController("Communication", e, config["Communication"], dal, serverConfig)
	RegisterController("Condition", e, config["Condition"], dal, serverConfig)
	RegisterController("Composition", e, config["Composition"], dal, serverConfig)
	RegisterController("DetectedIssue", e, config["DetectedIssue"], dal, serverConfig)
	RegisterController("Bundle", e, config["Bundle"], dal, serverConfig)
	RegisterController("DiagnosticOrder", e, config["DiagnosticOrder"], dal, serverConfig)
	RegisterController("Patient", e, config["Patient"], dal, serverConfig)
	RegisterController("OrderResponse", e, config["OrderResponse"], dal, serverConfig)
	RegisterController("Coverage", e, config["Coverage"], dal, serverConfig)
	RegisterController("QuestionnaireResponse", e, config["QuestionnaireResponse"], dal, serverConfig)
	RegisterController("DeviceUseStatement", e, config["DeviceUseStatement"], dal, serverConfig)
	RegisterController("ProcessResponse", e, config["ProcessResponse"], dal, serverConfig)
	RegisterController("NamingSystem", e, config["NamingSystem"], dal, serverConfig)
	RegisterController("Schedule", e, config["Schedule"], dal, serverConfig)
	RegisterController("SupplyDelivery", e, config["SupplyDelivery"], dal, serverConfig)
	RegisterController("ClinicalImpression", e, config["ClinicalImpression"], dal, serverConfig)
	RegisterController("MessageHeader", e, config["MessageHeader"], dal, serverConfig)
	RegisterController("Claim", e, config["Claim"], dal, serverConfig)
	RegisterController("ImmunizationRecommendation", e, config["ImmunizationRecommendation"], dal, serverConfig)
	RegisterController("Location", e, config["Location"], dal, serverConfig)
//.........这里部分代码省略.........
开发者ID:intervention-engine,项目名称:riskservice,代码行数:101,代码来源:routing.go

示例8: SetupDropletActionsRoutes

func SetupDropletActionsRoutes(e *echo.Echo) {
	e.Get("/:actionId", getDropletAction)
	e.Post("/disable_backups", disableDropletBackups)
	e.Post("/reboot", rebootDroplet)
	e.Post("/power", powerCycleDroplet)
	e.Post("/shutdown", shutdownDroplet)
	e.Post("/power_off", powerOffDroplet)
	e.Post("/power_on", powerOnDroplet)
	e.Post("/restore", restoreDroplet)
	e.Post("/password_reset", passwordResetDroplet)
	e.Post("/resize", resizeDroplet)
	e.Post("/rebuild", rebuildDroplet)
	e.Post("/rename", renameDroplet)
	e.Post("/change_kernel", changeDropletKernel)
	e.Post("/enable_ipv6", enableDropletIPv6)
	e.Post("/enable_private_networking", enableDropletPrivateNetworking)
	e.Post("/snapshot", snapshotDroplet)
	e.Post("/upgrade", upgradeDroplet)
}
开发者ID:cdwilhelm,项目名称:self-service-plugins,代码行数:19,代码来源:droplet_actions.go

示例9: loadHandlers

func loadHandlers(e *echo.Echo) {

	if itrak.Debug {
		e.SetDebug(true)
	}

	// Point to the client application generated inside the webapp dir
	e.Index("./webapp/build/index.html")
	e.ServeDir("/", "./webapp/build/")

	server_stats = stats.New()
	e.Use(server_stats.Handler)

	e.Get("/stats", getStats)
	e.Get("/test1", getTestData)
	e.Get("/part", getPartsList)
	e.Get("/task", getTaskList)
	e.Get("/jtask", getJTaskList)

	e.Post("/login", login)
	e.Delete("/login", logout)

	e.Get("/people", getPeople)
	e.Get("/people/:id", getPerson)
	e.Post("/people/:id", savePerson)

	e.Get("/site", getSites)
	e.Get("/site/:id", getSite)
	e.Post("/site/:id", saveSite)

	e.Get("/roles", getRoles)

	e.Get("/vendors", getAllVendors)
	e.Post("/vendors/:id", saveVendor)

	// Equipment Related functions
	e.Get("/equipment", getAllEquipment)
	e.Get("/site_equipment/:id", getAllSiteEquipment)
	e.Get("/equipment/:id", getEquipment)
	e.Post("/equipment/:id", saveEquipment)
	e.Get("/subparts/:id", subParts)
	e.Get("/spares", getAllSpares)
	e.Get("/spares/:id", getEquipment)
	e.Post("/spares/:id", saveEquipment)
	e.Get("/consumables", getAllConsumables)
	e.Get("/consumables/:id", getEquipment)
	e.Post("/consumables/:id", saveEquipment)

	e.Get("/equiptype", getAllEquipTypes)
	e.Get("/equiptype/:id", getEquipType)
	e.Post("/equiptype/:id", saveEquipType)

	e.Get("/task", getAllTask)
	e.Get("/sitetask/:id", getSiteTasks)
	e.Get("/task/:id", getTask)
	e.Post("/task/:id", saveTask)
}
开发者ID:steveoc64,项目名称:itrak.mmaint,代码行数:57,代码来源:handlers.go

示例10: createUsersRoutes

func createUsersRoutes(e *echo.Echo) {
	e.Post("/users", createUser)
	e.Get("/users", getUsers)
	e.Get("/users/:id", getUser)
}
开发者ID:niilo,项目名称:api-server-example,代码行数:5,代码来源:users_endpoint.go

示例11: registerAPI

func registerAPI(e *echo.Echo) {
	e.Get("/api/hello", hello)
	e.Post("/api/form", formHandler)
}
开发者ID:boourns,项目名称:skeletor,代码行数:4,代码来源:api.go

示例12: SetupImageActionsRoutes

func SetupImageActionsRoutes(e *echo.Echo) {
	e.Get("/:actionId", getImageAction)
	e.Post("/transfer", transferImage)
	e.Post("/convert", convertImage)
}
开发者ID:cdwilhelm,项目名称:self-service-plugins,代码行数:5,代码来源:image_actions.go

示例13: Init

func Init(e *echo.Echo) {
	e.Get("/api/todos", todocontroller.GetAll)
	e.Post("/api/todos", todocontroller.NewTodo)
	e.Delete("/api/todos/:id", todocontroller.RemoveTodo)
}
开发者ID:bgdsh,项目名称:playground,代码行数:5,代码来源:todoroutes.go


注:本文中的github.com/labstack/echo.Echo.Post方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。