Documentation ¶
Overview ¶
Package v1 is definition of api +nirvana:openapi=true
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Desc = definition.Descriptor{ Path: "/api/v1", Definitions: []definition.Definition{}, Consumes: []string{"application/json"}, Produces: []string{"application/json"}, Children: []definition.Descriptor{ { Path: "/{target1}/{target2}", Definitions: []definition.Definition{ { Method: definition.Create, Function: Handle, Parameters: []definition.Parameter{ { Source: definition.Header, Name: "User-Agent", }, { Source: definition.Query, Name: "target1", }, { Source: definition.Query, Name: "target2", Default: false, }, { Source: definition.Body, Name: "app", }, }, Results: []definition.Result{ {Destination: definition.Data}, {Destination: definition.Error}, }, }, }, }, }, }
Desc is global descriptor of api
Functions ¶
This section is empty.
Types ¶
type Application ¶
type Application struct { Name string `json:"name"` Namespace string `json:"namespace"` Target string `json:"target"` Target1 int `json:"target2"` Target2 bool `json:"target1"` }
Application defines application api model
func Handle ¶
func Handle(ctx context.Context, userAgent string, target1 int, target2 bool, app *Application) (*Application, error)
Handle handles http request
Click to show internal directories.
Click to hide internal directories.