Documentation ¶
Overview ¶
Code generated by ogen, DO NOT EDIT.
Index ¶
- func WithServerURL(ctx context.Context, u *url.URL) context.Context
- type Client
- type Error
- type ErrorHandler
- type ErrorStatusCode
- type Event
- func (s *Event) Decode(d *jx.Decoder) error
- func (s Event) Encode(e *jx.Encoder)
- func (s Event) GetID() uuid.UUID
- func (s Event) GetMessage() string
- func (s Event) MarshalJSON() ([]byte, error)
- func (s *Event) SetID(val uuid.UUID)
- func (s *Event) SetMessage(val string)
- func (s *Event) UnmarshalJSON(data []byte) error
- type Handler
- type Middleware
- type OptEvent
- func (o *OptEvent) Decode(d *jx.Decoder) error
- func (o OptEvent) Encode(e *jx.Encoder)
- func (o OptEvent) Get() (v Event, ok bool)
- func (o OptEvent) IsSet() bool
- func (s OptEvent) MarshalJSON() ([]byte, error)
- func (o OptEvent) Or(d Event) Event
- func (o *OptEvent) Reset()
- func (o *OptEvent) SetTo(v Event)
- func (s *OptEvent) 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
- func WithClient(client ht.Client) Option
- func WithErrorHandler(h ErrorHandler) Option
- func WithMaxMultipartMemory(max int64) Option
- func WithMeterProvider(provider metric.MeterProvider) Option
- func WithMethodNotAllowed(methodNotAllowed func(w http.ResponseWriter, r *http.Request, allowed string)) Option
- func WithMiddleware(m ...Middleware) Option
- func WithNotFound(notFound http.HandlerFunc) Option
- func WithPathPrefix(prefix string) Option
- func WithTracerProvider(provider trace.TracerProvider) Option
- type Route
- type Server
- type StatusWebhookOK
- func (s *StatusWebhookOK) Decode(d *jx.Decoder) error
- func (s StatusWebhookOK) Encode(e *jx.Encoder)
- func (s StatusWebhookOK) GetStatus() OptString
- func (s StatusWebhookOK) MarshalJSON() ([]byte, error)
- func (s *StatusWebhookOK) SetStatus(val OptString)
- func (s *StatusWebhookOK) UnmarshalJSON(data []byte) error
- type UnimplementedHandler
- func (UnimplementedHandler) NewError(ctx context.Context, err error) (r ErrorStatusCode)
- func (UnimplementedHandler) PublishEvent(ctx context.Context, req OptEvent) (r Event, _ error)
- func (UnimplementedHandler) StatusWebhook(ctx context.Context) (r StatusWebhookOK, _ error)
- func (UnimplementedHandler) UpdateDelete(ctx context.Context) (r UpdateDeleteRes, _ error)
- func (UnimplementedHandler) UpdateWebhook(ctx context.Context, req OptEvent, params UpdateWebhookParams) (r UpdateWebhookRes, _ error)
- type UpdateDeleteOK
- type UpdateDeleteRes
- type UpdateWebhookParams
- type UpdateWebhookRes
- type WebhookClient
- func (c *WebhookClient) StatusWebhook(ctx context.Context, targetURL string) (res StatusWebhookOK, err error)
- func (c *WebhookClient) UpdateDelete(ctx context.Context, targetURL string) (res UpdateDeleteRes, err error)
- func (c *WebhookClient) UpdateWebhook(ctx context.Context, targetURL string, request OptEvent, ...) (res UpdateWebhookRes, err error)
- type WebhookHandler
- type WebhookResponse
- func (s *WebhookResponse) Decode(d *jx.Decoder) error
- func (s WebhookResponse) Encode(e *jx.Encoder)
- func (s WebhookResponse) GetEventType() OptString
- func (s WebhookResponse) GetID() uuid.UUID
- func (s WebhookResponse) MarshalJSON() ([]byte, error)
- func (s *WebhookResponse) SetEventType(val OptString)
- func (s *WebhookResponse) SetID(val uuid.UUID)
- func (s *WebhookResponse) UnmarshalJSON(data []byte) error
- type WebhookServer
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.
type Error ¶
type Error struct {
Error string `json:"error"`
}
Ref: #/components/schemas/Error
func (Error) MarshalJSON ¶
MarshalJSON implements stdjson.Marshaler.
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 Event ¶
Ref: #/components/schemas/Event
func (Event) GetMessage ¶
GetMessage returns the value of Message.
func (Event) MarshalJSON ¶
MarshalJSON implements stdjson.Marshaler.
func (*Event) SetMessage ¶
SetMessage sets the value of Message.
func (*Event) UnmarshalJSON ¶
UnmarshalJSON implements stdjson.Unmarshaler.
type Handler ¶
type Handler interface { // PublishEvent implements publishEvent operation. // // POST /event PublishEvent(ctx context.Context, req OptEvent) (Event, 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 OptEvent ¶
OptEvent is optional Event.
func NewOptEvent ¶
NewOptEvent returns new OptEvent with value set to v.
func (OptEvent) MarshalJSON ¶
MarshalJSON implements stdjson.Marshaler.
func (*OptEvent) UnmarshalJSON ¶
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 {
// contains filtered or unexported methods
}
Option is config option.
func WithErrorHandler ¶
func WithErrorHandler(h ErrorHandler) Option
WithErrorHandler specifies error handler to use.
func WithMaxMultipartMemory ¶
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 WithMeterProvider ¶
func WithMeterProvider(provider metric.MeterProvider) Option
WithMeterProvider specifies a meter provider to use for creating a meter.
If none is specified, the metric.NewNoopMeterProvider is used.
func WithMethodNotAllowed ¶
func WithMethodNotAllowed(methodNotAllowed func(w http.ResponseWriter, r *http.Request, allowed string)) Option
WithMethodNotAllowed specifies Method Not Allowed handler to use.
func WithMiddleware ¶
func WithMiddleware(m ...Middleware) Option
WithMiddleware specifies middlewares to use.
func WithNotFound ¶
func WithNotFound(notFound http.HandlerFunc) Option
WithNotFound specifies Not Found handler to use.
func WithPathPrefix ¶
WithPathPrefix specifies server path prefix.
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.
type StatusWebhookOK ¶
type StatusWebhookOK struct {
Status OptString `json:"status"`
}
func (*StatusWebhookOK) Decode ¶
func (s *StatusWebhookOK) Decode(d *jx.Decoder) error
Decode decodes StatusWebhookOK from json.
func (StatusWebhookOK) Encode ¶
func (s StatusWebhookOK) Encode(e *jx.Encoder)
Encode implements json.Marshaler.
func (StatusWebhookOK) GetStatus ¶
func (s StatusWebhookOK) GetStatus() OptString
GetStatus returns the value of Status.
func (StatusWebhookOK) MarshalJSON ¶
func (s StatusWebhookOK) MarshalJSON() ([]byte, error)
MarshalJSON implements stdjson.Marshaler.
func (*StatusWebhookOK) SetStatus ¶
func (s *StatusWebhookOK) SetStatus(val OptString)
SetStatus sets the value of Status.
func (*StatusWebhookOK) UnmarshalJSON ¶
func (s *StatusWebhookOK) UnmarshalJSON(data []byte) error
UnmarshalJSON implements stdjson.Unmarshaler.
type UnimplementedHandler ¶
type UnimplementedHandler struct{}
UnimplementedHandler is no-op Handler which returns http.ErrNotImplemented.
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.
func (UnimplementedHandler) PublishEvent ¶
PublishEvent implements publishEvent operation.
POST /event
func (UnimplementedHandler) StatusWebhook ¶
func (UnimplementedHandler) StatusWebhook(ctx context.Context) (r StatusWebhookOK, _ error)
StatusWebhook implements statusWebhook operation.
func (UnimplementedHandler) UpdateDelete ¶
func (UnimplementedHandler) UpdateDelete(ctx context.Context) (r UpdateDeleteRes, _ error)
UpdateDelete implements DELETE update operation.
func (UnimplementedHandler) UpdateWebhook ¶
func (UnimplementedHandler) UpdateWebhook(ctx context.Context, req OptEvent, params UpdateWebhookParams) (r UpdateWebhookRes, _ error)
UpdateWebhook implements updateWebhook operation.
type UpdateDeleteOK ¶
type UpdateDeleteOK struct{}
UpdateDeleteOK is response for UpdateDelete operation.
type UpdateDeleteRes ¶
type UpdateDeleteRes interface {
// contains filtered or unexported methods
}
type UpdateWebhookParams ¶
UpdateWebhookParams is parameters of updateWebhook operation.
type UpdateWebhookRes ¶
type UpdateWebhookRes interface {
// contains filtered or unexported methods
}
type WebhookClient ¶
type WebhookClient struct {
// contains filtered or unexported fields
}
WebhookClient implements webhook client.
func NewWebhookClient ¶
func NewWebhookClient(opts ...Option) (*WebhookClient, error)
NewWebhookClient initializes new WebhookClient.
func (*WebhookClient) StatusWebhook ¶
func (c *WebhookClient) StatusWebhook(ctx context.Context, targetURL string) (res StatusWebhookOK, err error)
StatusWebhook invokes statusWebhook operation.
func (*WebhookClient) UpdateDelete ¶
func (c *WebhookClient) UpdateDelete(ctx context.Context, targetURL string) (res UpdateDeleteRes, err error)
UpdateDelete invokes DELETE update operation.
func (*WebhookClient) UpdateWebhook ¶
func (c *WebhookClient) UpdateWebhook(ctx context.Context, targetURL string, request OptEvent, params UpdateWebhookParams) (res UpdateWebhookRes, err error)
UpdateWebhook invokes updateWebhook operation.
type WebhookHandler ¶
type WebhookHandler interface { // StatusWebhook implements statusWebhook operation. // StatusWebhook(ctx context.Context) (StatusWebhookOK, error) // UpdateDelete implements DELETE update operation. // UpdateDelete(ctx context.Context) (UpdateDeleteRes, error) // UpdateWebhook implements updateWebhook operation. // UpdateWebhook(ctx context.Context, req OptEvent, params UpdateWebhookParams) (UpdateWebhookRes, error) }
WebhookHandler handles webhooks described by OpenAPI v3 specification.
type WebhookResponse ¶
Ref: #/components/schemas/WebhookResponse
func (*WebhookResponse) Decode ¶
func (s *WebhookResponse) Decode(d *jx.Decoder) error
Decode decodes WebhookResponse from json.
func (WebhookResponse) Encode ¶
func (s WebhookResponse) Encode(e *jx.Encoder)
Encode implements json.Marshaler.
func (WebhookResponse) GetEventType ¶
func (s WebhookResponse) GetEventType() OptString
GetEventType returns the value of EventType.
func (WebhookResponse) GetID ¶
func (s WebhookResponse) GetID() uuid.UUID
GetID returns the value of ID.
func (WebhookResponse) MarshalJSON ¶
func (s WebhookResponse) MarshalJSON() ([]byte, error)
MarshalJSON implements stdjson.Marshaler.
func (*WebhookResponse) SetEventType ¶
func (s *WebhookResponse) SetEventType(val OptString)
SetEventType sets the value of EventType.
func (*WebhookResponse) SetID ¶
func (s *WebhookResponse) SetID(val uuid.UUID)
SetID sets the value of ID.
func (*WebhookResponse) UnmarshalJSON ¶
func (s *WebhookResponse) UnmarshalJSON(data []byte) error
UnmarshalJSON implements stdjson.Unmarshaler.
type WebhookServer ¶
type WebhookServer struct {
// contains filtered or unexported fields
}
WebhookServer implements http server based on OpenAPI v3 specification and calls WebhookHandler to handle requests.
func NewWebhookServer ¶
func NewWebhookServer(h WebhookHandler, opts ...Option) (*WebhookServer, error)
NewWebhookServer creates new WebhookServer.
func (*WebhookServer) Handle ¶
func (s *WebhookServer) Handle(webhookName string, w http.ResponseWriter, r *http.Request) bool
Handle handles webhook request.
Returns true if there is a webhook handler for given name and requested method.
func (*WebhookServer) Handler ¶
func (s *WebhookServer) Handler(webhookName string) http.Handler
Handler returns http.Handler for webhook.
Returns NotFound handler if spec doesn't contain webhook with given name.
Returned handler calls MethodNotAllowed handler if webhook doesn't define requested method.
Source Files ¶
- oas_cfg_gen.go
- oas_client_gen.go
- oas_handlers_gen.go
- oas_interfaces_gen.go
- oas_json_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