Documentation ¶
Index ¶
- func WithServerURL(ctx context.Context, u *url.URL) context.Context
- type Client
- func (c *Client) AddPet(ctx context.Context, request *NewPet) (*Pet, error)
- func (c *Client) DeletePet(ctx context.Context, params DeletePetParams) error
- func (c *Client) FindPetByID(ctx context.Context, params FindPetByIDParams) (*Pet, error)
- func (c *Client) FindPets(ctx context.Context, params FindPetsParams) ([]Pet, error)
- type ClientOption
- type DeletePetNoContent
- type DeletePetParams
- type Error
- func (s *Error) Decode(d *jx.Decoder) error
- func (s *Error) Encode(e *jx.Encoder)
- func (s *Error) GetCode() int32
- func (s *Error) GetMessage() string
- func (s *Error) MarshalJSON() ([]byte, error)
- func (s *Error) SetCode(val int32)
- func (s *Error) SetFake()
- func (s *Error) SetMessage(val string)
- func (s *Error) UnmarshalJSON(data []byte) error
- type ErrorHandler
- type ErrorStatusCode
- type FindPetByIDParams
- type FindPetsParams
- type Handler
- type Invoker
- type Labeler
- type Middleware
- type NewPet
- func (s *NewPet) Decode(d *jx.Decoder) error
- func (s *NewPet) Encode(e *jx.Encoder)
- func (s *NewPet) GetName() string
- func (s *NewPet) GetTag() OptString
- func (s *NewPet) MarshalJSON() ([]byte, error)
- func (s *NewPet) SetFake()
- func (s *NewPet) SetName(val string)
- func (s *NewPet) SetTag(val OptString)
- func (s *NewPet) UnmarshalJSON(data []byte) error
- type OptInt32
- 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 (s *OptString) SetFake()
- func (o *OptString) SetTo(v string)
- func (s *OptString) UnmarshalJSON(data []byte) error
- type Option
- type Pet
- func (s *Pet) Decode(d *jx.Decoder) error
- func (s *Pet) Encode(e *jx.Encoder)
- func (s *Pet) GetID() int64
- func (s *Pet) GetName() string
- func (s *Pet) GetTag() OptString
- func (s *Pet) MarshalJSON() ([]byte, error)
- func (s *Pet) SetFake()
- func (s *Pet) SetID(val int64)
- func (s *Pet) SetName(val string)
- func (s *Pet) SetTag(val OptString)
- func (s *Pet) UnmarshalJSON(data []byte) error
- 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
- func (UnimplementedHandler) AddPet(ctx context.Context, req *NewPet) (r *Pet, _ error)
- func (UnimplementedHandler) DeletePet(ctx context.Context, params DeletePetParams) error
- func (UnimplementedHandler) FindPetByID(ctx context.Context, params FindPetByIDParams) (r *Pet, _ error)
- func (UnimplementedHandler) FindPets(ctx context.Context, params FindPetsParams) (r []Pet, _ error)
- func (UnimplementedHandler) NewError(ctx context.Context, err error) (r *ErrorStatusCode)
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) AddPet ¶
AddPet invokes addPet operation.
Creates a new pet in the store. Duplicates are allowed.
POST /pets
func (*Client) DeletePet ¶
func (c *Client) DeletePet(ctx context.Context, params DeletePetParams) error
DeletePet invokes deletePet operation.
Deletes a single pet based on the ID supplied.
DELETE /pets/{id}
func (*Client) FindPetByID ¶
FindPetByID invokes find pet by id operation.
Returns a user based on a single ID, if the user does not have access to the pet.
GET /pets/{id}
func (*Client) FindPets ¶
FindPets invokes findPets operation.
Returns all pets from the system that the user has access to Nam sed condimentum est. Maecenas tempor sagittis sapien, nec rhoncus sem sagittis sit amet. Aenean at gravida augue, ac iaculis sem. Curabitur odio lorem, ornare eget elementum nec, cursus id lectus. Duis mi turpis, pulvinar ac eros ac, tincidunt varius justo. In hac habitasse platea dictumst. Integer at adipiscing ante, a sagittis ligula. Aenean pharetra tempor ante molestie imperdiet. Vivamus id aliquam diam. Cras quis velit non tortor eleifend sagittis. Praesent at enim pharetra urna volutpat venenatis eget eget mauris. In eleifend fermentum facilisis. Praesent enim enim, gravida ac sodales sed, placerat id erat. Suspendisse lacus dolor, consectetur non augue vel,
vehicula interdum libero. Morbi euismod sagittis libero sed lacinia.
Sed tempus felis lobortis leo pulvinar rutrum. Nam mattis velit nisl, eu condimentum ligula luctus nec. Phasellus semper velit eget aliquet faucibus. In a mattis elit. Phasellus vel urna viverra, condimentum lorem id, rhoncus nibh. Ut pellentesque posuere elementum. Sed a varius odio. Morbi rhoncus ligula libero, vel eleifend nunc tristique vitae. Fusce et sem dui. Aenean nec scelerisque tortor. Fusce malesuada accumsan magna vel tempus. Quisque mollis felis eu dolor tristique, sit amet auctor felis gravida. Sed libero lorem, molestie sed nisl in, accumsan tempor nisi. Fusce sollicitudin massa ut lacinia mattis. Sed vel eleifend lorem. Pellentesque vitae felis pretium, pulvinar elit eu, euismod sapien.
GET /pets
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 DeletePetNoContent ¶
type DeletePetNoContent struct{}
DeletePetNoContent is response for DeletePet operation.
type DeletePetParams ¶
type DeletePetParams struct { // ID of pet to delete. ID int64 }
DeletePetParams is parameters of deletePet operation.
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) Error ¶
func (s *ErrorStatusCode) Error() string
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 FindPetByIDParams ¶
type FindPetByIDParams struct { // ID of pet to fetch. ID int64 }
FindPetByIDParams is parameters of find pet by id operation.
type FindPetsParams ¶
type FindPetsParams struct { // Tags to filter by. Tags []string // Maximum number of results to return. Limit OptInt32 }
FindPetsParams is parameters of findPets operation.
type Handler ¶
type Handler interface { // AddPet implements addPet operation. // // Creates a new pet in the store. Duplicates are allowed. // // POST /pets AddPet(ctx context.Context, req *NewPet) (*Pet, error) // DeletePet implements deletePet operation. // // Deletes a single pet based on the ID supplied. // // DELETE /pets/{id} DeletePet(ctx context.Context, params DeletePetParams) error // FindPetByID implements find pet by id operation. // // Returns a user based on a single ID, if the user does not have access to the pet. // // GET /pets/{id} FindPetByID(ctx context.Context, params FindPetByIDParams) (*Pet, error) // FindPets implements findPets operation. // // Returns all pets from the system that the user has access to // Nam sed condimentum est. Maecenas tempor sagittis sapien, nec rhoncus sem sagittis sit amet. // Aenean at gravida augue, ac iaculis sem. Curabitur odio lorem, ornare eget elementum nec, cursus // id lectus. Duis mi turpis, pulvinar ac eros ac, tincidunt varius justo. In hac habitasse platea // dictumst. Integer at adipiscing ante, a sagittis ligula. Aenean pharetra tempor ante molestie // imperdiet. Vivamus id aliquam diam. Cras quis velit non tortor eleifend sagittis. Praesent at enim // pharetra urna volutpat venenatis eget eget mauris. In eleifend fermentum facilisis. Praesent enim // enim, gravida ac sodales sed, placerat id erat. Suspendisse lacus dolor, consectetur non augue vel, // vehicula interdum libero. Morbi euismod sagittis libero sed lacinia. // Sed tempus felis lobortis leo pulvinar rutrum. Nam mattis velit nisl, eu condimentum ligula luctus // nec. Phasellus semper velit eget aliquet faucibus. In a mattis elit. Phasellus vel urna viverra, // condimentum lorem id, rhoncus nibh. Ut pellentesque posuere elementum. Sed a varius odio. Morbi // rhoncus ligula libero, vel eleifend nunc tristique vitae. Fusce et sem dui. Aenean nec scelerisque // tortor. Fusce malesuada accumsan magna vel tempus. Quisque mollis felis eu dolor tristique, sit // amet auctor felis gravida. Sed libero lorem, molestie sed nisl in, accumsan tempor nisi. Fusce // sollicitudin massa ut lacinia mattis. Sed vel eleifend lorem. Pellentesque vitae felis pretium, // pulvinar elit eu, euismod sapien. // // GET /pets FindPets(ctx context.Context, params FindPetsParams) ([]Pet, error) // NewError creates *ErrorStatusCode from error returned by handler. // // Used for common default response. NewError(ctx context.Context, err error) *ErrorStatusCode }
Handler handles operations described by OpenAPI v3 specification.
type Invoker ¶
type Invoker interface { // AddPet invokes addPet operation. // // Creates a new pet in the store. Duplicates are allowed. // // POST /pets AddPet(ctx context.Context, request *NewPet) (*Pet, error) // DeletePet invokes deletePet operation. // // Deletes a single pet based on the ID supplied. // // DELETE /pets/{id} DeletePet(ctx context.Context, params DeletePetParams) error // FindPetByID invokes find pet by id operation. // // Returns a user based on a single ID, if the user does not have access to the pet. // // GET /pets/{id} FindPetByID(ctx context.Context, params FindPetByIDParams) (*Pet, error) // FindPets invokes findPets operation. // // Returns all pets from the system that the user has access to // Nam sed condimentum est. Maecenas tempor sagittis sapien, nec rhoncus sem sagittis sit amet. // Aenean at gravida augue, ac iaculis sem. Curabitur odio lorem, ornare eget elementum nec, cursus // id lectus. Duis mi turpis, pulvinar ac eros ac, tincidunt varius justo. In hac habitasse platea // dictumst. Integer at adipiscing ante, a sagittis ligula. Aenean pharetra tempor ante molestie // imperdiet. Vivamus id aliquam diam. Cras quis velit non tortor eleifend sagittis. Praesent at enim // pharetra urna volutpat venenatis eget eget mauris. In eleifend fermentum facilisis. Praesent enim // enim, gravida ac sodales sed, placerat id erat. Suspendisse lacus dolor, consectetur non augue vel, // vehicula interdum libero. Morbi euismod sagittis libero sed lacinia. // Sed tempus felis lobortis leo pulvinar rutrum. Nam mattis velit nisl, eu condimentum ligula luctus // nec. Phasellus semper velit eget aliquet faucibus. In a mattis elit. Phasellus vel urna viverra, // condimentum lorem id, rhoncus nibh. Ut pellentesque posuere elementum. Sed a varius odio. Morbi // rhoncus ligula libero, vel eleifend nunc tristique vitae. Fusce et sem dui. Aenean nec scelerisque // tortor. Fusce malesuada accumsan magna vel tempus. Quisque mollis felis eu dolor tristique, sit // amet auctor felis gravida. Sed libero lorem, molestie sed nisl in, accumsan tempor nisi. Fusce // sollicitudin massa ut lacinia mattis. Sed vel eleifend lorem. Pellentesque vitae felis pretium, // pulvinar elit eu, euismod sapien. // // GET /pets FindPets(ctx context.Context, params FindPetsParams) ([]Pet, 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 NewPet ¶
Ref: #/components/schemas/NewPet
func (*NewPet) MarshalJSON ¶
MarshalJSON implements stdjson.Marshaler.
func (*NewPet) UnmarshalJSON ¶
UnmarshalJSON implements stdjson.Unmarshaler.
type OptInt32 ¶
OptInt32 is optional int32.
func NewOptInt32 ¶
NewOptInt32 returns new OptInt32 with value set to v.
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 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 Pet ¶
Merged schema. Ref: #/components/schemas/Pet
func (*Pet) MarshalJSON ¶
MarshalJSON implements stdjson.Marshaler.
func (*Pet) UnmarshalJSON ¶
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) AddPet ¶
AddPet implements addPet operation.
Creates a new pet in the store. Duplicates are allowed.
POST /pets
func (UnimplementedHandler) DeletePet ¶
func (UnimplementedHandler) DeletePet(ctx context.Context, params DeletePetParams) error
DeletePet implements deletePet operation.
Deletes a single pet based on the ID supplied.
DELETE /pets/{id}
func (UnimplementedHandler) FindPetByID ¶
func (UnimplementedHandler) FindPetByID(ctx context.Context, params FindPetByIDParams) (r *Pet, _ error)
FindPetByID implements find pet by id operation.
Returns a user based on a single ID, if the user does not have access to the pet.
GET /pets/{id}
func (UnimplementedHandler) FindPets ¶
func (UnimplementedHandler) FindPets(ctx context.Context, params FindPetsParams) (r []Pet, _ error)
FindPets implements findPets operation.
Returns all pets from the system that the user has access to Nam sed condimentum est. Maecenas tempor sagittis sapien, nec rhoncus sem sagittis sit amet. Aenean at gravida augue, ac iaculis sem. Curabitur odio lorem, ornare eget elementum nec, cursus id lectus. Duis mi turpis, pulvinar ac eros ac, tincidunt varius justo. In hac habitasse platea dictumst. Integer at adipiscing ante, a sagittis ligula. Aenean pharetra tempor ante molestie imperdiet. Vivamus id aliquam diam. Cras quis velit non tortor eleifend sagittis. Praesent at enim pharetra urna volutpat venenatis eget eget mauris. In eleifend fermentum facilisis. Praesent enim enim, gravida ac sodales sed, placerat id erat. Suspendisse lacus dolor, consectetur non augue vel,
vehicula interdum libero. Morbi euismod sagittis libero sed lacinia.
Sed tempus felis lobortis leo pulvinar rutrum. Nam mattis velit nisl, eu condimentum ligula luctus nec. Phasellus semper velit eget aliquet faucibus. In a mattis elit. Phasellus vel urna viverra, condimentum lorem id, rhoncus nibh. Ut pellentesque posuere elementum. Sed a varius odio. Morbi rhoncus ligula libero, vel eleifend nunc tristique vitae. Fusce et sem dui. Aenean nec scelerisque tortor. Fusce malesuada accumsan magna vel tempus. Quisque mollis felis eu dolor tristique, sit amet auctor felis gravida. Sed libero lorem, molestie sed nisl in, accumsan tempor nisi. Fusce sollicitudin massa ut lacinia mattis. Sed vel eleifend lorem. Pellentesque vitae felis pretium, pulvinar elit eu, euismod sapien.
GET /pets
func (UnimplementedHandler) NewError ¶
func (UnimplementedHandler) NewError(ctx context.Context, err error) (r *ErrorStatusCode)
NewError creates *ErrorStatusCode from error returned by handler.
Used for common default response.
Source Files ¶
- oas_cfg_gen.go
- oas_client_gen.go
- oas_faker_gen.go
- oas_handlers_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