Documentation
¶
Index ¶
- Constants
- func WithServerURL(ctx context.Context, u *url.URL) context.Context
- type Client
- type ClientOption
- type Enums
- func (s *Enums) Decode(d *jx.Decoder) error
- func (s *Enums) Encode(e *jx.Encoder)
- func (s *Enums) GetByte() OptEnumsByte
- func (s *Enums) GetIP() OptEnumsIP
- func (s *Enums) GetURI() OptEnumsURI
- func (s *Enums) GetUUID() UUIDEnum
- func (s *Enums) MarshalJSON() ([]byte, error)
- func (s *Enums) SetByte(val OptEnumsByte)
- func (s *Enums) SetIP(val OptEnumsIP)
- func (s *Enums) SetURI(val OptEnumsURI)
- func (s *Enums) SetUUID(val UUIDEnum)
- func (s *Enums) UnmarshalJSON(data []byte) error
- func (s *Enums) Validate() error
- type EnumsByte
- func (EnumsByte) AllValues() []EnumsByte
- func (s *EnumsByte) Decode(d *jx.Decoder) error
- func (s EnumsByte) Encode(e *jx.Encoder)
- func (s EnumsByte) MarshalJSON() ([]byte, error)
- func (s EnumsByte) MarshalText() ([]byte, error)
- func (s *EnumsByte) UnmarshalJSON(data []byte) error
- func (s *EnumsByte) UnmarshalText(data []byte) error
- func (s EnumsByte) Validate() error
- type EnumsIP
- func (EnumsIP) AllValues() []EnumsIP
- func (s *EnumsIP) Decode(d *jx.Decoder) error
- func (s EnumsIP) Encode(e *jx.Encoder)
- func (s EnumsIP) MarshalJSON() ([]byte, error)
- func (s EnumsIP) MarshalText() ([]byte, error)
- func (s *EnumsIP) UnmarshalJSON(data []byte) error
- func (s *EnumsIP) UnmarshalText(data []byte) error
- func (s EnumsIP) Validate() error
- type EnumsURI
- func (EnumsURI) AllValues() []EnumsURI
- func (s *EnumsURI) Decode(d *jx.Decoder) error
- func (s EnumsURI) Encode(e *jx.Encoder)
- func (s EnumsURI) MarshalJSON() ([]byte, error)
- func (s EnumsURI) MarshalText() ([]byte, error)
- func (s *EnumsURI) UnmarshalJSON(data []byte) error
- func (s *EnumsURI) UnmarshalText(data []byte) error
- func (s EnumsURI) Validate() error
- type ErrorHandler
- type Handler
- type Int32Enum
- type Invoker
- type Labeler
- type MACEnum
- type Middleware
- type OperationName
- type OptEnumsByte
- func (o *OptEnumsByte) Decode(d *jx.Decoder) error
- func (o OptEnumsByte) Encode(e *jx.Encoder)
- func (o OptEnumsByte) Get() (v EnumsByte, ok bool)
- func (o OptEnumsByte) IsSet() bool
- func (s OptEnumsByte) MarshalJSON() ([]byte, error)
- func (o OptEnumsByte) Or(d EnumsByte) EnumsByte
- func (o *OptEnumsByte) Reset()
- func (o *OptEnumsByte) SetTo(v EnumsByte)
- func (s *OptEnumsByte) UnmarshalJSON(data []byte) error
- type OptEnumsIP
- func (o *OptEnumsIP) Decode(d *jx.Decoder) error
- func (o OptEnumsIP) Encode(e *jx.Encoder)
- func (o OptEnumsIP) Get() (v EnumsIP, ok bool)
- func (o OptEnumsIP) IsSet() bool
- func (s OptEnumsIP) MarshalJSON() ([]byte, error)
- func (o OptEnumsIP) Or(d EnumsIP) EnumsIP
- func (o *OptEnumsIP) Reset()
- func (o *OptEnumsIP) SetTo(v EnumsIP)
- func (s *OptEnumsIP) UnmarshalJSON(data []byte) error
- type OptEnumsURI
- func (o *OptEnumsURI) Decode(d *jx.Decoder) error
- func (o OptEnumsURI) Encode(e *jx.Encoder)
- func (o OptEnumsURI) Get() (v EnumsURI, ok bool)
- func (o OptEnumsURI) IsSet() bool
- func (s OptEnumsURI) MarshalJSON() ([]byte, error)
- func (o OptEnumsURI) Or(d EnumsURI) EnumsURI
- func (o *OptEnumsURI) Reset()
- func (o *OptEnumsURI) SetTo(v EnumsURI)
- func (s *OptEnumsURI) UnmarshalJSON(data []byte) error
- type Option
- type PostEnumsParams
- 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 UUIDEnum
- func (UUIDEnum) AllValues() []UUIDEnum
- func (s *UUIDEnum) Decode(d *jx.Decoder) error
- func (s UUIDEnum) Encode(e *jx.Encoder)
- func (s UUIDEnum) MarshalJSON() ([]byte, error)
- func (s UUIDEnum) MarshalText() ([]byte, error)
- func (s *UUIDEnum) UnmarshalJSON(data []byte) error
- func (s *UUIDEnum) UnmarshalText(data []byte) error
- func (s UUIDEnum) Validate() error
- type UnimplementedHandler
Constants ¶
const (
MediaTypeApplicationJSON string = "application/json"
)
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client implements OAS client.
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 Enums ¶
type Enums struct {
UUID UUIDEnum `json:"uuid"`
IP OptEnumsIP `json:"ip"`
URI OptEnumsURI `json:"uri"`
Byte OptEnumsByte `json:"byte"`
}
Ref: #/components/schemas/Enums
func (*Enums) MarshalJSON ¶
MarshalJSON implements stdjson.Marshaler.
func (*Enums) UnmarshalJSON ¶
UnmarshalJSON implements stdjson.Unmarshaler.
type EnumsByte ¶
type EnumsByte string
const (
EnumsByteAGVsbG8 EnumsByte = "aGVsbG8="
)
func (EnumsByte) MarshalJSON ¶
MarshalJSON implements stdjson.Marshaler.
func (EnumsByte) MarshalText ¶
MarshalText implements encoding.TextMarshaler.
func (*EnumsByte) UnmarshalJSON ¶
UnmarshalJSON implements stdjson.Unmarshaler.
func (*EnumsByte) UnmarshalText ¶
UnmarshalText implements encoding.TextUnmarshaler.
type EnumsIP ¶
type EnumsIP string
func (EnumsIP) MarshalJSON ¶
MarshalJSON implements stdjson.Marshaler.
func (EnumsIP) MarshalText ¶
MarshalText implements encoding.TextMarshaler.
func (*EnumsIP) UnmarshalJSON ¶
UnmarshalJSON implements stdjson.Unmarshaler.
func (*EnumsIP) UnmarshalText ¶
UnmarshalText implements encoding.TextUnmarshaler.
type EnumsURI ¶
type EnumsURI string
const (
EnumsURIHTTPSExampleCom EnumsURI = "https://example.com/"
)
func (EnumsURI) MarshalJSON ¶
MarshalJSON implements stdjson.Marshaler.
func (EnumsURI) MarshalText ¶
MarshalText implements encoding.TextMarshaler.
func (*EnumsURI) UnmarshalJSON ¶
UnmarshalJSON implements stdjson.Unmarshaler.
func (*EnumsURI) UnmarshalText ¶
UnmarshalText implements encoding.TextUnmarshaler.
type Handler ¶
type Handler interface {
// PostEnums implements postEnums operation.
//
// POST /enums/{id}
PostEnums(ctx context.Context, req *Enums, params PostEnumsParams) (*Enums, error)
}
Handler handles operations described by OpenAPI v3 specification.
type Int32Enum ¶
type Int32Enum string
Ref: #/components/schemas/Int32Enum
func (Int32Enum) MarshalText ¶
MarshalText implements encoding.TextMarshaler.
func (*Int32Enum) UnmarshalText ¶
UnmarshalText implements encoding.TextUnmarshaler.
type Invoker ¶
type Invoker interface {
// PostEnums invokes postEnums operation.
//
// POST /enums/{id}
PostEnums(ctx context.Context, request *Enums, params PostEnumsParams) (*Enums, 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 MACEnum ¶
type MACEnum string
Ref: #/components/schemas/MACEnum
const (
MACEnum112233445566 MACEnum = "11:22:33:44:55:66"
)
func (MACEnum) MarshalText ¶
MarshalText implements encoding.TextMarshaler.
func (*MACEnum) UnmarshalText ¶
UnmarshalText implements encoding.TextUnmarshaler.
type OperationName ¶
type OperationName = string
OperationName is the ogen operation name
const (
PostEnumsOperation OperationName = "PostEnums"
)
type OptEnumsByte ¶
OptEnumsByte is optional EnumsByte.
func NewOptEnumsByte ¶
func NewOptEnumsByte(v EnumsByte) OptEnumsByte
NewOptEnumsByte returns new OptEnumsByte with value set to v.
func (*OptEnumsByte) Decode ¶
func (o *OptEnumsByte) Decode(d *jx.Decoder) error
Decode decodes EnumsByte from json.
func (OptEnumsByte) Encode ¶
func (o OptEnumsByte) Encode(e *jx.Encoder)
Encode encodes EnumsByte as json.
func (OptEnumsByte) Get ¶
func (o OptEnumsByte) Get() (v EnumsByte, ok bool)
Get returns value and boolean that denotes whether value was set.
func (OptEnumsByte) IsSet ¶
func (o OptEnumsByte) IsSet() bool
IsSet returns true if OptEnumsByte was set.
func (OptEnumsByte) MarshalJSON ¶
func (s OptEnumsByte) MarshalJSON() ([]byte, error)
MarshalJSON implements stdjson.Marshaler.
func (OptEnumsByte) Or ¶
func (o OptEnumsByte) Or(d EnumsByte) EnumsByte
Or returns value if set, or given parameter if does not.
func (*OptEnumsByte) UnmarshalJSON ¶
func (s *OptEnumsByte) UnmarshalJSON(data []byte) error
UnmarshalJSON implements stdjson.Unmarshaler.
type OptEnumsIP ¶
OptEnumsIP is optional EnumsIP.
func NewOptEnumsIP ¶
func NewOptEnumsIP(v EnumsIP) OptEnumsIP
NewOptEnumsIP returns new OptEnumsIP with value set to v.
func (*OptEnumsIP) Decode ¶
func (o *OptEnumsIP) Decode(d *jx.Decoder) error
Decode decodes EnumsIP from json.
func (OptEnumsIP) Encode ¶
func (o OptEnumsIP) Encode(e *jx.Encoder)
Encode encodes EnumsIP as json.
func (OptEnumsIP) Get ¶
func (o OptEnumsIP) Get() (v EnumsIP, ok bool)
Get returns value and boolean that denotes whether value was set.
func (OptEnumsIP) IsSet ¶
func (o OptEnumsIP) IsSet() bool
IsSet returns true if OptEnumsIP was set.
func (OptEnumsIP) MarshalJSON ¶
func (s OptEnumsIP) MarshalJSON() ([]byte, error)
MarshalJSON implements stdjson.Marshaler.
func (OptEnumsIP) Or ¶
func (o OptEnumsIP) Or(d EnumsIP) EnumsIP
Or returns value if set, or given parameter if does not.
func (*OptEnumsIP) UnmarshalJSON ¶
func (s *OptEnumsIP) UnmarshalJSON(data []byte) error
UnmarshalJSON implements stdjson.Unmarshaler.
type OptEnumsURI ¶
OptEnumsURI is optional EnumsURI.
func NewOptEnumsURI ¶
func NewOptEnumsURI(v EnumsURI) OptEnumsURI
NewOptEnumsURI returns new OptEnumsURI with value set to v.
func (*OptEnumsURI) Decode ¶
func (o *OptEnumsURI) Decode(d *jx.Decoder) error
Decode decodes EnumsURI from json.
func (OptEnumsURI) Encode ¶
func (o OptEnumsURI) Encode(e *jx.Encoder)
Encode encodes EnumsURI as json.
func (OptEnumsURI) Get ¶
func (o OptEnumsURI) Get() (v EnumsURI, ok bool)
Get returns value and boolean that denotes whether value was set.
func (OptEnumsURI) IsSet ¶
func (o OptEnumsURI) IsSet() bool
IsSet returns true if OptEnumsURI was set.
func (OptEnumsURI) MarshalJSON ¶
func (s OptEnumsURI) MarshalJSON() ([]byte, error)
MarshalJSON implements stdjson.Marshaler.
func (OptEnumsURI) Or ¶
func (o OptEnumsURI) Or(d EnumsURI) EnumsURI
Or returns value if set, or given parameter if does not.
func (*OptEnumsURI) UnmarshalJSON ¶
func (s *OptEnumsURI) UnmarshalJSON(data []byte) error
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 PostEnumsParams ¶
PostEnumsParams is parameters of postEnums operation.
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 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 UUIDEnum ¶
type UUIDEnum string
Ref: #/components/schemas/UUIDEnum
func (UUIDEnum) MarshalJSON ¶
MarshalJSON implements stdjson.Marshaler.
func (UUIDEnum) MarshalText ¶
MarshalText implements encoding.TextMarshaler.
func (*UUIDEnum) UnmarshalJSON ¶
UnmarshalJSON implements stdjson.Unmarshaler.
func (*UUIDEnum) UnmarshalText ¶
UnmarshalText implements encoding.TextUnmarshaler.
type UnimplementedHandler ¶
type UnimplementedHandler struct{}
UnimplementedHandler is no-op Handler which returns http.ErrNotImplemented.
func (UnimplementedHandler) PostEnums ¶
func (UnimplementedHandler) PostEnums(ctx context.Context, req *Enums, params PostEnumsParams) (r *Enums, _ error)
PostEnums implements postEnums operation.
POST /enums/{id}
Source Files
¶
- oas_cfg_gen.go
- oas_client_gen.go
- oas_handlers_gen.go
- oas_json_gen.go
- oas_labeler_gen.go
- oas_mediatypes_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_server_gen.go
- oas_unimplemented_gen.go
- oas_validators_gen.go