Documentation ¶
Overview ¶
Code generated by ogen, DO NOT EDIT.
Index ¶
- func WithServerURL(ctx context.Context, u *url.URL) context.Context
- type BearerAuth
- type Client
- func (c *Client) CreatePets(ctx context.Context, request *Pet) (CreatePetsRes, error)
- func (c *Client) DeleteSession(ctx context.Context) (*DeleteSessionOK, error)
- func (c *Client) GetSession(ctx context.Context) (*GetSessionOK, error)
- func (c *Client) ListPets(ctx context.Context, params ListPetsParams) (*PetsHeaders, error)
- func (c *Client) Redirect(ctx context.Context) (RedirectRes, error)
- func (c *Client) ShowPetById(ctx context.Context, params ShowPetByIdParams) (ShowPetByIdRes, error)
- type ClientOption
- type CookieAuth
- type CreatePetsCreated
- type CreatePetsRes
- type DeleteSessionOK
- type Error
- func (s *Error) Decode(d *jx.Decoder) error
- func (s *Error) Encode(e *jx.Encoder)
- func (s *Error) GetCode() int32
- func (s *Error) GetMessage() string
- func (s *Error) MarshalJSON() ([]byte, error)
- func (s *Error) SetCode(val int32)
- func (s *Error) SetMessage(val string)
- func (s *Error) UnmarshalJSON(data []byte) error
- type ErrorHandler
- type ErrorStatusCode
- type GetSessionOK
- type Handler
- type Invoker
- type ListPetsParams
- type Middleware
- type OptInt32
- type OptString
- func (o *OptString) Decode(d *jx.Decoder) error
- func (o OptString) Encode(e *jx.Encoder)
- func (o OptString) Get() (v string, ok bool)
- func (o OptString) IsSet() bool
- func (s OptString) MarshalJSON() ([]byte, error)
- func (o OptString) Or(d string) string
- func (o *OptString) Reset()
- func (o *OptString) SetTo(v string)
- func (s *OptString) UnmarshalJSON(data []byte) error
- type OptURI
- type Option
- type Pet
- func (s *Pet) Decode(d *jx.Decoder) error
- func (s *Pet) Encode(e *jx.Encoder)
- func (s *Pet) GetID() int64
- func (s *Pet) GetName() string
- func (s *Pet) GetTag() OptString
- func (s *Pet) MarshalJSON() ([]byte, error)
- func (s *Pet) SetID(val int64)
- func (s *Pet) SetName(val string)
- func (s *Pet) SetTag(val OptString)
- func (s *Pet) UnmarshalJSON(data []byte) error
- type Pets
- type PetsHeaders
- type RedirectFound
- type RedirectRes
- type Route
- type SecurityHandler
- type SecuritySource
- type Server
- type ServerOption
- func WithErrorHandler(h ErrorHandler) ServerOption
- func WithMaxMultipartMemory(max int64) ServerOption
- func WithMethodNotAllowed(methodNotAllowed func(w http.ResponseWriter, r *http.Request, allowed string)) ServerOption
- func WithMiddleware(m ...Middleware) ServerOption
- func WithNotFound(notFound http.HandlerFunc) ServerOption
- func WithPathPrefix(prefix string) ServerOption
- type ShowPetByIdParams
- type ShowPetByIdRes
- type UnimplementedHandler
- func (UnimplementedHandler) CreatePets(ctx context.Context, req *Pet) (r CreatePetsRes, _ error)
- func (UnimplementedHandler) DeleteSession(ctx context.Context) (r *DeleteSessionOK, _ error)
- func (UnimplementedHandler) GetSession(ctx context.Context) (r *GetSessionOK, _ error)
- func (UnimplementedHandler) ListPets(ctx context.Context, params ListPetsParams) (r *PetsHeaders, _ error)
- func (UnimplementedHandler) NewError(ctx context.Context, err error) (r *ErrorStatusCode)
- func (UnimplementedHandler) Redirect(ctx context.Context) (r RedirectRes, _ error)
- func (UnimplementedHandler) ShowPetById(ctx context.Context, params ShowPetByIdParams) (r ShowPetByIdRes, _ error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type BearerAuth ¶
type BearerAuth struct {
Token string
}
func (*BearerAuth) GetToken ¶
func (s *BearerAuth) GetToken() string
GetToken returns the value of Token.
func (*BearerAuth) SetToken ¶
func (s *BearerAuth) SetToken(val string)
SetToken sets the value of Token.
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client implements OAS client.
func NewClient ¶
func NewClient(serverURL string, sec SecuritySource, opts ...ClientOption) (*Client, error)
NewClient initializes new Client defined by OAS.
func (*Client) DeleteSession ¶
func (c *Client) DeleteSession(ctx context.Context) (*DeleteSessionOK, error)
DeleteSession invokes deleteSession operation.
Delete session.
DELETE /session
func (*Client) GetSession ¶
func (c *Client) GetSession(ctx context.Context) (*GetSessionOK, error)
GetSession invokes getSession operation.
Get session.
GET /session
func (*Client) ListPets ¶
func (c *Client) ListPets(ctx context.Context, params ListPetsParams) (*PetsHeaders, error)
ListPets invokes listPets operation.
List pets.
GET /pets
func (*Client) Redirect ¶
func (c *Client) Redirect(ctx context.Context) (RedirectRes, error)
Redirect invokes redirect operation.
Redirect.
GET /redirect
func (*Client) ShowPetById ¶
func (c *Client) ShowPetById(ctx context.Context, params ShowPetByIdParams) (ShowPetByIdRes, error)
ShowPetById invokes showPetById operation.
Get pet by id.
GET /pets/{pet_id}
type ClientOption ¶
type ClientOption interface {
// contains filtered or unexported methods
}
ClientOption is client config option.
func WithClient ¶
func WithClient(client ht.Client) ClientOption
WithClient specifies http client to use.
type CookieAuth ¶
type CookieAuth struct {
APIKey string
}
func (*CookieAuth) GetAPIKey ¶
func (s *CookieAuth) GetAPIKey() string
GetAPIKey returns the value of APIKey.
func (*CookieAuth) SetAPIKey ¶
func (s *CookieAuth) SetAPIKey(val string)
SetAPIKey sets the value of APIKey.
type CreatePetsCreated ¶
type CreatePetsCreated struct{}
CreatePetsCreated is response for CreatePets operation.
type CreatePetsRes ¶
type CreatePetsRes interface {
// contains filtered or unexported methods
}
type DeleteSessionOK ¶
type DeleteSessionOK struct {
SetCookie OptString
}
DeleteSessionOK is response for DeleteSession operation.
func (*DeleteSessionOK) GetSetCookie ¶
func (s *DeleteSessionOK) GetSetCookie() OptString
GetSetCookie returns the value of SetCookie.
func (*DeleteSessionOK) SetSetCookie ¶
func (s *DeleteSessionOK) SetSetCookie(val OptString)
SetSetCookie sets the value of SetCookie.
type Error ¶
Ref: #/components/schemas/Error
func (*Error) GetMessage ¶
GetMessage returns the value of Message.
func (*Error) MarshalJSON ¶
MarshalJSON implements stdjson.Marshaler.
func (*Error) SetMessage ¶
SetMessage sets the value of Message.
func (*Error) UnmarshalJSON ¶
UnmarshalJSON implements stdjson.Unmarshaler.
type ErrorStatusCode ¶
ErrorStatusCode wraps Error with StatusCode.
func (*ErrorStatusCode) Error ¶
func (s *ErrorStatusCode) Error() string
func (*ErrorStatusCode) GetResponse ¶
func (s *ErrorStatusCode) GetResponse() Error
GetResponse returns the value of Response.
func (*ErrorStatusCode) GetStatusCode ¶
func (s *ErrorStatusCode) GetStatusCode() int
GetStatusCode returns the value of StatusCode.
func (*ErrorStatusCode) SetResponse ¶
func (s *ErrorStatusCode) SetResponse(val Error)
SetResponse sets the value of Response.
func (*ErrorStatusCode) SetStatusCode ¶
func (s *ErrorStatusCode) SetStatusCode(val int)
SetStatusCode sets the value of StatusCode.
type GetSessionOK ¶
type GetSessionOK struct {
SetCookie OptString
}
GetSessionOK is response for GetSession operation.
func (*GetSessionOK) GetSetCookie ¶
func (s *GetSessionOK) GetSetCookie() OptString
GetSetCookie returns the value of SetCookie.
func (*GetSessionOK) SetSetCookie ¶
func (s *GetSessionOK) SetSetCookie(val OptString)
SetSetCookie sets the value of SetCookie.
type Handler ¶
type Handler interface { // CreatePets implements createPets operation. // // Create pet. // // POST /pets CreatePets(ctx context.Context, req *Pet) (CreatePetsRes, error) // DeleteSession implements deleteSession operation. // // Delete session. // // DELETE /session DeleteSession(ctx context.Context) (*DeleteSessionOK, error) // GetSession implements getSession operation. // // Get session. // // GET /session GetSession(ctx context.Context) (*GetSessionOK, error) // ListPets implements listPets operation. // // List pets. // // GET /pets ListPets(ctx context.Context, params ListPetsParams) (*PetsHeaders, error) // Redirect implements redirect operation. // // Redirect. // // GET /redirect Redirect(ctx context.Context) (RedirectRes, error) // ShowPetById implements showPetById operation. // // Get pet by id. // // GET /pets/{pet_id} ShowPetById(ctx context.Context, params ShowPetByIdParams) (ShowPetByIdRes, error) // NewError creates *ErrorStatusCode from error returned by handler. // // Used for common default response. NewError(ctx context.Context, err error) *ErrorStatusCode }
Handler handles operations described by OpenAPI v3 specification.
type Invoker ¶
type Invoker interface { // CreatePets invokes createPets operation. // // Create pet. // // POST /pets CreatePets(ctx context.Context, request *Pet) (CreatePetsRes, error) // DeleteSession invokes deleteSession operation. // // Delete session. // // DELETE /session DeleteSession(ctx context.Context) (*DeleteSessionOK, error) // GetSession invokes getSession operation. // // Get session. // // GET /session GetSession(ctx context.Context) (*GetSessionOK, error) // ListPets invokes listPets operation. // // List pets. // // GET /pets ListPets(ctx context.Context, params ListPetsParams) (*PetsHeaders, error) // Redirect invokes redirect operation. // // Redirect. // // GET /redirect Redirect(ctx context.Context) (RedirectRes, error) // ShowPetById invokes showPetById operation. // // Get pet by id. // // GET /pets/{pet_id} ShowPetById(ctx context.Context, params ShowPetByIdParams) (ShowPetByIdRes, error) }
Invoker invokes operations described by OpenAPI v3 specification.
type ListPetsParams ¶
type ListPetsParams struct { // How many items to return at one time (max 100). Limit OptInt32 }
ListPetsParams is parameters of listPets operation.
type OptInt32 ¶
OptInt32 is optional int32.
func NewOptInt32 ¶
NewOptInt32 returns new OptInt32 with value set to v.
type OptString ¶
OptString is optional string.
func NewOptString ¶
NewOptString returns new OptString with value set to v.
func (OptString) MarshalJSON ¶
MarshalJSON implements stdjson.Marshaler.
func (*OptString) UnmarshalJSON ¶
UnmarshalJSON implements stdjson.Unmarshaler.
type OptURI ¶
OptURI is optional url.URL.
type Option ¶
type Option interface { ServerOption ClientOption }
Option is config option.
func WithMeterProvider ¶
func WithMeterProvider(provider metric.MeterProvider) Option
WithMeterProvider specifies a meter provider to use for creating a meter.
If none is specified, the otel.GetMeterProvider() is used.
func WithTracerProvider ¶
func WithTracerProvider(provider trace.TracerProvider) Option
WithTracerProvider specifies a tracer provider to use for creating a tracer.
If none is specified, the global provider is used.
type Pet ¶
Ref: #/components/schemas/Pet
func (*Pet) MarshalJSON ¶
MarshalJSON implements stdjson.Marshaler.
func (*Pet) UnmarshalJSON ¶
UnmarshalJSON implements stdjson.Unmarshaler.
type Pets ¶
type Pets []Pet
func (Pets) MarshalJSON ¶
MarshalJSON implements stdjson.Marshaler.
func (*Pets) UnmarshalJSON ¶
UnmarshalJSON implements stdjson.Unmarshaler.
type PetsHeaders ¶
PetsHeaders wraps Pets with response headers.
func (*PetsHeaders) GetResponse ¶
func (s *PetsHeaders) GetResponse() Pets
GetResponse returns the value of Response.
func (*PetsHeaders) GetXNext ¶
func (s *PetsHeaders) GetXNext() OptString
GetXNext returns the value of XNext.
func (*PetsHeaders) SetResponse ¶
func (s *PetsHeaders) SetResponse(val Pets)
SetResponse sets the value of Response.
func (*PetsHeaders) SetXNext ¶
func (s *PetsHeaders) SetXNext(val OptString)
SetXNext sets the value of XNext.
func (*PetsHeaders) Validate ¶
func (s *PetsHeaders) Validate() error
type RedirectFound ¶
type RedirectFound struct {
Location OptURI
}
RedirectFound is response for Redirect operation.
func (*RedirectFound) GetLocation ¶
func (s *RedirectFound) GetLocation() OptURI
GetLocation returns the value of Location.
func (*RedirectFound) SetLocation ¶
func (s *RedirectFound) SetLocation(val OptURI)
SetLocation sets the value of Location.
type RedirectRes ¶
type RedirectRes interface {
// contains filtered or unexported methods
}
type Route ¶
type Route struct {
// contains filtered or unexported fields
}
Route is route object.
func (Route) OperationID ¶
OperationID returns OpenAPI operationId.
type SecurityHandler ¶
type SecurityHandler interface { // HandleBearerAuth handles bearerAuth security. HandleBearerAuth(ctx context.Context, operationName string, t BearerAuth) (context.Context, error) // HandleCookieAuth handles cookieAuth security. HandleCookieAuth(ctx context.Context, operationName string, t CookieAuth) (context.Context, error) }
SecurityHandler is handler for security parameters.
type SecuritySource ¶
type SecuritySource interface { // BearerAuth provides bearerAuth security value. BearerAuth(ctx context.Context, operationName string) (BearerAuth, error) // CookieAuth provides cookieAuth security value. CookieAuth(ctx context.Context, operationName string) (CookieAuth, error) }
SecuritySource is provider of security values (tokens, passwords, etc.).
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server implements http server based on OpenAPI v3 specification and calls Handler to handle requests.
func NewServer ¶
func NewServer(h Handler, sec SecurityHandler, opts ...ServerOption) (*Server, error)
NewServer creates new Server.
type ServerOption ¶
type ServerOption interface {
// contains filtered or unexported methods
}
ServerOption is server config option.
func WithErrorHandler ¶
func WithErrorHandler(h ErrorHandler) ServerOption
WithErrorHandler specifies error handler to use.
func WithMaxMultipartMemory ¶
func WithMaxMultipartMemory(max int64) ServerOption
WithMaxMultipartMemory specifies limit of memory for storing file parts. File parts which can't be stored in memory will be stored on disk in temporary files.
func WithMethodNotAllowed ¶
func WithMethodNotAllowed(methodNotAllowed func(w http.ResponseWriter, r *http.Request, allowed string)) ServerOption
WithMethodNotAllowed specifies Method Not Allowed handler to use.
func WithMiddleware ¶
func WithMiddleware(m ...Middleware) ServerOption
WithMiddleware specifies middlewares to use.
func WithNotFound ¶
func WithNotFound(notFound http.HandlerFunc) ServerOption
WithNotFound specifies Not Found handler to use.
func WithPathPrefix ¶
func WithPathPrefix(prefix string) ServerOption
WithPathPrefix specifies server path prefix.
type ShowPetByIdParams ¶
type ShowPetByIdParams struct { // The id of the pet to retrieve. PetID string }
ShowPetByIdParams is parameters of showPetById operation.
type ShowPetByIdRes ¶
type ShowPetByIdRes interface {
// contains filtered or unexported methods
}
type UnimplementedHandler ¶
type UnimplementedHandler struct{}
UnimplementedHandler is no-op Handler which returns http.ErrNotImplemented.
func (UnimplementedHandler) CreatePets ¶
func (UnimplementedHandler) CreatePets(ctx context.Context, req *Pet) (r CreatePetsRes, _ error)
CreatePets implements createPets operation.
Create pet.
POST /pets
func (UnimplementedHandler) DeleteSession ¶
func (UnimplementedHandler) DeleteSession(ctx context.Context) (r *DeleteSessionOK, _ error)
DeleteSession implements deleteSession operation.
Delete session.
DELETE /session
func (UnimplementedHandler) GetSession ¶
func (UnimplementedHandler) GetSession(ctx context.Context) (r *GetSessionOK, _ error)
GetSession implements getSession operation.
Get session.
GET /session
func (UnimplementedHandler) ListPets ¶
func (UnimplementedHandler) ListPets(ctx context.Context, params ListPetsParams) (r *PetsHeaders, _ error)
ListPets implements listPets operation.
List pets.
GET /pets
func (UnimplementedHandler) NewError ¶
func (UnimplementedHandler) NewError(ctx context.Context, err error) (r *ErrorStatusCode)
NewError creates *ErrorStatusCode from error returned by handler.
Used for common default response.
func (UnimplementedHandler) Redirect ¶
func (UnimplementedHandler) Redirect(ctx context.Context) (r RedirectRes, _ error)
Redirect implements redirect operation.
Redirect.
GET /redirect
func (UnimplementedHandler) ShowPetById ¶
func (UnimplementedHandler) ShowPetById(ctx context.Context, params ShowPetByIdParams) (r ShowPetByIdRes, _ error)
ShowPetById implements showPetById operation.
Get pet by id.
GET /pets/{pet_id}
Source Files ¶
- generate.go
- oas_cfg_gen.go
- oas_client_gen.go
- oas_handlers_gen.go
- oas_interfaces_gen.go
- oas_json_gen.go
- oas_middleware_gen.go
- oas_parameters_gen.go
- oas_request_decoders_gen.go
- oas_request_encoders_gen.go
- oas_response_decoders_gen.go
- oas_response_encoders_gen.go
- oas_router_gen.go
- oas_schemas_gen.go
- oas_security_gen.go
- oas_server_gen.go
- oas_unimplemented_gen.go
- oas_validators_gen.go