Documentation
¶
Overview ¶
Code generated by ogen, DO NOT EDIT.
Index ¶
- func WithServerURL(ctx context.Context, u *url.URL) context.Context
- type Client
- type ClientOption
- type Error
- type ErrorHandler
- type GetSampleBadRequest
- type GetSampleForbidden
- type GetSampleInternalServerError
- type GetSampleNotFound
- type GetSampleOK
- type GetSampleParams
- type GetSampleRes
- type GetSampleUnauthorized
- type Handler
- type Invoker
- type Labeler
- type Middleware
- type Option
- type PostSamplBadRequest
- type PostSamplForbidden
- type PostSamplInternalServerError
- type PostSamplNotFound
- type PostSamplOK
- type PostSamplReq
- type PostSamplRes
- type PostSamplUnauthorized
- type Route
- 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 UnimplementedHandler
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client implements OAS client.
func NewClient ¶
func NewClient(serverURL string, opts ...ClientOption) (*Client, error)
NewClient initializes new Client defined by OAS.
func (*Client) GetSample ¶
func (c *Client) GetSample(ctx context.Context, params GetSampleParams) (GetSampleRes, error)
GetSample invokes getSample operation.
Sample.
GET /
func (*Client) PostSampl ¶
func (c *Client) PostSampl(ctx context.Context, request *PostSamplReq) (PostSamplRes, error)
PostSampl invokes postSampl operation.
Sample.
POST /
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 Error ¶
type Error struct {
Message string `json:"message"`
}
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 GetSampleBadRequest ¶
type GetSampleBadRequest Error
func (*GetSampleBadRequest) Decode ¶
func (s *GetSampleBadRequest) Decode(d *jx.Decoder) error
Decode decodes GetSampleBadRequest from json.
func (*GetSampleBadRequest) Encode ¶
func (s *GetSampleBadRequest) Encode(e *jx.Encoder)
Encode encodes GetSampleBadRequest as json.
func (*GetSampleBadRequest) MarshalJSON ¶
func (s *GetSampleBadRequest) MarshalJSON() ([]byte, error)
MarshalJSON implements stdjson.Marshaler.
func (*GetSampleBadRequest) UnmarshalJSON ¶
func (s *GetSampleBadRequest) UnmarshalJSON(data []byte) error
UnmarshalJSON implements stdjson.Unmarshaler.
type GetSampleForbidden ¶
type GetSampleForbidden Error
func (*GetSampleForbidden) Decode ¶
func (s *GetSampleForbidden) Decode(d *jx.Decoder) error
Decode decodes GetSampleForbidden from json.
func (*GetSampleForbidden) Encode ¶
func (s *GetSampleForbidden) Encode(e *jx.Encoder)
Encode encodes GetSampleForbidden as json.
func (*GetSampleForbidden) MarshalJSON ¶
func (s *GetSampleForbidden) MarshalJSON() ([]byte, error)
MarshalJSON implements stdjson.Marshaler.
func (*GetSampleForbidden) UnmarshalJSON ¶
func (s *GetSampleForbidden) UnmarshalJSON(data []byte) error
UnmarshalJSON implements stdjson.Unmarshaler.
type GetSampleInternalServerError ¶
type GetSampleInternalServerError Error
func (*GetSampleInternalServerError) Decode ¶
func (s *GetSampleInternalServerError) Decode(d *jx.Decoder) error
Decode decodes GetSampleInternalServerError from json.
func (*GetSampleInternalServerError) Encode ¶
func (s *GetSampleInternalServerError) Encode(e *jx.Encoder)
Encode encodes GetSampleInternalServerError as json.
func (*GetSampleInternalServerError) MarshalJSON ¶
func (s *GetSampleInternalServerError) MarshalJSON() ([]byte, error)
MarshalJSON implements stdjson.Marshaler.
func (*GetSampleInternalServerError) UnmarshalJSON ¶
func (s *GetSampleInternalServerError) UnmarshalJSON(data []byte) error
UnmarshalJSON implements stdjson.Unmarshaler.
type GetSampleNotFound ¶
type GetSampleNotFound Error
func (*GetSampleNotFound) Decode ¶
func (s *GetSampleNotFound) Decode(d *jx.Decoder) error
Decode decodes GetSampleNotFound from json.
func (*GetSampleNotFound) Encode ¶
func (s *GetSampleNotFound) Encode(e *jx.Encoder)
Encode encodes GetSampleNotFound as json.
func (*GetSampleNotFound) MarshalJSON ¶
func (s *GetSampleNotFound) MarshalJSON() ([]byte, error)
MarshalJSON implements stdjson.Marshaler.
func (*GetSampleNotFound) UnmarshalJSON ¶
func (s *GetSampleNotFound) UnmarshalJSON(data []byte) error
UnmarshalJSON implements stdjson.Unmarshaler.
type GetSampleParams ¶
type GetSampleParams struct {
// Status.
Status int
}
GetSampleParams is parameters of getSample operation.
type GetSampleRes ¶
type GetSampleRes interface {
// contains filtered or unexported methods
}
type GetSampleUnauthorized ¶
type GetSampleUnauthorized Error
func (*GetSampleUnauthorized) Decode ¶
func (s *GetSampleUnauthorized) Decode(d *jx.Decoder) error
Decode decodes GetSampleUnauthorized from json.
func (*GetSampleUnauthorized) Encode ¶
func (s *GetSampleUnauthorized) Encode(e *jx.Encoder)
Encode encodes GetSampleUnauthorized as json.
func (*GetSampleUnauthorized) MarshalJSON ¶
func (s *GetSampleUnauthorized) MarshalJSON() ([]byte, error)
MarshalJSON implements stdjson.Marshaler.
func (*GetSampleUnauthorized) UnmarshalJSON ¶
func (s *GetSampleUnauthorized) UnmarshalJSON(data []byte) error
UnmarshalJSON implements stdjson.Unmarshaler.
type Handler ¶
type Handler interface {
// GetSample implements getSample operation.
//
// Sample.
//
// GET /
GetSample(ctx context.Context, params GetSampleParams) (GetSampleRes, error)
// PostSampl implements postSampl operation.
//
// Sample.
//
// POST /
PostSampl(ctx context.Context, req *PostSamplReq) (PostSamplRes, error)
}
Handler handles operations described by OpenAPI v3 specification.
type Invoker ¶
type Invoker interface {
// GetSample invokes getSample operation.
//
// Sample.
//
// GET /
GetSample(ctx context.Context, params GetSampleParams) (GetSampleRes, error)
// PostSampl invokes postSampl operation.
//
// Sample.
//
// POST /
PostSampl(ctx context.Context, request *PostSamplReq) (PostSamplRes, error)
}
Invoker invokes operations described by OpenAPI v3 specification.
type Labeler ¶
type Labeler struct {
// contains filtered or unexported fields
}
Labeler is used to allow adding custom attributes to the server request metrics.
func LabelerFromContext ¶
LabelerFromContext retrieves the Labeler from the provided context, if present.
If no Labeler was found in the provided context a new, empty Labeler is returned and the second return value is false. In this case it is safe to use the Labeler but any attributes added to it will not be used.
func (*Labeler) AttributeSet ¶
AttributeSet returns the attributes added to the Labeler as an attribute.Set.
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 PostSamplBadRequest ¶
type PostSamplBadRequest Error
func (*PostSamplBadRequest) Decode ¶
func (s *PostSamplBadRequest) Decode(d *jx.Decoder) error
Decode decodes PostSamplBadRequest from json.
func (*PostSamplBadRequest) Encode ¶
func (s *PostSamplBadRequest) Encode(e *jx.Encoder)
Encode encodes PostSamplBadRequest as json.
func (*PostSamplBadRequest) MarshalJSON ¶
func (s *PostSamplBadRequest) MarshalJSON() ([]byte, error)
MarshalJSON implements stdjson.Marshaler.
func (*PostSamplBadRequest) UnmarshalJSON ¶
func (s *PostSamplBadRequest) UnmarshalJSON(data []byte) error
UnmarshalJSON implements stdjson.Unmarshaler.
type PostSamplForbidden ¶
type PostSamplForbidden Error
func (*PostSamplForbidden) Decode ¶
func (s *PostSamplForbidden) Decode(d *jx.Decoder) error
Decode decodes PostSamplForbidden from json.
func (*PostSamplForbidden) Encode ¶
func (s *PostSamplForbidden) Encode(e *jx.Encoder)
Encode encodes PostSamplForbidden as json.
func (*PostSamplForbidden) MarshalJSON ¶
func (s *PostSamplForbidden) MarshalJSON() ([]byte, error)
MarshalJSON implements stdjson.Marshaler.
func (*PostSamplForbidden) UnmarshalJSON ¶
func (s *PostSamplForbidden) UnmarshalJSON(data []byte) error
UnmarshalJSON implements stdjson.Unmarshaler.
type PostSamplInternalServerError ¶
type PostSamplInternalServerError Error
func (*PostSamplInternalServerError) Decode ¶
func (s *PostSamplInternalServerError) Decode(d *jx.Decoder) error
Decode decodes PostSamplInternalServerError from json.
func (*PostSamplInternalServerError) Encode ¶
func (s *PostSamplInternalServerError) Encode(e *jx.Encoder)
Encode encodes PostSamplInternalServerError as json.
func (*PostSamplInternalServerError) MarshalJSON ¶
func (s *PostSamplInternalServerError) MarshalJSON() ([]byte, error)
MarshalJSON implements stdjson.Marshaler.
func (*PostSamplInternalServerError) UnmarshalJSON ¶
func (s *PostSamplInternalServerError) UnmarshalJSON(data []byte) error
UnmarshalJSON implements stdjson.Unmarshaler.
type PostSamplNotFound ¶
type PostSamplNotFound Error
func (*PostSamplNotFound) Decode ¶
func (s *PostSamplNotFound) Decode(d *jx.Decoder) error
Decode decodes PostSamplNotFound from json.
func (*PostSamplNotFound) Encode ¶
func (s *PostSamplNotFound) Encode(e *jx.Encoder)
Encode encodes PostSamplNotFound as json.
func (*PostSamplNotFound) MarshalJSON ¶
func (s *PostSamplNotFound) MarshalJSON() ([]byte, error)
MarshalJSON implements stdjson.Marshaler.
func (*PostSamplNotFound) UnmarshalJSON ¶
func (s *PostSamplNotFound) UnmarshalJSON(data []byte) error
UnmarshalJSON implements stdjson.Unmarshaler.
type PostSamplReq ¶
type PostSamplReq struct {
// Status.
Status int `json:"status"`
}
func (*PostSamplReq) Decode ¶
func (s *PostSamplReq) Decode(d *jx.Decoder) error
Decode decodes PostSamplReq from json.
func (*PostSamplReq) Encode ¶
func (s *PostSamplReq) Encode(e *jx.Encoder)
Encode implements json.Marshaler.
func (*PostSamplReq) GetStatus ¶
func (s *PostSamplReq) GetStatus() int
GetStatus returns the value of Status.
func (*PostSamplReq) MarshalJSON ¶
func (s *PostSamplReq) MarshalJSON() ([]byte, error)
MarshalJSON implements stdjson.Marshaler.
func (*PostSamplReq) SetStatus ¶
func (s *PostSamplReq) SetStatus(val int)
SetStatus sets the value of Status.
func (*PostSamplReq) UnmarshalJSON ¶
func (s *PostSamplReq) UnmarshalJSON(data []byte) error
UnmarshalJSON implements stdjson.Unmarshaler.
type PostSamplRes ¶
type PostSamplRes interface {
// contains filtered or unexported methods
}
type PostSamplUnauthorized ¶
type PostSamplUnauthorized Error
func (*PostSamplUnauthorized) Decode ¶
func (s *PostSamplUnauthorized) Decode(d *jx.Decoder) error
Decode decodes PostSamplUnauthorized from json.
func (*PostSamplUnauthorized) Encode ¶
func (s *PostSamplUnauthorized) Encode(e *jx.Encoder)
Encode encodes PostSamplUnauthorized as json.
func (*PostSamplUnauthorized) MarshalJSON ¶
func (s *PostSamplUnauthorized) MarshalJSON() ([]byte, error)
MarshalJSON implements stdjson.Marshaler.
func (*PostSamplUnauthorized) UnmarshalJSON ¶
func (s *PostSamplUnauthorized) UnmarshalJSON(data []byte) error
UnmarshalJSON implements stdjson.Unmarshaler.
type Route ¶
type Route struct {
// contains filtered or unexported fields
}
Route is route object.
func (Route) OperationID ¶
OperationID returns OpenAPI operationId.
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, 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 UnimplementedHandler ¶
type UnimplementedHandler struct{}
UnimplementedHandler is no-op Handler which returns http.ErrNotImplemented.
func (UnimplementedHandler) GetSample ¶
func (UnimplementedHandler) GetSample(ctx context.Context, params GetSampleParams) (r GetSampleRes, _ error)
GetSample implements getSample operation.
Sample.
GET /
func (UnimplementedHandler) PostSampl ¶
func (UnimplementedHandler) PostSampl(ctx context.Context, req *PostSamplReq) (r PostSamplRes, _ error)
PostSampl implements postSampl operation.
Sample.
POST /
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_labeler_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_server_gen.go
- oas_unimplemented_gen.go