swagger_server

package
v0.0.0-...-37abd50 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const RootOKCode int = 200

RootOKCode is the HTTP code returned for type RootOK

Variables

This section is empty.

Functions

This section is empty.

Types

type Root

type Root struct {
	Context *middleware.Context
	Handler RootHandler
}
Root swagger:route GET / swagger-server root

Root root API

func NewRoot

func NewRoot(ctx *middleware.Context, handler RootHandler) *Root

NewRoot creates a new http.Handler for the root operation

func (*Root) ServeHTTP

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

type RootDefault

type RootDefault struct {

	/*
	  In: Body
	*/
	Payload *models.Error `json:"body,omitempty"`
	// contains filtered or unexported fields
}

RootDefault generic error response

swagger:response rootDefault

func NewRootDefault

func NewRootDefault(code int) *RootDefault

NewRootDefault creates RootDefault with default headers values

func (*RootDefault) SetPayload

func (o *RootDefault) SetPayload(payload *models.Error)

SetPayload sets the payload to the root default response

func (*RootDefault) SetStatusCode

func (o *RootDefault) SetStatusCode(code int)

SetStatusCode sets the status to the root default response

func (*RootDefault) WithPayload

func (o *RootDefault) WithPayload(payload *models.Error) *RootDefault

WithPayload adds the payload to the root default response

func (*RootDefault) WithStatusCode

func (o *RootDefault) WithStatusCode(code int) *RootDefault

WithStatusCode adds the status to the root default response

func (*RootDefault) WriteResponse

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

WriteResponse to the client

type RootHandler

type RootHandler interface {
	Handle(RootParams) middleware.Responder
}

RootHandler interface for that can handle valid root params

type RootHandlerFunc

type RootHandlerFunc func(RootParams) middleware.Responder

RootHandlerFunc turns a function with the right signature into a root handler

func (RootHandlerFunc) Handle

func (fn RootHandlerFunc) Handle(params RootParams) middleware.Responder

Handle executing the request and returning a response

type RootOK

type RootOK struct {

	/*
	  In: Body
	*/
	Payload string `json:"body,omitempty"`
}

RootOK serves to display the root of the swagger API for the test bench

swagger:response rootOK

func NewRootOK

func NewRootOK() *RootOK

NewRootOK creates RootOK with default headers values

func (*RootOK) SetPayload

func (o *RootOK) SetPayload(payload string)

SetPayload sets the payload to the root o k response

func (*RootOK) WithPayload

func (o *RootOK) WithPayload(payload string) *RootOK

WithPayload adds the payload to the root o k response

func (*RootOK) WriteResponse

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

WriteResponse to the client

type RootParams

type RootParams struct {

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

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

swagger:parameters root

func NewRootParams

func NewRootParams() RootParams

NewRootParams creates a new RootParams object

There are no default values defined in the spec.

func (*RootParams) BindRequest

func (o *RootParams) 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 NewRootParams() beforehand.

type RootURL

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

RootURL generates an URL for the root operation

func (*RootURL) Build

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

Build a url path and query string

func (*RootURL) BuildFull

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

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

func (*RootURL) Must

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

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

func (*RootURL) SetBasePath

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

func (o *RootURL) String() string

String returns the string representation of the path with query string

func (*RootURL) StringFull

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

StringFull returns the string representation of a complete url

func (*RootURL) WithBasePath

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

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