example

package
v0.0.0-...-9c85984 Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2020 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const HelloOKCode int = 200

HelloOKCode is the HTTP code returned for type HelloOK

Variables

This section is empty.

Functions

This section is empty.

Types

type Hello

type Hello struct {
	Context *middleware.Context
	Handler HelloHandler
}

Hello swagger:route GET /hello Example hello

hello api

func NewHello

func NewHello(ctx *middleware.Context, handler HelloHandler) *Hello

NewHello creates a new http.Handler for the hello operation

func (*Hello) ServeHTTP

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

type HelloHandler

type HelloHandler interface {
	Handle(HelloParams, *models.Principal) middleware.Responder
}

HelloHandler interface for that can handle valid hello params

type HelloHandlerFunc

type HelloHandlerFunc func(HelloParams, *models.Principal) middleware.Responder

HelloHandlerFunc turns a function with the right signature into a hello handler

func (HelloHandlerFunc) Handle

func (fn HelloHandlerFunc) Handle(params HelloParams, principal *models.Principal) middleware.Responder

Handle executing the request and returning a response

type HelloOK

type HelloOK struct {

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

HelloOK successful operation

swagger:response helloOK

func NewHelloOK

func NewHelloOK() *HelloOK

NewHelloOK creates HelloOK with default headers values

func (*HelloOK) SetPayload

func (o *HelloOK) SetPayload(payload *models.Hello)

SetPayload sets the payload to the hello o k response

func (*HelloOK) WithPayload

func (o *HelloOK) WithPayload(payload *models.Hello) *HelloOK

WithPayload adds the payload to the hello o k response

func (*HelloOK) WriteResponse

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

WriteResponse to the client

type HelloParams

type HelloParams struct {

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

HelloParams contains all the bound params for the hello operation typically these are obtained from a http.Request

swagger:parameters hello

func NewHelloParams

func NewHelloParams() HelloParams

NewHelloParams creates a new HelloParams object no default values defined in spec.

func (*HelloParams) BindRequest

func (o *HelloParams) 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 NewHelloParams() beforehand.

type HelloURL

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

HelloURL generates an URL for the hello operation

func (*HelloURL) Build

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

Build a url path and query string

func (*HelloURL) BuildFull

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

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

func (*HelloURL) Must

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

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

func (*HelloURL) SetBasePath

func (o *HelloURL) 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 (*HelloURL) String

func (o *HelloURL) String() string

String returns the string representation of the path with query string

func (*HelloURL) StringFull

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

StringFull returns the string representation of a complete url

func (*HelloURL) WithBasePath

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

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

Jump to

Keyboard shortcuts

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