Documentation
¶
Index ¶
- func WithServerURL(ctx context.Context, u *url.URL) context.Context
- type Client
- type ClientOption
- type CreateGoldenItemsOK
- func (s *CreateGoldenItemsOK) Decode(d *jx.Decoder) error
- func (s *CreateGoldenItemsOK) Encode(e *jx.Encoder)
- func (s *CreateGoldenItemsOK) GetCreated() OptInt
- func (s *CreateGoldenItemsOK) MarshalJSON() ([]byte, error)
- func (s *CreateGoldenItemsOK) SetCreated(val OptInt)
- func (s *CreateGoldenItemsOK) UnmarshalJSON(data []byte) error
- type CreateGoldenItemsReq
- func (s *CreateGoldenItemsReq) Decode(d *jx.Decoder) error
- func (s *CreateGoldenItemsReq) Encode(e *jx.Encoder)
- func (s *CreateGoldenItemsReq) GetItems() []GoldenItem
- func (s *CreateGoldenItemsReq) MarshalJSON() ([]byte, error)
- func (s *CreateGoldenItemsReq) SetItems(val []GoldenItem)
- func (s *CreateGoldenItemsReq) UnmarshalJSON(data []byte) error
- func (s *CreateGoldenItemsReq) Validate() error
- type ErrorHandler
- type GoldenItem
- func (s *GoldenItem) Decode(d *jx.Decoder) error
- func (s *GoldenItem) Encode(e *jx.Encoder)
- func (a GoldenItem) Equal(b GoldenItem, depth int) bool
- func (s *GoldenItem) GetAttributes() OptGoldenItemAttributes
- func (s *GoldenItem) GetDescription() OptString
- func (s *GoldenItem) GetExternalRef() OptNilString
- func (s *GoldenItem) GetID() string
- func (s *GoldenItem) GetMetadata() OptMetadata
- func (s *GoldenItem) GetName() string
- func (s *GoldenItem) GetTags() []string
- func (a GoldenItem) Hash() uint64
- func (s *GoldenItem) MarshalJSON() ([]byte, error)
- func (s *GoldenItem) SetAttributes(val OptGoldenItemAttributes)
- func (s *GoldenItem) SetDescription(val OptString)
- func (s *GoldenItem) SetExternalRef(val OptNilString)
- func (s *GoldenItem) SetID(val string)
- func (s *GoldenItem) SetMetadata(val OptMetadata)
- func (s *GoldenItem) SetName(val string)
- func (s *GoldenItem) SetTags(val []string)
- func (s *GoldenItem) UnmarshalJSON(data []byte) error
- type GoldenItemAttributes
- type Handler
- type Invoker
- type Labeler
- type Metadata
- func (s *Metadata) Decode(d *jx.Decoder) error
- func (s *Metadata) Encode(e *jx.Encoder)
- func (a Metadata) Equal(b Metadata, depth int) bool
- func (s *Metadata) GetLabels() OptMetadataLabels
- func (s *Metadata) GetTimestamp() OptInt
- func (s *Metadata) GetVersion() OptString
- func (a Metadata) Hash() uint64
- func (s *Metadata) MarshalJSON() ([]byte, error)
- func (s *Metadata) SetLabels(val OptMetadataLabels)
- func (s *Metadata) SetTimestamp(val OptInt)
- func (s *Metadata) SetVersion(val OptString)
- func (s *Metadata) UnmarshalJSON(data []byte) error
- type MetadataLabels
- type Middleware
- type OperationName
- type OptGoldenItemAttributes
- func (o *OptGoldenItemAttributes) Decode(d *jx.Decoder) error
- func (o OptGoldenItemAttributes) Encode(e *jx.Encoder)
- func (o OptGoldenItemAttributes) Get() (v GoldenItemAttributes, ok bool)
- func (o OptGoldenItemAttributes) IsSet() bool
- func (s OptGoldenItemAttributes) MarshalJSON() ([]byte, error)
- func (o OptGoldenItemAttributes) Or(d GoldenItemAttributes) GoldenItemAttributes
- func (o *OptGoldenItemAttributes) Reset()
- func (o *OptGoldenItemAttributes) SetTo(v GoldenItemAttributes)
- func (s *OptGoldenItemAttributes) UnmarshalJSON(data []byte) error
- type OptInt
- func (o *OptInt) Decode(d *jx.Decoder) error
- func (o OptInt) Encode(e *jx.Encoder)
- func (o OptInt) Get() (v int, ok bool)
- func (o OptInt) IsSet() bool
- func (s OptInt) MarshalJSON() ([]byte, error)
- func (o OptInt) Or(d int) int
- func (o *OptInt) Reset()
- func (o *OptInt) SetTo(v int)
- func (s *OptInt) UnmarshalJSON(data []byte) error
- type OptMetadata
- func (o *OptMetadata) Decode(d *jx.Decoder) error
- func (o OptMetadata) Encode(e *jx.Encoder)
- func (o OptMetadata) Get() (v Metadata, ok bool)
- func (o OptMetadata) IsSet() bool
- func (s OptMetadata) MarshalJSON() ([]byte, error)
- func (o OptMetadata) Or(d Metadata) Metadata
- func (o *OptMetadata) Reset()
- func (o *OptMetadata) SetTo(v Metadata)
- func (s *OptMetadata) UnmarshalJSON(data []byte) error
- type OptMetadataLabels
- func (o *OptMetadataLabels) Decode(d *jx.Decoder) error
- func (o OptMetadataLabels) Encode(e *jx.Encoder)
- func (o OptMetadataLabels) Get() (v MetadataLabels, ok bool)
- func (o OptMetadataLabels) IsSet() bool
- func (s OptMetadataLabels) MarshalJSON() ([]byte, error)
- func (o OptMetadataLabels) Or(d MetadataLabels) MetadataLabels
- func (o *OptMetadataLabels) Reset()
- func (o *OptMetadataLabels) SetTo(v MetadataLabels)
- func (s *OptMetadataLabels) UnmarshalJSON(data []byte) error
- type OptNilString
- func (o *OptNilString) Decode(d *jx.Decoder) error
- func (o OptNilString) Encode(e *jx.Encoder)
- func (o OptNilString) Get() (v string, ok bool)
- func (o OptNilString) IsNull() bool
- func (o OptNilString) IsSet() bool
- func (s OptNilString) MarshalJSON() ([]byte, error)
- func (o OptNilString) Or(d string) string
- func (o *OptNilString) Reset()
- func (o *OptNilString) SetTo(v string)
- func (o *OptNilString) SetToNull()
- func (s *OptNilString) UnmarshalJSON(data []byte) error
- 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 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) CreateGoldenItems ¶
func (c *Client) CreateGoldenItems(ctx context.Context, request *CreateGoldenItemsReq) (*CreateGoldenItemsOK, error)
CreateGoldenItems invokes createGoldenItems operation.
Create items for golden file testing.
POST /golden/test
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 CreateGoldenItemsOK ¶
type CreateGoldenItemsOK struct {
Created OptInt `json:"created"`
}
func (*CreateGoldenItemsOK) Decode ¶
func (s *CreateGoldenItemsOK) Decode(d *jx.Decoder) error
Decode decodes CreateGoldenItemsOK from json.
func (*CreateGoldenItemsOK) Encode ¶
func (s *CreateGoldenItemsOK) Encode(e *jx.Encoder)
Encode implements json.Marshaler.
func (*CreateGoldenItemsOK) GetCreated ¶
func (s *CreateGoldenItemsOK) GetCreated() OptInt
GetCreated returns the value of Created.
func (*CreateGoldenItemsOK) MarshalJSON ¶
func (s *CreateGoldenItemsOK) MarshalJSON() ([]byte, error)
MarshalJSON implements stdjson.Marshaler.
func (*CreateGoldenItemsOK) SetCreated ¶
func (s *CreateGoldenItemsOK) SetCreated(val OptInt)
SetCreated sets the value of Created.
func (*CreateGoldenItemsOK) UnmarshalJSON ¶
func (s *CreateGoldenItemsOK) UnmarshalJSON(data []byte) error
UnmarshalJSON implements stdjson.Unmarshaler.
type CreateGoldenItemsReq ¶
type CreateGoldenItemsReq struct {
Items []GoldenItem `json:"items"`
}
func (*CreateGoldenItemsReq) Decode ¶
func (s *CreateGoldenItemsReq) Decode(d *jx.Decoder) error
Decode decodes CreateGoldenItemsReq from json.
func (*CreateGoldenItemsReq) Encode ¶
func (s *CreateGoldenItemsReq) Encode(e *jx.Encoder)
Encode implements json.Marshaler.
func (*CreateGoldenItemsReq) GetItems ¶
func (s *CreateGoldenItemsReq) GetItems() []GoldenItem
GetItems returns the value of Items.
func (*CreateGoldenItemsReq) MarshalJSON ¶
func (s *CreateGoldenItemsReq) MarshalJSON() ([]byte, error)
MarshalJSON implements stdjson.Marshaler.
func (*CreateGoldenItemsReq) SetItems ¶
func (s *CreateGoldenItemsReq) SetItems(val []GoldenItem)
SetItems sets the value of Items.
func (*CreateGoldenItemsReq) UnmarshalJSON ¶
func (s *CreateGoldenItemsReq) UnmarshalJSON(data []byte) error
UnmarshalJSON implements stdjson.Unmarshaler.
func (*CreateGoldenItemsReq) Validate ¶
func (s *CreateGoldenItemsReq) Validate() error
type GoldenItem ¶
type GoldenItem struct {
ID string `json:"id"`
Name string `json:"name"`
Description OptString `json:"description"`
ExternalRef OptNilString `json:"externalRef"`
Tags []string `json:"tags"`
Attributes OptGoldenItemAttributes `json:"attributes"`
Metadata OptMetadata `json:"metadata"`
}
Reference item with diverse field types. Ref: #/components/schemas/GoldenItem
func (*GoldenItem) Decode ¶
func (s *GoldenItem) Decode(d *jx.Decoder) error
Decode decodes GoldenItem from json.
func (*GoldenItem) Encode ¶
func (s *GoldenItem) Encode(e *jx.Encoder)
Encode implements json.Marshaler.
func (GoldenItem) Equal ¶
func (a GoldenItem) Equal(b GoldenItem, depth int) bool
Equal compares two GoldenItem instances for equality. The depth parameter prevents infinite recursion on nested objects.
func (*GoldenItem) GetAttributes ¶
func (s *GoldenItem) GetAttributes() OptGoldenItemAttributes
GetAttributes returns the value of Attributes.
func (*GoldenItem) GetDescription ¶
func (s *GoldenItem) GetDescription() OptString
GetDescription returns the value of Description.
func (*GoldenItem) GetExternalRef ¶
func (s *GoldenItem) GetExternalRef() OptNilString
GetExternalRef returns the value of ExternalRef.
func (*GoldenItem) GetMetadata ¶
func (s *GoldenItem) GetMetadata() OptMetadata
GetMetadata returns the value of Metadata.
func (*GoldenItem) GetName ¶
func (s *GoldenItem) GetName() string
GetName returns the value of Name.
func (*GoldenItem) GetTags ¶
func (s *GoldenItem) GetTags() []string
GetTags returns the value of Tags.
func (GoldenItem) Hash ¶
func (a GoldenItem) Hash() uint64
Hash computes a hash value for GoldenItem using FNV-1a. Equal objects must produce equal hashes.
func (*GoldenItem) MarshalJSON ¶
func (s *GoldenItem) MarshalJSON() ([]byte, error)
MarshalJSON implements stdjson.Marshaler.
func (*GoldenItem) SetAttributes ¶
func (s *GoldenItem) SetAttributes(val OptGoldenItemAttributes)
SetAttributes sets the value of Attributes.
func (*GoldenItem) SetDescription ¶
func (s *GoldenItem) SetDescription(val OptString)
SetDescription sets the value of Description.
func (*GoldenItem) SetExternalRef ¶
func (s *GoldenItem) SetExternalRef(val OptNilString)
SetExternalRef sets the value of ExternalRef.
func (*GoldenItem) SetMetadata ¶
func (s *GoldenItem) SetMetadata(val OptMetadata)
SetMetadata sets the value of Metadata.
func (*GoldenItem) SetName ¶
func (s *GoldenItem) SetName(val string)
SetName sets the value of Name.
func (*GoldenItem) SetTags ¶
func (s *GoldenItem) SetTags(val []string)
SetTags sets the value of Tags.
func (*GoldenItem) UnmarshalJSON ¶
func (s *GoldenItem) UnmarshalJSON(data []byte) error
UnmarshalJSON implements stdjson.Unmarshaler.
type GoldenItemAttributes ¶
func (*GoldenItemAttributes) Decode ¶
func (s *GoldenItemAttributes) Decode(d *jx.Decoder) error
Decode decodes GoldenItemAttributes from json.
func (GoldenItemAttributes) Encode ¶
func (s GoldenItemAttributes) Encode(e *jx.Encoder)
Encode implements json.Marshaler.
func (GoldenItemAttributes) MarshalJSON ¶
func (s GoldenItemAttributes) MarshalJSON() ([]byte, error)
MarshalJSON implements stdjson.Marshaler.
func (*GoldenItemAttributes) UnmarshalJSON ¶
func (s *GoldenItemAttributes) UnmarshalJSON(data []byte) error
UnmarshalJSON implements stdjson.Unmarshaler.
type Handler ¶
type Handler interface {
// CreateGoldenItems implements createGoldenItems operation.
//
// Create items for golden file testing.
//
// POST /golden/test
CreateGoldenItems(ctx context.Context, req *CreateGoldenItemsReq) (*CreateGoldenItemsOK, error)
}
Handler handles operations described by OpenAPI v3 specification.
type Invoker ¶
type Invoker interface {
// CreateGoldenItems invokes createGoldenItems operation.
//
// Create items for golden file testing.
//
// POST /golden/test
CreateGoldenItems(ctx context.Context, request *CreateGoldenItemsReq) (*CreateGoldenItemsOK, 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 Metadata ¶
type Metadata struct {
Version OptString `json:"version"`
Timestamp OptInt `json:"timestamp"`
Labels OptMetadataLabels `json:"labels"`
}
Ref: #/components/schemas/Metadata
func (Metadata) Equal ¶
Equal compares two Metadata instances for equality. The depth parameter prevents infinite recursion on nested objects.
func (*Metadata) GetLabels ¶
func (s *Metadata) GetLabels() OptMetadataLabels
GetLabels returns the value of Labels.
func (*Metadata) GetTimestamp ¶
GetTimestamp returns the value of Timestamp.
func (*Metadata) GetVersion ¶
GetVersion returns the value of Version.
func (Metadata) Hash ¶
Hash computes a hash value for Metadata using FNV-1a. Equal objects must produce equal hashes.
func (*Metadata) MarshalJSON ¶
MarshalJSON implements stdjson.Marshaler.
func (*Metadata) SetLabels ¶
func (s *Metadata) SetLabels(val OptMetadataLabels)
SetLabels sets the value of Labels.
func (*Metadata) SetTimestamp ¶
SetTimestamp sets the value of Timestamp.
func (*Metadata) SetVersion ¶
SetVersion sets the value of Version.
func (*Metadata) UnmarshalJSON ¶
UnmarshalJSON implements stdjson.Unmarshaler.
type MetadataLabels ¶
func (*MetadataLabels) Decode ¶
func (s *MetadataLabels) Decode(d *jx.Decoder) error
Decode decodes MetadataLabels from json.
func (MetadataLabels) Encode ¶
func (s MetadataLabels) Encode(e *jx.Encoder)
Encode implements json.Marshaler.
func (MetadataLabels) MarshalJSON ¶
func (s MetadataLabels) MarshalJSON() ([]byte, error)
MarshalJSON implements stdjson.Marshaler.
func (*MetadataLabels) UnmarshalJSON ¶
func (s *MetadataLabels) UnmarshalJSON(data []byte) error
UnmarshalJSON implements stdjson.Unmarshaler.
type OperationName ¶
type OperationName = string
OperationName is the ogen operation name
const (
CreateGoldenItemsOperation OperationName = "CreateGoldenItems"
)
type OptGoldenItemAttributes ¶
type OptGoldenItemAttributes struct {
Value GoldenItemAttributes
Set bool
}
OptGoldenItemAttributes is optional GoldenItemAttributes.
func NewOptGoldenItemAttributes ¶
func NewOptGoldenItemAttributes(v GoldenItemAttributes) OptGoldenItemAttributes
NewOptGoldenItemAttributes returns new OptGoldenItemAttributes with value set to v.
func (*OptGoldenItemAttributes) Decode ¶
func (o *OptGoldenItemAttributes) Decode(d *jx.Decoder) error
Decode decodes GoldenItemAttributes from json.
func (OptGoldenItemAttributes) Encode ¶
func (o OptGoldenItemAttributes) Encode(e *jx.Encoder)
Encode encodes GoldenItemAttributes as json.
func (OptGoldenItemAttributes) Get ¶
func (o OptGoldenItemAttributes) Get() (v GoldenItemAttributes, ok bool)
Get returns value and boolean that denotes whether value was set.
func (OptGoldenItemAttributes) IsSet ¶
func (o OptGoldenItemAttributes) IsSet() bool
IsSet returns true if OptGoldenItemAttributes was set.
func (OptGoldenItemAttributes) MarshalJSON ¶
func (s OptGoldenItemAttributes) MarshalJSON() ([]byte, error)
MarshalJSON implements stdjson.Marshaler.
func (OptGoldenItemAttributes) Or ¶
func (o OptGoldenItemAttributes) Or(d GoldenItemAttributes) GoldenItemAttributes
Or returns value if set, or given parameter if does not.
func (*OptGoldenItemAttributes) Reset ¶
func (o *OptGoldenItemAttributes) Reset()
Reset unsets value.
func (*OptGoldenItemAttributes) SetTo ¶
func (o *OptGoldenItemAttributes) SetTo(v GoldenItemAttributes)
SetTo sets value to v.
func (*OptGoldenItemAttributes) UnmarshalJSON ¶
func (s *OptGoldenItemAttributes) UnmarshalJSON(data []byte) error
UnmarshalJSON implements stdjson.Unmarshaler.
type OptInt ¶
OptInt is optional int.
func (OptInt) MarshalJSON ¶
MarshalJSON implements stdjson.Marshaler.
func (*OptInt) UnmarshalJSON ¶
UnmarshalJSON implements stdjson.Unmarshaler.
type OptMetadata ¶
OptMetadata is optional Metadata.
func NewOptMetadata ¶
func NewOptMetadata(v Metadata) OptMetadata
NewOptMetadata returns new OptMetadata with value set to v.
func (*OptMetadata) Decode ¶
func (o *OptMetadata) Decode(d *jx.Decoder) error
Decode decodes Metadata from json.
func (OptMetadata) Encode ¶
func (o OptMetadata) Encode(e *jx.Encoder)
Encode encodes Metadata as json.
func (OptMetadata) Get ¶
func (o OptMetadata) Get() (v Metadata, ok bool)
Get returns value and boolean that denotes whether value was set.
func (OptMetadata) IsSet ¶
func (o OptMetadata) IsSet() bool
IsSet returns true if OptMetadata was set.
func (OptMetadata) MarshalJSON ¶
func (s OptMetadata) MarshalJSON() ([]byte, error)
MarshalJSON implements stdjson.Marshaler.
func (OptMetadata) Or ¶
func (o OptMetadata) Or(d Metadata) Metadata
Or returns value if set, or given parameter if does not.
func (*OptMetadata) UnmarshalJSON ¶
func (s *OptMetadata) UnmarshalJSON(data []byte) error
UnmarshalJSON implements stdjson.Unmarshaler.
type OptMetadataLabels ¶
type OptMetadataLabels struct {
Value MetadataLabels
Set bool
}
OptMetadataLabels is optional MetadataLabels.
func NewOptMetadataLabels ¶
func NewOptMetadataLabels(v MetadataLabels) OptMetadataLabels
NewOptMetadataLabels returns new OptMetadataLabels with value set to v.
func (*OptMetadataLabels) Decode ¶
func (o *OptMetadataLabels) Decode(d *jx.Decoder) error
Decode decodes MetadataLabels from json.
func (OptMetadataLabels) Encode ¶
func (o OptMetadataLabels) Encode(e *jx.Encoder)
Encode encodes MetadataLabels as json.
func (OptMetadataLabels) Get ¶
func (o OptMetadataLabels) Get() (v MetadataLabels, ok bool)
Get returns value and boolean that denotes whether value was set.
func (OptMetadataLabels) IsSet ¶
func (o OptMetadataLabels) IsSet() bool
IsSet returns true if OptMetadataLabels was set.
func (OptMetadataLabels) MarshalJSON ¶
func (s OptMetadataLabels) MarshalJSON() ([]byte, error)
MarshalJSON implements stdjson.Marshaler.
func (OptMetadataLabels) Or ¶
func (o OptMetadataLabels) Or(d MetadataLabels) MetadataLabels
Or returns value if set, or given parameter if does not.
func (*OptMetadataLabels) SetTo ¶
func (o *OptMetadataLabels) SetTo(v MetadataLabels)
SetTo sets value to v.
func (*OptMetadataLabels) UnmarshalJSON ¶
func (s *OptMetadataLabels) UnmarshalJSON(data []byte) error
UnmarshalJSON implements stdjson.Unmarshaler.
type OptNilString ¶
OptNilString is optional nullable string.
func NewOptNilString ¶
func NewOptNilString(v string) OptNilString
NewOptNilString returns new OptNilString with value set to v.
func (*OptNilString) Decode ¶
func (o *OptNilString) Decode(d *jx.Decoder) error
Decode decodes string from json.
func (OptNilString) Encode ¶
func (o OptNilString) Encode(e *jx.Encoder)
Encode encodes string as json.
func (OptNilString) Get ¶
func (o OptNilString) Get() (v string, ok bool)
Get returns value and boolean that denotes whether value was set.
func (OptNilString) IsNull ¶
func (o OptNilString) IsNull() bool
IsNull returns true if value is Null.
func (OptNilString) IsSet ¶
func (o OptNilString) IsSet() bool
IsSet returns true if OptNilString was set.
func (OptNilString) MarshalJSON ¶
func (s OptNilString) MarshalJSON() ([]byte, error)
MarshalJSON implements stdjson.Marshaler.
func (OptNilString) Or ¶
func (o OptNilString) Or(d string) string
Or returns value if set, or given parameter if does not.
func (*OptNilString) UnmarshalJSON ¶
func (s *OptNilString) UnmarshalJSON(data []byte) error
UnmarshalJSON implements stdjson.Unmarshaler.
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 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) CreateGoldenItems ¶
func (UnimplementedHandler) CreateGoldenItems(ctx context.Context, req *CreateGoldenItemsReq) (r *CreateGoldenItemsOK, _ error)
CreateGoldenItems implements createGoldenItems operation.
Create items for golden file testing.
POST /golden/test
Source Files
¶
- api_validators_unique_gen.go
- oas_cfg_gen.go
- oas_client_gen.go
- oas_golden_item_equal_gen.go
- oas_golden_item_hash_gen.go
- oas_handlers_gen.go
- oas_json_gen.go
- oas_labeler_gen.go
- oas_metadata_equal_gen.go
- oas_metadata_hash_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
- oas_validators_gen.go