Пример #1
0
			a.DELETE("/:id"),
		)
		a.Description("Delete tracker configuration.")
		a.Params(func() {
			a.Param("id", d.String, "id")
		})
		a.Response(d.OK)
		a.Response(d.BadRequest, JSONAPIErrors)
		a.Response(d.InternalServerError, JSONAPIErrors)
		a.Response(d.NotFound, JSONAPIErrors)
		a.Response(d.Unauthorized, JSONAPIErrors)
	})
	a.Action("update", func() {
		a.Security("jwt")
		a.Routing(
			a.PUT("/:id"),
		)
		a.Description("Update tracker configuration.")
		a.Payload(UpdateTrackerAlternatePayload)
		a.Response(d.OK, func() {
			a.Media(Tracker)
		})
		a.Response(d.BadRequest, JSONAPIErrors)
		a.Response(d.InternalServerError, JSONAPIErrors)
		a.Response(d.NotFound, JSONAPIErrors)
		a.Response(d.Unauthorized, JSONAPIErrors)
	})

})

var _ = a.Resource("trackerquery", func() {
Пример #2
0
package design

import (
	d "github.com/goadesign/goa/design"
	a "github.com/goadesign/goa/design/apidsl"
)

var _ = a.Resource("userspace", func() {
	a.BasePath("/userspace")

	a.Action("create", func() {
		a.Routing(
			a.PUT("/*"),
		)
		a.Description("Data dump endpoint ")
		a.Payload(a.HashOf(d.String, d.Any))
		a.Response(d.NoContent)
		a.Response(d.InternalServerError)
	})
	a.Action("show", func() {
		a.Routing(
			a.GET("/*"),
		)
		a.Description("Data dump endpoint ")
		a.Response(d.OK, a.HashOf(d.String, d.Any))
		a.Response(d.InternalServerError)
		a.Response(d.NotFound)
	})
})