Documentation
¶
Overview ¶
Code generated by ogen, DO NOT EDIT.
Index ¶
- func WithServerURL(ctx context.Context, u *url.URL) context.Context
- type Client
- func (c *Client) GetMixedData(ctx context.Context) (GetMixedDataRes, error)
- func (c *Client) GetNormalData(ctx context.Context) (*GetNormalDataOK, error)
- func (c *Client) GetRawData(ctx context.Context) (GetRawDataRes, error)
- func (c *Client) GetRawDataInsideOperationGroup(ctx context.Context) (GetRawDataInsideOperationGroupRes, error)
- type ClientOption
- type ErrorHandler
- type GetMixedDataOKApplicationJSON
- func (s *GetMixedDataOKApplicationJSON) Decode(d *jx.Decoder) error
- func (s *GetMixedDataOKApplicationJSON) Encode(e *jx.Encoder)
- func (s *GetMixedDataOKApplicationJSON) GetMessage() OptString
- func (s *GetMixedDataOKApplicationJSON) MarshalJSON() ([]byte, error)
- func (s *GetMixedDataOKApplicationJSON) SetMessage(val OptString)
- func (s *GetMixedDataOKApplicationJSON) UnmarshalJSON(data []byte) error
- type GetMixedDataOKApplicationOctetStream
- type GetMixedDataOKRawApplicationOctetStream
- type GetMixedDataRes
- type GetNormalDataOK
- func (s *GetNormalDataOK) Decode(d *jx.Decoder) error
- func (s *GetNormalDataOK) Encode(e *jx.Encoder)
- func (s *GetNormalDataOK) GetMessage() OptString
- func (s *GetNormalDataOK) MarshalJSON() ([]byte, error)
- func (s *GetNormalDataOK) SetMessage(val OptString)
- func (s *GetNormalDataOK) UnmarshalJSON(data []byte) error
- type GetRawDataInsideOperationGroupOK
- func (s *GetRawDataInsideOperationGroupOK) Decode(d *jx.Decoder) error
- func (s *GetRawDataInsideOperationGroupOK) Encode(e *jx.Encoder)
- func (s *GetRawDataInsideOperationGroupOK) GetMessage() OptString
- func (s *GetRawDataInsideOperationGroupOK) MarshalJSON() ([]byte, error)
- func (s *GetRawDataInsideOperationGroupOK) SetMessage(val OptString)
- func (s *GetRawDataInsideOperationGroupOK) UnmarshalJSON(data []byte) error
- type GetRawDataInsideOperationGroupOKRawApplicationJSON
- type GetRawDataInsideOperationGroupRes
- type GetRawDataOK
- type GetRawDataOKRawApplicationJSON
- type GetRawDataRes
- type Handler
- type Invoker
- type Labeler
- type Middleware
- type OperationName
- 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 Option
- type RawHandler
- 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 TestHandler
- type TestInvoker
- type UnimplementedHandler
- func (UnimplementedHandler) GetMixedData(ctx context.Context, w http.ResponseWriter) error
- func (UnimplementedHandler) GetNormalData(ctx context.Context) (r *GetNormalDataOK, _ error)
- func (UnimplementedHandler) GetRawData(ctx context.Context, w http.ResponseWriter) error
- func (UnimplementedHandler) GetRawDataInsideOperationGroup(ctx context.Context, w http.ResponseWriter) error
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) GetMixedData ¶
func (c *Client) GetMixedData(ctx context.Context) (GetMixedDataRes, error)
GetMixedData invokes getMixedData operation.
GET /mixed-data
func (*Client) GetNormalData ¶
func (c *Client) GetNormalData(ctx context.Context) (*GetNormalDataOK, error)
GetNormalData invokes getNormalData operation.
GET /normal-data
func (*Client) GetRawData ¶
func (c *Client) GetRawData(ctx context.Context) (GetRawDataRes, error)
GetRawData invokes getRawData operation.
GET /raw-data
func (*Client) GetRawDataInsideOperationGroup ¶ added in v1.19.0
func (c *Client) GetRawDataInsideOperationGroup(ctx context.Context) (GetRawDataInsideOperationGroupRes, error)
GetRawDataInsideOperationGroup invokes getRawDataInsideOperationGroup operation.
GET /raw-data-inside-operation-group
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 GetMixedDataOKApplicationJSON ¶
type GetMixedDataOKApplicationJSON struct {
Message OptString `json:"message"`
}
func (*GetMixedDataOKApplicationJSON) Decode ¶
func (s *GetMixedDataOKApplicationJSON) Decode(d *jx.Decoder) error
Decode decodes GetMixedDataOKApplicationJSON from json.
func (*GetMixedDataOKApplicationJSON) Encode ¶
func (s *GetMixedDataOKApplicationJSON) Encode(e *jx.Encoder)
Encode implements json.Marshaler.
func (*GetMixedDataOKApplicationJSON) GetMessage ¶
func (s *GetMixedDataOKApplicationJSON) GetMessage() OptString
GetMessage returns the value of Message.
func (*GetMixedDataOKApplicationJSON) MarshalJSON ¶
func (s *GetMixedDataOKApplicationJSON) MarshalJSON() ([]byte, error)
MarshalJSON implements stdjson.Marshaler.
func (*GetMixedDataOKApplicationJSON) SetMessage ¶
func (s *GetMixedDataOKApplicationJSON) SetMessage(val OptString)
SetMessage sets the value of Message.
func (*GetMixedDataOKApplicationJSON) UnmarshalJSON ¶
func (s *GetMixedDataOKApplicationJSON) UnmarshalJSON(data []byte) error
UnmarshalJSON implements stdjson.Unmarshaler.
type GetMixedDataOKRawApplicationOctetStream ¶
GetMixedDataOKRawApplicationOctetStream represents raw HTTP response for GetMixedData application/octet-stream.
func (*GetMixedDataOKRawApplicationOctetStream) GetResponse ¶
func (s *GetMixedDataOKRawApplicationOctetStream) GetResponse() *http.Response
GetResponse returns the value of Response.
func (*GetMixedDataOKRawApplicationOctetStream) SetResponse ¶
func (s *GetMixedDataOKRawApplicationOctetStream) SetResponse(val *http.Response)
SetResponse sets the value of Response.
type GetMixedDataRes ¶
type GetMixedDataRes interface {
// contains filtered or unexported methods
}
type GetNormalDataOK ¶
type GetNormalDataOK struct {
Message OptString `json:"message"`
}
func (*GetNormalDataOK) Decode ¶
func (s *GetNormalDataOK) Decode(d *jx.Decoder) error
Decode decodes GetNormalDataOK from json.
func (*GetNormalDataOK) Encode ¶
func (s *GetNormalDataOK) Encode(e *jx.Encoder)
Encode implements json.Marshaler.
func (*GetNormalDataOK) GetMessage ¶
func (s *GetNormalDataOK) GetMessage() OptString
GetMessage returns the value of Message.
func (*GetNormalDataOK) MarshalJSON ¶
func (s *GetNormalDataOK) MarshalJSON() ([]byte, error)
MarshalJSON implements stdjson.Marshaler.
func (*GetNormalDataOK) SetMessage ¶
func (s *GetNormalDataOK) SetMessage(val OptString)
SetMessage sets the value of Message.
func (*GetNormalDataOK) UnmarshalJSON ¶
func (s *GetNormalDataOK) UnmarshalJSON(data []byte) error
UnmarshalJSON implements stdjson.Unmarshaler.
type GetRawDataInsideOperationGroupOK ¶ added in v1.19.0
type GetRawDataInsideOperationGroupOK struct {
Message OptString `json:"message"`
}
func (*GetRawDataInsideOperationGroupOK) Decode ¶ added in v1.19.0
func (s *GetRawDataInsideOperationGroupOK) Decode(d *jx.Decoder) error
Decode decodes GetRawDataInsideOperationGroupOK from json.
func (*GetRawDataInsideOperationGroupOK) Encode ¶ added in v1.19.0
func (s *GetRawDataInsideOperationGroupOK) Encode(e *jx.Encoder)
Encode implements json.Marshaler.
func (*GetRawDataInsideOperationGroupOK) GetMessage ¶ added in v1.19.0
func (s *GetRawDataInsideOperationGroupOK) GetMessage() OptString
GetMessage returns the value of Message.
func (*GetRawDataInsideOperationGroupOK) MarshalJSON ¶ added in v1.19.0
func (s *GetRawDataInsideOperationGroupOK) MarshalJSON() ([]byte, error)
MarshalJSON implements stdjson.Marshaler.
func (*GetRawDataInsideOperationGroupOK) SetMessage ¶ added in v1.19.0
func (s *GetRawDataInsideOperationGroupOK) SetMessage(val OptString)
SetMessage sets the value of Message.
func (*GetRawDataInsideOperationGroupOK) UnmarshalJSON ¶ added in v1.19.0
func (s *GetRawDataInsideOperationGroupOK) UnmarshalJSON(data []byte) error
UnmarshalJSON implements stdjson.Unmarshaler.
type GetRawDataInsideOperationGroupOKRawApplicationJSON ¶ added in v1.19.0
type GetRawDataInsideOperationGroupOKRawApplicationJSON struct {
Response *http.Response `json:"-"`
}
GetRawDataInsideOperationGroupOKRawApplicationJSON represents raw HTTP response for GetRawDataInsideOperationGroup application/json.
func (*GetRawDataInsideOperationGroupOKRawApplicationJSON) GetResponse ¶ added in v1.19.0
func (s *GetRawDataInsideOperationGroupOKRawApplicationJSON) GetResponse() *http.Response
GetResponse returns the value of Response.
func (*GetRawDataInsideOperationGroupOKRawApplicationJSON) SetResponse ¶ added in v1.19.0
func (s *GetRawDataInsideOperationGroupOKRawApplicationJSON) SetResponse(val *http.Response)
SetResponse sets the value of Response.
type GetRawDataInsideOperationGroupRes ¶ added in v1.19.0
type GetRawDataInsideOperationGroupRes interface {
// contains filtered or unexported methods
}
type GetRawDataOK ¶
type GetRawDataOK struct {
Message OptString `json:"message"`
}
func (*GetRawDataOK) Decode ¶
func (s *GetRawDataOK) Decode(d *jx.Decoder) error
Decode decodes GetRawDataOK from json.
func (*GetRawDataOK) Encode ¶
func (s *GetRawDataOK) Encode(e *jx.Encoder)
Encode implements json.Marshaler.
func (*GetRawDataOK) GetMessage ¶
func (s *GetRawDataOK) GetMessage() OptString
GetMessage returns the value of Message.
func (*GetRawDataOK) MarshalJSON ¶
func (s *GetRawDataOK) MarshalJSON() ([]byte, error)
MarshalJSON implements stdjson.Marshaler.
func (*GetRawDataOK) SetMessage ¶
func (s *GetRawDataOK) SetMessage(val OptString)
SetMessage sets the value of Message.
func (*GetRawDataOK) UnmarshalJSON ¶
func (s *GetRawDataOK) UnmarshalJSON(data []byte) error
UnmarshalJSON implements stdjson.Unmarshaler.
type GetRawDataOKRawApplicationJSON ¶
GetRawDataOKRawApplicationJSON represents raw HTTP response for GetRawData application/json.
func (*GetRawDataOKRawApplicationJSON) GetResponse ¶
func (s *GetRawDataOKRawApplicationJSON) GetResponse() *http.Response
GetResponse returns the value of Response.
func (*GetRawDataOKRawApplicationJSON) SetResponse ¶
func (s *GetRawDataOKRawApplicationJSON) SetResponse(val *http.Response)
SetResponse sets the value of Response.
type GetRawDataRes ¶
type GetRawDataRes interface {
// contains filtered or unexported methods
}
type Handler ¶
type Handler interface {
TestHandler
// GetNormalData implements getNormalData operation.
//
// GET /normal-data
GetNormalData(ctx context.Context) (*GetNormalDataOK, error)
}
Handler handles operations described by OpenAPI v3 specification.
type Invoker ¶
type Invoker interface {
TestInvoker
// GetMixedData invokes getMixedData operation.
//
// GET /mixed-data
GetMixedData(ctx context.Context) (GetMixedDataRes, error)
// GetNormalData invokes getNormalData operation.
//
// GET /normal-data
GetNormalData(ctx context.Context) (*GetNormalDataOK, error)
// GetRawData invokes getRawData operation.
//
// GET /raw-data
GetRawData(ctx context.Context) (GetRawDataRes, 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 ( GetMixedDataOperation OperationName = "GetMixedData" GetNormalDataOperation OperationName = "GetNormalData" GetRawDataOperation OperationName = "GetRawData" GetRawDataInsideOperationGroupOperation OperationName = "GetRawDataInsideOperationGroup" )
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 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 RawHandler ¶
type RawHandler interface {
// GetMixedData implements getMixedData operation.
//
// GET /mixed-data
GetMixedData(ctx context.Context, w http.ResponseWriter) error
// GetRawData implements getRawData operation.
//
// GET /raw-data
GetRawData(ctx context.Context, w http.ResponseWriter) error
}
RawHandler handles raw response operations described by OpenAPI v3 specification.
type Route ¶
type Route struct {
// contains filtered or unexported fields
}
Route is route object.
func (Route) OperationGroup ¶ added in v1.17.0
OperationGroup returns the x-ogen-operation-group value.
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, rh RawHandler, 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 TestHandler ¶ added in v1.19.0
type TestHandler interface {
// GetRawDataInsideOperationGroup implements getRawDataInsideOperationGroup operation.
//
// GET /raw-data-inside-operation-group
GetRawDataInsideOperationGroup(ctx context.Context, w http.ResponseWriter) error
}
TestHandler handles operations described by OpenAPI v3 specification.
x-ogen-operation-group: Test
type TestInvoker ¶ added in v1.19.0
type TestInvoker interface {
// GetRawDataInsideOperationGroup invokes getRawDataInsideOperationGroup operation.
//
// GET /raw-data-inside-operation-group
GetRawDataInsideOperationGroup(ctx context.Context) (GetRawDataInsideOperationGroupRes, error)
}
TestInvoker invokes operations described by OpenAPI v3 specification.
x-gen-operation-group: Test
type UnimplementedHandler ¶
type UnimplementedHandler struct{}
UnimplementedHandler is no-op Handler which returns http.ErrNotImplemented.
func (UnimplementedHandler) GetMixedData ¶
func (UnimplementedHandler) GetMixedData(ctx context.Context, w http.ResponseWriter) error
GetMixedData implements getMixedData operation.
GET /mixed-data
func (UnimplementedHandler) GetNormalData ¶
func (UnimplementedHandler) GetNormalData(ctx context.Context) (r *GetNormalDataOK, _ error)
GetNormalData implements getNormalData operation.
GET /normal-data
func (UnimplementedHandler) GetRawData ¶
func (UnimplementedHandler) GetRawData(ctx context.Context, w http.ResponseWriter) error
GetRawData implements getRawData operation.
GET /raw-data
func (UnimplementedHandler) GetRawDataInsideOperationGroup ¶ added in v1.19.0
func (UnimplementedHandler) GetRawDataInsideOperationGroup(ctx context.Context, w http.ResponseWriter) error
GetRawDataInsideOperationGroup implements getRawDataInsideOperationGroup operation.
GET /raw-data-inside-operation-group
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_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