Documentation
¶
Overview ¶
Code generated by ogen, DO NOT EDIT.
Index ¶
- func GetRolesForAPIKey(operation string) []string
- func WithServerURL(ctx context.Context, u *url.URL) context.Context
- type APIKey
- type Client
- type ClientOption
- type Error
- func (s *Error) Decode(d *jx.Decoder) error
- func (s *Error) Encode(e *jx.Encoder)
- func (s *Error) GetCode() int64
- func (s *Error) GetMessage() string
- func (s *Error) MarshalJSON() ([]byte, error)
- func (s *Error) SetCode(val int64)
- func (s *Error) SetMessage(val string)
- func (s *Error) UnmarshalJSON(data []byte) error
- type ErrorHandler
- type ErrorStatusCode
- type Handler
- type Invoker
- type Labeler
- type Middleware
- type OperationName
- type Option
- 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 SpanStatusBodyInternalServerError
- type SpanStatusBodyNotFound
- type SpanStatusBodyOK
- func (s *SpanStatusBodyOK) Decode(d *jx.Decoder) error
- func (s *SpanStatusBodyOK) Encode(e *jx.Encoder)
- func (s *SpanStatusBodyOK) GetMessage() string
- func (s *SpanStatusBodyOK) MarshalJSON() ([]byte, error)
- func (s *SpanStatusBodyOK) SetMessage(val string)
- func (s *SpanStatusBodyOK) UnmarshalJSON(data []byte) error
- func (s *SpanStatusBodyOK) Validate() error
- type SpanStatusBodyRes
- type SpanStatusNoBodyDef
- type SpanStatusRequestChecksOK
- type SpanStatusRequestChecksParams
- type SpanStatusRequestChecksReq
- func (s *SpanStatusRequestChecksReq) Decode(d *jx.Decoder) error
- func (s *SpanStatusRequestChecksReq) Encode(e *jx.Encoder)
- func (s *SpanStatusRequestChecksReq) GetMessage() string
- func (s *SpanStatusRequestChecksReq) MarshalJSON() ([]byte, error)
- func (s *SpanStatusRequestChecksReq) SetMessage(val string)
- func (s *SpanStatusRequestChecksReq) UnmarshalJSON(data []byte) error
- type UnimplementedHandler
- func (UnimplementedHandler) SpanStatusBody(ctx context.Context) (r SpanStatusBodyRes, _ error)
- func (UnimplementedHandler) SpanStatusNoBody(ctx context.Context) (r *SpanStatusNoBodyDef, _ error)
- func (UnimplementedHandler) SpanStatusRequestChecks(ctx context.Context, req *SpanStatusRequestChecksReq, ...) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetRolesForAPIKey ¶
GetRolesForAPIKey returns the required roles for the given operation.
This is useful for authorization scenarios where you need to know which roles are required for an operation.
Example:
requiredRoles := GetRolesForAPIKey(AddPetOperation)
Returns nil if the operation has no role requirements or if the operation is unknown.
Types ¶
type APIKey ¶
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) SpanStatusBody ¶
func (c *Client) SpanStatusBody(ctx context.Context) (SpanStatusBodyRes, error)
SpanStatusBody invokes spanStatusBody operation.
GET /span-status
func (*Client) SpanStatusNoBody ¶
func (c *Client) SpanStatusNoBody(ctx context.Context) (*SpanStatusNoBodyDef, error)
SpanStatusNoBody invokes spanStatusNoBody operation.
PUT /span-status
func (*Client) SpanStatusRequestChecks ¶
func (c *Client) SpanStatusRequestChecks(ctx context.Context, request *SpanStatusRequestChecksReq, params SpanStatusRequestChecksParams) error
SpanStatusRequestChecks invokes spanStatusRequestChecks operation.
POST /span-status
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 ¶
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) 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 Handler ¶
type Handler interface {
// SpanStatusBody implements spanStatusBody operation.
//
// GET /span-status
SpanStatusBody(ctx context.Context) (SpanStatusBodyRes, error)
// SpanStatusNoBody implements spanStatusNoBody operation.
//
// PUT /span-status
SpanStatusNoBody(ctx context.Context) (*SpanStatusNoBodyDef, error)
// SpanStatusRequestChecks implements spanStatusRequestChecks operation.
//
// POST /span-status
SpanStatusRequestChecks(ctx context.Context, req *SpanStatusRequestChecksReq, params SpanStatusRequestChecksParams) error
}
Handler handles operations described by OpenAPI v3 specification.
type Invoker ¶
type Invoker interface {
// SpanStatusBody invokes spanStatusBody operation.
//
// GET /span-status
SpanStatusBody(ctx context.Context) (SpanStatusBodyRes, error)
// SpanStatusNoBody invokes spanStatusNoBody operation.
//
// PUT /span-status
SpanStatusNoBody(ctx context.Context) (*SpanStatusNoBodyDef, error)
// SpanStatusRequestChecks invokes spanStatusRequestChecks operation.
//
// POST /span-status
SpanStatusRequestChecks(ctx context.Context, request *SpanStatusRequestChecksReq, params SpanStatusRequestChecksParams) 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 OperationName ¶
type OperationName = string
OperationName is the ogen operation name
const ( SpanStatusBodyOperation OperationName = "SpanStatusBody" SpanStatusNoBodyOperation OperationName = "SpanStatusNoBody" SpanStatusRequestChecksOperation OperationName = "SpanStatusRequestChecks" )
type Option ¶
type Option interface {
ServerOption
ClientOption
}
Option is config option.
func WithAttributes ¶
WithAttributes specifies default otel attributes.
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 Route ¶
type Route struct {
// contains filtered or unexported fields
}
Route is route object.
func (Route) OperationGroup ¶
OperationGroup returns the x-ogen-operation-group value.
func (Route) OperationID ¶
OperationID returns OpenAPI operationId.
type SecurityHandler ¶
type SecurityHandler interface {
// HandleAPIKey handles api_key security.
HandleAPIKey(ctx context.Context, operationName OperationName, t APIKey) (context.Context, error)
}
SecurityHandler is handler for security parameters.
type SecuritySource ¶
type SecuritySource interface {
// APIKey provides api_key security value.
APIKey(ctx context.Context, operationName OperationName) (APIKey, 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 SpanStatusBodyInternalServerError ¶
type SpanStatusBodyInternalServerError struct{}
SpanStatusBodyInternalServerError is response for SpanStatusBody operation.
type SpanStatusBodyNotFound ¶
type SpanStatusBodyNotFound struct{}
SpanStatusBodyNotFound is response for SpanStatusBody operation.
type SpanStatusBodyOK ¶
type SpanStatusBodyOK struct {
Message string `json:"message"`
}
func (*SpanStatusBodyOK) Decode ¶
func (s *SpanStatusBodyOK) Decode(d *jx.Decoder) error
Decode decodes SpanStatusBodyOK from json.
func (*SpanStatusBodyOK) Encode ¶
func (s *SpanStatusBodyOK) Encode(e *jx.Encoder)
Encode implements json.Marshaler.
func (*SpanStatusBodyOK) GetMessage ¶
func (s *SpanStatusBodyOK) GetMessage() string
GetMessage returns the value of Message.
func (*SpanStatusBodyOK) MarshalJSON ¶
func (s *SpanStatusBodyOK) MarshalJSON() ([]byte, error)
MarshalJSON implements stdjson.Marshaler.
func (*SpanStatusBodyOK) SetMessage ¶
func (s *SpanStatusBodyOK) SetMessage(val string)
SetMessage sets the value of Message.
func (*SpanStatusBodyOK) UnmarshalJSON ¶
func (s *SpanStatusBodyOK) UnmarshalJSON(data []byte) error
UnmarshalJSON implements stdjson.Unmarshaler.
func (*SpanStatusBodyOK) Validate ¶
func (s *SpanStatusBodyOK) Validate() error
type SpanStatusBodyRes ¶
type SpanStatusBodyRes interface {
// contains filtered or unexported methods
}
type SpanStatusNoBodyDef ¶
type SpanStatusNoBodyDef struct {
StatusCode int
}
SpanStatusNoBodyDef is default response for SpanStatusNoBody operation.
func (*SpanStatusNoBodyDef) GetStatusCode ¶
func (s *SpanStatusNoBodyDef) GetStatusCode() int
GetStatusCode returns the value of StatusCode.
func (*SpanStatusNoBodyDef) SetStatusCode ¶
func (s *SpanStatusNoBodyDef) SetStatusCode(val int)
SetStatusCode sets the value of StatusCode.
type SpanStatusRequestChecksOK ¶
type SpanStatusRequestChecksOK struct{}
SpanStatusRequestChecksOK is response for SpanStatusRequestChecks operation.
type SpanStatusRequestChecksParams ¶
type SpanStatusRequestChecksParams struct {
ID int
}
SpanStatusRequestChecksParams is parameters of spanStatusRequestChecks operation.
type SpanStatusRequestChecksReq ¶
type SpanStatusRequestChecksReq struct {
Message string `json:"message"`
}
func (*SpanStatusRequestChecksReq) Decode ¶
func (s *SpanStatusRequestChecksReq) Decode(d *jx.Decoder) error
Decode decodes SpanStatusRequestChecksReq from json.
func (*SpanStatusRequestChecksReq) Encode ¶
func (s *SpanStatusRequestChecksReq) Encode(e *jx.Encoder)
Encode implements json.Marshaler.
func (*SpanStatusRequestChecksReq) GetMessage ¶
func (s *SpanStatusRequestChecksReq) GetMessage() string
GetMessage returns the value of Message.
func (*SpanStatusRequestChecksReq) MarshalJSON ¶
func (s *SpanStatusRequestChecksReq) MarshalJSON() ([]byte, error)
MarshalJSON implements stdjson.Marshaler.
func (*SpanStatusRequestChecksReq) SetMessage ¶
func (s *SpanStatusRequestChecksReq) SetMessage(val string)
SetMessage sets the value of Message.
func (*SpanStatusRequestChecksReq) UnmarshalJSON ¶
func (s *SpanStatusRequestChecksReq) UnmarshalJSON(data []byte) error
UnmarshalJSON implements stdjson.Unmarshaler.
type UnimplementedHandler ¶
type UnimplementedHandler struct{}
UnimplementedHandler is no-op Handler which returns http.ErrNotImplemented.
func (UnimplementedHandler) SpanStatusBody ¶
func (UnimplementedHandler) SpanStatusBody(ctx context.Context) (r SpanStatusBodyRes, _ error)
SpanStatusBody implements spanStatusBody operation.
GET /span-status
func (UnimplementedHandler) SpanStatusNoBody ¶
func (UnimplementedHandler) SpanStatusNoBody(ctx context.Context) (r *SpanStatusNoBodyDef, _ error)
SpanStatusNoBody implements spanStatusNoBody operation.
PUT /span-status
func (UnimplementedHandler) SpanStatusRequestChecks ¶
func (UnimplementedHandler) SpanStatusRequestChecks(ctx context.Context, req *SpanStatusRequestChecksReq, params SpanStatusRequestChecksParams) error
SpanStatusRequestChecks implements spanStatusRequestChecks operation.
POST /span-status
Source Files
¶
- 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_operations_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