example

package
v0.0.0-...-99f6ab7 Latest Latest
Warning

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

Go to latest
Published: May 19, 2016 License: BSD-3-Clause Imports: 4 Imported by: 0

Documentation

Overview

@SubApi Order management API [/orders]

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitRouter

func InitRouter() *web.Router

Types

type APIError

type APIError struct {
	ErrorCode    int
	ErrorMessage string
}

type Context

type Context struct {
	// contains filtered or unexported fields
}

func (*Context) GetArrayOfInterfaces

func (c *Context) GetArrayOfInterfaces(rw web.ResponseWriter, req *web.Request)

@Title GetArrayOfInterfaces @Description get array of interfaces @Accept json @Success 200 {array} InterfaceType @Failure 400 {object} APIError "We need ID!!" @Failure 404 {object} APIError "Can not find ID" @Router /testapi/get-array-of-interfaces [get]

func (*Context) GetInterface

func (c *Context) GetInterface(rw web.ResponseWriter, req *web.Request)

@Title GetInterface @Description get interface @Accept json @Success 200 {object} InterfaceType @Failure 400 {object} APIError "We need ID!!" @Failure 404 {object} APIError "Can not find ID" @Router /testapi/get-interface [get]

func (*Context) GetSimpleAliased

func (c *Context) GetSimpleAliased(rw web.ResponseWriter, req *web.Request)

@Title GetSimpleAliased @Description get simple aliases @Accept json @Success 200 {object} SimpleAlias @Failure 400 {object} APIError "We need ID!!" @Failure 404 {object} APIError "Can not find ID" @Router /testapi/get-simple-aliased [get]

func (*Context) GetSimpleArrayByString

func (c *Context) GetSimpleArrayByString(rw web.ResponseWriter, req *web.Request)

@Title GetSimpleArrayByString @Description get simple array by ID @Accept json @Param some_id path string true "Some ID" @Param offset query int true "Offset" @Param limit query int true "Offset" @Success 200 {array} string @Failure 400 {object} APIError "We need ID!!" @Failure 404 {object} APIError "Can not find ID" @Router /testapi/get-simple-array-by-string/{some_id} [get]

func (*Context) GetStringByInt

func (c *Context) GetStringByInt(rw web.ResponseWriter, req *web.Request)

@Title GetStringByInt @Description get string by ID @Accept json @Param some_id path int true "Some ID" @Success 200 {object} string @Failure 400 {object} APIError "We need ID!!" @Failure 404 {object} APIError "Can not find ID" @Router /testapi/get-string-by-int/{some_id} [get]

func (*Context) GetStruct2ByInt

func (c *Context) GetStruct2ByInt(rw web.ResponseWriter, req *web.Request)

@Title GetStruct2ByInt @Description get struct2 by ID @Accept json @Param some_id path int true "Some ID" @Param offset query int true "Offset" @Param limit query int true "Offset" @Success 200 {object} StructureWithEmbededPointer @Failure 400 {object} APIError "We need ID!!" @Failure 404 {object} APIError "Can not find ID" @Router /testapi/get-struct2-by-int/{some_id} [get]

func (*Context) GetStruct3

func (c *Context) GetStruct3(rw web.ResponseWriter, req *web.Request)

@Title GetStruct3 @Description get struct3 @Accept json @Success 200 {object} StructureWithSlice @Failure 400 {object} APIError "We need ID!!" @Failure 404 {object} APIError "Can not find ID" @Router /testapi/get-struct3 [get]

func (*Context) GetStructArrayByString

func (c *Context) GetStructArrayByString(rw web.ResponseWriter, req *web.Request)

@Title GetStructArrayByString @Description get struct array by ID @Accept json @Param some_id path string true "Some ID" @Param offset query int true "Offset" @Param limit query int true "Offset" @Success 200 {array} SimpleStructureWithAnnotations @Failure 400 {object} APIError "We need ID!!" @Failure 404 {object} APIError "Can not find ID" @Router /testapi/get-struct-array-by-string/{some_id} [get]

func (*Context) GetStructByInt

func (c *Context) GetStructByInt(rw web.ResponseWriter, req *web.Request)

@Title GetStructByInt @Description get struct by ID @Accept json @Param some_id path int true "Some ID" @Param offset query int true "Offset" @Param limit query int true "Offset" @Success 200 {object} StructureWithEmbededStructure @Failure 400 {object} APIError "We need ID!!" @Failure 404 {object} APIError "Can not find ID" @Router /testapi/get-struct-by-int/{some_id} [get]

func (*Context) WriteResponse

func (c *Context) WriteResponse(response interface{})

type InterfaceType

type InterfaceType interface{}

type SimpleAlias

type SimpleAlias string

type SimpleStructure

type SimpleStructure struct {
	Id   int
	Name string
}

type SimpleStructureWithAnnotations

type SimpleStructureWithAnnotations struct {
	Id   int    `json:"id"`
	Name string `json:"required,omitempty"`
}

type StructureWithEmbededPointer

type StructureWithEmbededPointer struct {
	*StructureWithSlice
}

type StructureWithEmbededStructure

type StructureWithEmbededStructure struct {
	StructureWithSlice
}

type StructureWithSlice

type StructureWithSlice struct {
	Id   int
	Name []byte
}

Directories

Path Synopsis
@APIVersion 1.0.0 @APITitle Swagger Example API @APIDescription Swagger Example API @Contact varyous@gmail.com @TermsOfServiceUrl http://yvasiyarov.com/ @License BSD @LicenseUrl http://yvasiyarov.com/
@APIVersion 1.0.0 @APITitle Swagger Example API @APIDescription Swagger Example API @Contact varyous@gmail.com @TermsOfServiceUrl http://yvasiyarov.com/ @License BSD @LicenseUrl http://yvasiyarov.com/

Jump to

Keyboard shortcuts

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