v1

package
v0.1.0-alpha.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 9, 2018 License: Apache-2.0 Imports: 2 Imported by: 0

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL