operations

package
v0.0.0-...-14890a0 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2024 License: BSD-3-Clause Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const GetStudentByIDOKCode int = 200

GetStudentByIDOKCode is the HTTP code returned for type GetStudentByIDOK

View Source
const GetStudentsOKCode int = 200

GetStudentsOKCode is the HTTP code returned for type GetStudentsOK

Variables

This section is empty.

Functions

This section is empty.

Types

type GetStudentByID

type GetStudentByID struct {
	Context *middleware.Context
	Handler GetStudentByIDHandler
}
GetStudentByID swagger:route GET /api/students/{id} getStudentById

GetStudentByID get student by ID API

func NewGetStudentByID

func NewGetStudentByID(ctx *middleware.Context, handler GetStudentByIDHandler) *GetStudentByID

NewGetStudentByID creates a new http.Handler for the get student by ID operation

func (*GetStudentByID) ServeHTTP

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

type GetStudentByIDHandler

type GetStudentByIDHandler interface {
	Handle(GetStudentByIDParams) middleware.Responder
}

GetStudentByIDHandler interface for that can handle valid get student by ID params

type GetStudentByIDHandlerFunc

type GetStudentByIDHandlerFunc func(GetStudentByIDParams) middleware.Responder

GetStudentByIDHandlerFunc turns a function with the right signature into a get student by ID handler

func (GetStudentByIDHandlerFunc) Handle

Handle executing the request and returning a response

type GetStudentByIDOK

type GetStudentByIDOK struct {

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

GetStudentByIDOK returns the details of a student

swagger:response getStudentByIdOK

func NewGetStudentByIDOK

func NewGetStudentByIDOK() *GetStudentByIDOK

NewGetStudentByIDOK creates GetStudentByIDOK with default headers values

func (*GetStudentByIDOK) SetPayload

func (o *GetStudentByIDOK) SetPayload(payload *models.StudentView)

SetPayload sets the payload to the get student by Id o k response

func (*GetStudentByIDOK) WithPayload

func (o *GetStudentByIDOK) WithPayload(payload *models.StudentView) *GetStudentByIDOK

WithPayload adds the payload to the get student by Id o k response

func (*GetStudentByIDOK) WriteResponse

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

WriteResponse to the client

type GetStudentByIDParams

type GetStudentByIDParams struct {

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

	/*
	  Required: true
	  In: path
	*/
	ID int64
}

GetStudentByIDParams contains all the bound params for the get student by ID operation typically these are obtained from a http.Request

swagger:parameters getStudentByID

func NewGetStudentByIDParams

func NewGetStudentByIDParams() GetStudentByIDParams

NewGetStudentByIDParams creates a new GetStudentByIDParams object

There are no default values defined in the spec.

func (*GetStudentByIDParams) BindRequest

func (o *GetStudentByIDParams) 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 NewGetStudentByIDParams() beforehand.

type GetStudentByIDURL

type GetStudentByIDURL struct {
	ID int64
	// contains filtered or unexported fields
}

GetStudentByIDURL generates an URL for the get student by ID operation

func (*GetStudentByIDURL) Build

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

Build a url path and query string

func (*GetStudentByIDURL) BuildFull

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

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

func (*GetStudentByIDURL) Must

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

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

func (*GetStudentByIDURL) SetBasePath

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

func (o *GetStudentByIDURL) String() string

String returns the string representation of the path with query string

func (*GetStudentByIDURL) StringFull

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

StringFull returns the string representation of a complete url

func (*GetStudentByIDURL) WithBasePath

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

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 GetStudents

type GetStudents struct {
	Context *middleware.Context
	Handler GetStudentsHandler
}
GetStudents swagger:route GET /api/students getStudents

GetStudents get students API

func NewGetStudents

func NewGetStudents(ctx *middleware.Context, handler GetStudentsHandler) *GetStudents

NewGetStudents creates a new http.Handler for the get students operation

func (*GetStudents) ServeHTTP

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

type GetStudentsHandler

type GetStudentsHandler interface {
	Handle(GetStudentsParams) middleware.Responder
}

GetStudentsHandler interface for that can handle valid get students params

type GetStudentsHandlerFunc

type GetStudentsHandlerFunc func(GetStudentsParams) middleware.Responder

GetStudentsHandlerFunc turns a function with the right signature into a get students handler

func (GetStudentsHandlerFunc) Handle

Handle executing the request and returning a response

type GetStudentsOK

type GetStudentsOK struct {

	/*
	  In: Body
	*/
	Payload []*GetStudentsOKBodyItems0 `json:"body,omitempty"`
}

GetStudentsOK returns the list of students

swagger:response getStudentsOK

func NewGetStudentsOK

func NewGetStudentsOK() *GetStudentsOK

NewGetStudentsOK creates GetStudentsOK with default headers values

func (*GetStudentsOK) SetPayload

func (o *GetStudentsOK) SetPayload(payload []*GetStudentsOKBodyItems0)

SetPayload sets the payload to the get students o k response

func (*GetStudentsOK) WithPayload

func (o *GetStudentsOK) WithPayload(payload []*GetStudentsOKBodyItems0) *GetStudentsOK

WithPayload adds the payload to the get students o k response

func (*GetStudentsOK) WriteResponse

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

WriteResponse to the client

type GetStudentsOKBodyItems0

type GetStudentsOKBodyItems0 struct {

	// name
	Name string `json:"name,omitempty"`
}

GetStudentsOKBodyItems0 get students o k body items0

swagger:model GetStudentsOKBodyItems0

func (*GetStudentsOKBodyItems0) ContextValidate

func (o *GetStudentsOKBodyItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error

ContextValidate validates this get students o k body items0 based on context it is used

func (*GetStudentsOKBodyItems0) MarshalBinary

func (o *GetStudentsOKBodyItems0) MarshalBinary() ([]byte, error)

MarshalBinary interface implementation

func (*GetStudentsOKBodyItems0) UnmarshalBinary

func (o *GetStudentsOKBodyItems0) UnmarshalBinary(b []byte) error

UnmarshalBinary interface implementation

func (*GetStudentsOKBodyItems0) Validate

func (o *GetStudentsOKBodyItems0) Validate(formats strfmt.Registry) error

Validate validates this get students o k body items0

type GetStudentsParams

type GetStudentsParams struct {

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

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

swagger:parameters getStudents

func NewGetStudentsParams

func NewGetStudentsParams() GetStudentsParams

NewGetStudentsParams creates a new GetStudentsParams object

There are no default values defined in the spec.

func (*GetStudentsParams) BindRequest

func (o *GetStudentsParams) 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 NewGetStudentsParams() beforehand.

type GetStudentsURL

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

GetStudentsURL generates an URL for the get students operation

func (*GetStudentsURL) Build

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

Build a url path and query string

func (*GetStudentsURL) BuildFull

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

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

func (*GetStudentsURL) Must

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

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

func (*GetStudentsURL) SetBasePath

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

func (o *GetStudentsURL) String() string

String returns the string representation of the path with query string

func (*GetStudentsURL) StringFull

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

StringFull returns the string representation of a complete url

func (*GetStudentsURL) WithBasePath

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

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 HelloAPI

type HelloAPI 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
	// TxtProducer registers a producer for the following mime types:
	//   - text/plain
	TxtProducer runtime.Producer

	// GetStudentByIDHandler sets the operation handler for the get student by ID operation
	GetStudentByIDHandler GetStudentByIDHandler
	// GetStudentsHandler sets the operation handler for the get students operation
	GetStudentsHandler GetStudentsHandler

	// 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
}

HelloAPI the hello API

func NewHelloAPI

func NewHelloAPI(spec *loads.Document) *HelloAPI

NewHelloAPI creates a new Hello instance

func (*HelloAPI) AddMiddlewareFor

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

AddMiddlewareFor adds a http middleware to existing handler

func (*HelloAPI) AuthenticatorsFor

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

AuthenticatorsFor gets the authenticators for the specified security schemes

func (*HelloAPI) Authorizer

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

Authorizer returns the registered authorizer

func (*HelloAPI) ConsumersFor

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

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

func (*HelloAPI) Context

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

Context returns the middleware context for the hello API

func (*HelloAPI) DefaultConsumes

func (o *HelloAPI) DefaultConsumes() string

DefaultConsumes returns the default consumes media type

func (*HelloAPI) DefaultProduces

func (o *HelloAPI) DefaultProduces() string

DefaultProduces returns the default produces media type

func (*HelloAPI) Formats

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

Formats returns the registered string formats

func (*HelloAPI) HandlerFor

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

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

func (*HelloAPI) Init

func (o *HelloAPI) Init()

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

func (*HelloAPI) ProducersFor

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

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

func (*HelloAPI) RegisterConsumer

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

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

func (*HelloAPI) RegisterFormat

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

RegisterFormat registers a custom format validator

func (*HelloAPI) RegisterProducer

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

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

func (*HelloAPI) Serve

func (o *HelloAPI) 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 (*HelloAPI) ServeErrorFor

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

ServeErrorFor gets a error handler for a given operation id

func (*HelloAPI) SetDefaultConsumes

func (o *HelloAPI) SetDefaultConsumes(mediaType string)

SetDefaultConsumes returns the default consumes media type

func (*HelloAPI) SetDefaultProduces

func (o *HelloAPI) SetDefaultProduces(mediaType string)

SetDefaultProduces sets the default produces media type

func (*HelloAPI) SetSpec

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

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

func (*HelloAPI) UseRedoc

func (o *HelloAPI) UseRedoc()

UseRedoc for documentation at /docs

func (*HelloAPI) UseSwaggerUI

func (o *HelloAPI) UseSwaggerUI()

UseSwaggerUI for documentation at /docs

func (*HelloAPI) Validate

func (o *HelloAPI) Validate() error

Validate validates the registrations in the HelloAPI

Jump to

Keyboard shortcuts

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