operations

package
v0.0.0-...-3e1300e Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2020 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const GetGreetingOKCode int = 200

GetGreetingOKCode is the HTTP code returned for type GetGreetingOK

View Source
const PostAPIRegistOKCode int = 200

PostAPIRegistOKCode is the HTTP code returned for type PostAPIRegistOK

View Source
const PostAPIRegisterNotFoundCode int = 404

PostAPIRegisterNotFoundCode is the HTTP code returned for type PostAPIRegisterNotFound

View Source
const PostAPIRegisterOKCode int = 200

PostAPIRegisterOKCode is the HTTP code returned for type PostAPIRegisterOK

Variables

This section is empty.

Functions

This section is empty.

Types

type GetGreeting

type GetGreeting struct {
	Context *middleware.Context
	Handler GetGreetingHandler
}

GetGreeting swagger:route GET /hello getGreeting

GetGreeting get greeting API

func NewGetGreeting

func NewGetGreeting(ctx *middleware.Context, handler GetGreetingHandler) *GetGreeting

NewGetGreeting creates a new http.Handler for the get greeting operation

func (*GetGreeting) ServeHTTP

func (o *GetGreeting) ServeHTTP(rw http.ResponseWriter, r *http.Request)

type GetGreetingHandler

type GetGreetingHandler interface {
	Handle(GetGreetingParams) middleware.Responder
}

GetGreetingHandler interface for that can handle valid get greeting params

type GetGreetingHandlerFunc

type GetGreetingHandlerFunc func(GetGreetingParams) middleware.Responder

GetGreetingHandlerFunc turns a function with the right signature into a get greeting handler

func (GetGreetingHandlerFunc) Handle

Handle executing the request and returning a response

type GetGreetingOK

type GetGreetingOK struct {

	/*
	  In: Body
	*/
	Payload *models.HelloResponse `json:"body,omitempty"`
}

GetGreetingOK returns a greeting

swagger:response getGreetingOK

func NewGetGreetingOK

func NewGetGreetingOK() *GetGreetingOK

NewGetGreetingOK creates GetGreetingOK with default headers values

func (*GetGreetingOK) SetPayload

func (o *GetGreetingOK) SetPayload(payload *models.HelloResponse)

SetPayload sets the payload to the get greeting o k response

func (*GetGreetingOK) WithPayload

func (o *GetGreetingOK) WithPayload(payload *models.HelloResponse) *GetGreetingOK

WithPayload adds the payload to the get greeting o k response

func (*GetGreetingOK) WriteResponse

func (o *GetGreetingOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer)

WriteResponse to the client

type GetGreetingParams

type GetGreetingParams struct {

	// HTTP Request Object
	HTTPRequest *http.Request `json:"-"`

	/*defaults to World if not given
	  In: query
	*/
	Name *string
}

GetGreetingParams contains all the bound params for the get greeting operation typically these are obtained from a http.Request

swagger:parameters getGreeting

func NewGetGreetingParams

func NewGetGreetingParams() GetGreetingParams

NewGetGreetingParams creates a new GetGreetingParams object no default values defined in spec.

func (*GetGreetingParams) BindRequest

func (o *GetGreetingParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error

BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface for simple values it will use straight method calls.

To ensure default values, the struct must have been initialized with NewGetGreetingParams() beforehand.

type GetGreetingURL

type GetGreetingURL struct {
	Name *string
	// contains filtered or unexported fields
}

GetGreetingURL generates an URL for the get greeting operation

func (*GetGreetingURL) Build

func (o *GetGreetingURL) Build() (*url.URL, error)

Build a url path and query string

func (*GetGreetingURL) BuildFull

func (o *GetGreetingURL) BuildFull(scheme, host string) (*url.URL, error)

BuildFull builds a full url with scheme, host, path and query string

func (*GetGreetingURL) Must

func (o *GetGreetingURL) Must(u *url.URL, err error) *url.URL

Must is a helper function to panic when the url builder returns an error

func (*GetGreetingURL) SetBasePath

func (o *GetGreetingURL) SetBasePath(bp string)

SetBasePath sets the base path for this url builder, only required when it's different from the base path specified in the swagger spec. When the value of the base path is an empty string

func (*GetGreetingURL) String

func (o *GetGreetingURL) String() string

String returns the string representation of the path with query string

func (*GetGreetingURL) StringFull

func (o *GetGreetingURL) StringFull(scheme, host string) string

StringFull returns the string representation of a complete url

func (*GetGreetingURL) WithBasePath

func (o *GetGreetingURL) WithBasePath(bp string) *GetGreetingURL

WithBasePath sets the base path for this url builder, only required when it's different from the base path specified in the swagger spec. When the value of the base path is an empty string

type PostAPIRegist

type PostAPIRegist struct {
	Context *middleware.Context
	Handler PostAPIRegistHandler
}

PostAPIRegist swagger:route POST /api/regist postApiRegist

PostAPIRegist post API regist API

func NewPostAPIRegist

func NewPostAPIRegist(ctx *middleware.Context, handler PostAPIRegistHandler) *PostAPIRegist

NewPostAPIRegist creates a new http.Handler for the post API regist operation

func (*PostAPIRegist) ServeHTTP

func (o *PostAPIRegist) ServeHTTP(rw http.ResponseWriter, r *http.Request)

type PostAPIRegistHandler

type PostAPIRegistHandler interface {
	Handle(PostAPIRegistParams) middleware.Responder
}

PostAPIRegistHandler interface for that can handle valid post API regist params

type PostAPIRegistHandlerFunc

type PostAPIRegistHandlerFunc func(PostAPIRegistParams) middleware.Responder

PostAPIRegistHandlerFunc turns a function with the right signature into a post API regist handler

func (PostAPIRegistHandlerFunc) Handle

Handle executing the request and returning a response

type PostAPIRegistOK

type PostAPIRegistOK struct {
}

PostAPIRegistOK ok

swagger:response postApiRegistOK

func NewPostAPIRegistOK

func NewPostAPIRegistOK() *PostAPIRegistOK

NewPostAPIRegistOK creates PostAPIRegistOK with default headers values

func (*PostAPIRegistOK) WriteResponse

func (o *PostAPIRegistOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer)

WriteResponse to the client

type PostAPIRegistParams

type PostAPIRegistParams struct {

	// HTTP Request Object
	HTTPRequest *http.Request `json:"-"`

	/*年齢
	  Required: true
	  In: formData
	*/
	Age string
	/*コメント
	  Required: true
	  Max Length: 1000
	  In: formData
	*/
	Comment string
	/*クエリパラメータ
	  Required: true
	  In: query
	*/
	HogeID int64
	/*名前
	  Required: true
	  In: formData
	*/
	HogeName string
}

PostAPIRegistParams contains all the bound params for the post API regist operation typically these are obtained from a http.Request

swagger:parameters PostAPIRegist

func NewPostAPIRegistParams

func NewPostAPIRegistParams() PostAPIRegistParams

NewPostAPIRegistParams creates a new PostAPIRegistParams object no default values defined in spec.

func (*PostAPIRegistParams) BindRequest

func (o *PostAPIRegistParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error

BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface for simple values it will use straight method calls.

To ensure default values, the struct must have been initialized with NewPostAPIRegistParams() beforehand.

type PostAPIRegistURL

type PostAPIRegistURL struct {
	HogeID int64
	// contains filtered or unexported fields
}

PostAPIRegistURL generates an URL for the post API regist operation

func (*PostAPIRegistURL) Build

func (o *PostAPIRegistURL) Build() (*url.URL, error)

Build a url path and query string

func (*PostAPIRegistURL) BuildFull

func (o *PostAPIRegistURL) BuildFull(scheme, host string) (*url.URL, error)

BuildFull builds a full url with scheme, host, path and query string

func (*PostAPIRegistURL) Must

func (o *PostAPIRegistURL) Must(u *url.URL, err error) *url.URL

Must is a helper function to panic when the url builder returns an error

func (*PostAPIRegistURL) SetBasePath

func (o *PostAPIRegistURL) SetBasePath(bp string)

SetBasePath sets the base path for this url builder, only required when it's different from the base path specified in the swagger spec. When the value of the base path is an empty string

func (*PostAPIRegistURL) String

func (o *PostAPIRegistURL) String() string

String returns the string representation of the path with query string

func (*PostAPIRegistURL) StringFull

func (o *PostAPIRegistURL) StringFull(scheme, host string) string

StringFull returns the string representation of a complete url

func (*PostAPIRegistURL) WithBasePath

func (o *PostAPIRegistURL) WithBasePath(bp string) *PostAPIRegistURL

WithBasePath sets the base path for this url builder, only required when it's different from the base path specified in the swagger spec. When the value of the base path is an empty string

type PostAPIRegister

type PostAPIRegister struct {
	Context *middleware.Context
	Handler PostAPIRegisterHandler
}

PostAPIRegister swagger:route POST /api/register postApiRegister

PostAPIRegister post API register API

func NewPostAPIRegister

func NewPostAPIRegister(ctx *middleware.Context, handler PostAPIRegisterHandler) *PostAPIRegister

NewPostAPIRegister creates a new http.Handler for the post API register operation

func (*PostAPIRegister) ServeHTTP

func (o *PostAPIRegister) ServeHTTP(rw http.ResponseWriter, r *http.Request)

type PostAPIRegisterHandler

type PostAPIRegisterHandler interface {
	Handle(PostAPIRegisterParams) middleware.Responder
}

PostAPIRegisterHandler interface for that can handle valid post API register params

type PostAPIRegisterHandlerFunc

type PostAPIRegisterHandlerFunc func(PostAPIRegisterParams) middleware.Responder

PostAPIRegisterHandlerFunc turns a function with the right signature into a post API register handler

func (PostAPIRegisterHandlerFunc) Handle

Handle executing the request and returning a response

type PostAPIRegisterNotFound

type PostAPIRegisterNotFound struct {
}

PostAPIRegisterNotFound Data Not Found

swagger:response postApiRegisterNotFound

func NewPostAPIRegisterNotFound

func NewPostAPIRegisterNotFound() *PostAPIRegisterNotFound

NewPostAPIRegisterNotFound creates PostAPIRegisterNotFound with default headers values

func (*PostAPIRegisterNotFound) WriteResponse

func (o *PostAPIRegisterNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer)

WriteResponse to the client

type PostAPIRegisterOK

type PostAPIRegisterOK struct {
}

PostAPIRegisterOK ok

swagger:response postApiRegisterOK

func NewPostAPIRegisterOK

func NewPostAPIRegisterOK() *PostAPIRegisterOK

NewPostAPIRegisterOK creates PostAPIRegisterOK with default headers values

func (*PostAPIRegisterOK) WriteResponse

func (o *PostAPIRegisterOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer)

WriteResponse to the client

type PostAPIRegisterParams

type PostAPIRegisterParams struct {

	// HTTP Request Object
	HTTPRequest *http.Request `json:"-"`

	/*クエリパラメータ
	  Required: true
	  In: query
	*/
	HogeID int64
	/*The user to create.
	  In: body
	*/
	User *models.RegisterRequestBody
}

PostAPIRegisterParams contains all the bound params for the post API register operation typically these are obtained from a http.Request

swagger:parameters PostAPIRegister

func NewPostAPIRegisterParams

func NewPostAPIRegisterParams() PostAPIRegisterParams

NewPostAPIRegisterParams creates a new PostAPIRegisterParams object no default values defined in spec.

func (*PostAPIRegisterParams) BindRequest

func (o *PostAPIRegisterParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error

BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface for simple values it will use straight method calls.

To ensure default values, the struct must have been initialized with NewPostAPIRegisterParams() beforehand.

type PostAPIRegisterURL

type PostAPIRegisterURL struct {
	HogeID int64
	// contains filtered or unexported fields
}

PostAPIRegisterURL generates an URL for the post API register operation

func (*PostAPIRegisterURL) Build

func (o *PostAPIRegisterURL) Build() (*url.URL, error)

Build a url path and query string

func (*PostAPIRegisterURL) BuildFull

func (o *PostAPIRegisterURL) BuildFull(scheme, host string) (*url.URL, error)

BuildFull builds a full url with scheme, host, path and query string

func (*PostAPIRegisterURL) Must

func (o *PostAPIRegisterURL) Must(u *url.URL, err error) *url.URL

Must is a helper function to panic when the url builder returns an error

func (*PostAPIRegisterURL) SetBasePath

func (o *PostAPIRegisterURL) SetBasePath(bp string)

SetBasePath sets the base path for this url builder, only required when it's different from the base path specified in the swagger spec. When the value of the base path is an empty string

func (*PostAPIRegisterURL) String

func (o *PostAPIRegisterURL) String() string

String returns the string representation of the path with query string

func (*PostAPIRegisterURL) StringFull

func (o *PostAPIRegisterURL) StringFull(scheme, host string) string

StringFull returns the string representation of a complete url

func (*PostAPIRegisterURL) WithBasePath

func (o *PostAPIRegisterURL) WithBasePath(bp string) *PostAPIRegisterURL

WithBasePath sets the base path for this url builder, only required when it's different from the base path specified in the swagger spec. When the value of the base path is an empty string

type SampleAPI

type SampleAPI struct {
	Middleware func(middleware.Builder) http.Handler

	// BasicAuthenticator generates a runtime.Authenticator from the supplied basic auth function.
	// It has a default implementation in the security package, however you can replace it for your particular usage.
	BasicAuthenticator func(security.UserPassAuthentication) runtime.Authenticator
	// APIKeyAuthenticator generates a runtime.Authenticator from the supplied token auth function.
	// It has a default implementation in the security package, however you can replace it for your particular usage.
	APIKeyAuthenticator func(string, string, security.TokenAuthentication) runtime.Authenticator
	// BearerAuthenticator generates a runtime.Authenticator from the supplied bearer token auth function.
	// It has a default implementation in the security package, however you can replace it for your particular usage.
	BearerAuthenticator func(string, security.ScopedTokenAuthentication) runtime.Authenticator

	// JSONConsumer registers a consumer for the following mime types:
	//   - application/json
	JSONConsumer runtime.Consumer

	// JSONProducer registers a producer for the following mime types:
	//   - application/json
	JSONProducer runtime.Producer

	// PostAPIRegisterHandler sets the operation handler for the post API register operation
	PostAPIRegisterHandler PostAPIRegisterHandler
	// GetGreetingHandler sets the operation handler for the get greeting operation
	GetGreetingHandler GetGreetingHandler
	// ServeError is called when an error is received, there is a default handler
	// but you can set your own with this
	ServeError func(http.ResponseWriter, *http.Request, error)

	// PreServerShutdown is called before the HTTP(S) server is shutdown
	// This allows for custom functions to get executed before the HTTP(S) server stops accepting traffic
	PreServerShutdown func()

	// ServerShutdown is called when the HTTP(S) server is shut down and done
	// handling all active connections and does not accept connections any more
	ServerShutdown func()

	// Custom command line argument groups with their descriptions
	CommandLineOptionsGroups []swag.CommandLineOptionsGroup

	// User defined logger function.
	Logger func(string, ...interface{})
	// contains filtered or unexported fields
}

SampleAPI the sample API

func NewSampleAPI

func NewSampleAPI(spec *loads.Document) *SampleAPI

NewSampleAPI creates a new Sample instance

func (*SampleAPI) AddMiddlewareFor

func (o *SampleAPI) AddMiddlewareFor(method, path string, builder middleware.Builder)

AddMiddlewareFor adds a http middleware to existing handler

func (*SampleAPI) AuthenticatorsFor

func (o *SampleAPI) AuthenticatorsFor(schemes map[string]spec.SecurityScheme) map[string]runtime.Authenticator

AuthenticatorsFor gets the authenticators for the specified security schemes

func (*SampleAPI) Authorizer

func (o *SampleAPI) Authorizer() runtime.Authorizer

Authorizer returns the registered authorizer

func (*SampleAPI) ConsumersFor

func (o *SampleAPI) ConsumersFor(mediaTypes []string) map[string]runtime.Consumer

ConsumersFor gets the consumers for the specified media types. MIME type parameters are ignored here.

func (*SampleAPI) Context

func (o *SampleAPI) Context() *middleware.Context

Context returns the middleware context for the sample API

func (*SampleAPI) DefaultConsumes

func (o *SampleAPI) DefaultConsumes() string

DefaultConsumes returns the default consumes media type

func (*SampleAPI) DefaultProduces

func (o *SampleAPI) DefaultProduces() string

DefaultProduces returns the default produces media type

func (*SampleAPI) Formats

func (o *SampleAPI) Formats() strfmt.Registry

Formats returns the registered string formats

func (*SampleAPI) HandlerFor

func (o *SampleAPI) HandlerFor(method, path string) (http.Handler, bool)

HandlerFor gets a http.Handler for the provided operation method and path

func (*SampleAPI) Init

func (o *SampleAPI) Init()

Init allows you to just initialize the handler cache, you can then recompose the middleware as you see fit

func (*SampleAPI) ProducersFor

func (o *SampleAPI) ProducersFor(mediaTypes []string) map[string]runtime.Producer

ProducersFor gets the producers for the specified media types. MIME type parameters are ignored here.

func (*SampleAPI) RegisterConsumer

func (o *SampleAPI) RegisterConsumer(mediaType string, consumer runtime.Consumer)

RegisterConsumer allows you to add (or override) a consumer for a media type.

func (*SampleAPI) RegisterFormat

func (o *SampleAPI) RegisterFormat(name string, format strfmt.Format, validator strfmt.Validator)

RegisterFormat registers a custom format validator

func (*SampleAPI) RegisterProducer

func (o *SampleAPI) RegisterProducer(mediaType string, producer runtime.Producer)

RegisterProducer allows you to add (or override) a producer for a media type.

func (*SampleAPI) Serve

func (o *SampleAPI) Serve(builder middleware.Builder) http.Handler

Serve creates a http handler to serve the API over HTTP can be used directly in http.ListenAndServe(":8000", api.Serve(nil))

func (*SampleAPI) ServeErrorFor

func (o *SampleAPI) ServeErrorFor(operationID string) func(http.ResponseWriter, *http.Request, error)

ServeErrorFor gets a error handler for a given operation id

func (*SampleAPI) SetDefaultConsumes

func (o *SampleAPI) SetDefaultConsumes(mediaType string)

SetDefaultConsumes returns the default consumes media type

func (*SampleAPI) SetDefaultProduces

func (o *SampleAPI) SetDefaultProduces(mediaType string)

SetDefaultProduces sets the default produces media type

func (*SampleAPI) SetSpec

func (o *SampleAPI) SetSpec(spec *loads.Document)

SetSpec sets a spec that will be served for the clients.

func (*SampleAPI) Validate

func (o *SampleAPI) Validate() error

Validate validates the registrations in the SampleAPI

Jump to

Keyboard shortcuts

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