Documentation ¶
Overview ¶
Code generated by ogen, DO NOT EDIT.
Index ¶
- type Batch
- func (s *Batch) Decode(d *jx.Decoder) error
- func (s *Batch) Encode(e *jx.Encoder)
- func (s *Batch) GetCursor() int64
- func (s *Batch) GetKeys() []string
- func (s *Batch) MarshalJSON() ([]byte, error)
- func (s *Batch) SetCursor(val int64)
- func (s *Batch) SetKeys(val []string)
- func (s *Batch) UnmarshalJSON(data []byte) error
- func (s *Batch) Validate() error
- type DeleteNamespaceNoContent
- type DeleteNamespaceParams
- type DeleteNoContent
- type DeleteParams
- type ErrorHandler
- type GetNotFound
- type GetOK
- type GetOKHeaders
- func (s *GetOKHeaders) GetResponse() GetOK
- func (s *GetOKHeaders) GetXContentType() string
- func (s *GetOKHeaders) GetXTTL() OptFloat64
- func (s *GetOKHeaders) SetResponse(val GetOK)
- func (s *GetOKHeaders) SetXContentType(val string)
- func (s *GetOKHeaders) SetXTTL(val OptFloat64)
- func (s *GetOKHeaders) Validate() error
- type GetParams
- type GetRes
- type Handler
- type HeaderAuth
- type KeysParams
- type Middleware
- type OptFloat64
- type OptInt64
- type Option
- type Route
- type SecurityHandler
- 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 SetNoContent
- type SetParams
- type SetReq
- type SetReqWithContentType
- type UnimplementedHandler
- func (UnimplementedHandler) Delete(ctx context.Context, params DeleteParams) error
- func (UnimplementedHandler) DeleteNamespace(ctx context.Context, params DeleteNamespaceParams) error
- func (UnimplementedHandler) Get(ctx context.Context, params GetParams) (r GetRes, _ error)
- func (UnimplementedHandler) Keys(ctx context.Context, params KeysParams) (r *Batch, _ error)
- func (UnimplementedHandler) Set(ctx context.Context, req *SetReqWithContentType, params SetParams) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Batch ¶
type Batch struct { // Keys list. Keys []string `json:"keys"` // Cursor used for pagination. Cursor int64 `json:"cursor"` }
Ref: #/components/schemas/batch
func (*Batch) MarshalJSON ¶
MarshalJSON implements stdjson.Marshaler.
func (*Batch) UnmarshalJSON ¶
UnmarshalJSON implements stdjson.Unmarshaler.
type DeleteNamespaceNoContent ¶
type DeleteNamespaceNoContent struct{}
DeleteNamespaceNoContent is response for DeleteNamespace operation.
type DeleteNamespaceParams ¶
type DeleteNamespaceParams struct { // Key-Value namespace. Namespace string }
DeleteNamespaceParams is parameters of deleteNamespace operation.
type DeleteNoContent ¶
type DeleteNoContent struct{}
DeleteNoContent is response for Delete operation.
type DeleteParams ¶
DeleteParams is parameters of delete operation.
type GetOKHeaders ¶
type GetOKHeaders struct { XContentType string XTTL OptFloat64 Response GetOK }
GetOKHeaders wraps GetOK with response headers.
func (*GetOKHeaders) GetResponse ¶
func (s *GetOKHeaders) GetResponse() GetOK
GetResponse returns the value of Response.
func (*GetOKHeaders) GetXContentType ¶
func (s *GetOKHeaders) GetXContentType() string
GetXContentType returns the value of XContentType.
func (*GetOKHeaders) GetXTTL ¶
func (s *GetOKHeaders) GetXTTL() OptFloat64
GetXTTL returns the value of XTTL.
func (*GetOKHeaders) SetResponse ¶
func (s *GetOKHeaders) SetResponse(val GetOK)
SetResponse sets the value of Response.
func (*GetOKHeaders) SetXContentType ¶
func (s *GetOKHeaders) SetXContentType(val string)
SetXContentType sets the value of XContentType.
func (*GetOKHeaders) SetXTTL ¶
func (s *GetOKHeaders) SetXTTL(val OptFloat64)
SetXTTL sets the value of XTTL.
func (*GetOKHeaders) Validate ¶
func (s *GetOKHeaders) Validate() error
type Handler ¶
type Handler interface { // Delete implements delete operation. // // Delete key. Does nothing if key not exists. // // DELETE /{namespace}/{key} Delete(ctx context.Context, params DeleteParams) error // DeleteNamespace implements deleteNamespace operation. // // Delete namespace and all keys. // // DELETE /{namespace} DeleteNamespace(ctx context.Context, params DeleteNamespaceParams) error // Get implements get operation. // // Get value by key. // // GET /{namespace}/{key} Get(ctx context.Context, params GetParams) (GetRes, error) // Keys implements keys operation. // // List keys in namespace page by page. Iteration may not be consistent if there are updates between // pages. // At the end of page, operation will return empty list. // Iteration order is non-deterministic, but generally tends to be from oldest key to newest key. // // GET /{namespace} Keys(ctx context.Context, params KeysParams) (*Batch, error) // Set implements set operation. // // Create or replace value in namespace. // // POST /{namespace}/{key} Set(ctx context.Context, req *SetReqWithContentType, params SetParams) error }
Handler handles operations described by OpenAPI v3 specification.
type HeaderAuth ¶
type HeaderAuth struct {
APIKey string
}
func (*HeaderAuth) GetAPIKey ¶
func (s *HeaderAuth) GetAPIKey() string
GetAPIKey returns the value of APIKey.
func (*HeaderAuth) SetAPIKey ¶
func (s *HeaderAuth) SetAPIKey(val string)
SetAPIKey sets the value of APIKey.
type KeysParams ¶
type KeysParams struct { // Key-Value namespace. Namespace string // Cursor of the previous page, should be passed in from the previous request or absent for new // request. Cursor OptInt64 }
KeysParams is parameters of keys operation.
type OptFloat64 ¶
OptFloat64 is optional float64.
func NewOptFloat64 ¶
func NewOptFloat64(v float64) OptFloat64
NewOptFloat64 returns new OptFloat64 with value set to v.
func (OptFloat64) Get ¶
func (o OptFloat64) Get() (v float64, ok bool)
Get returns value and boolean that denotes whether value was set.
func (OptFloat64) IsSet ¶
func (o OptFloat64) IsSet() bool
IsSet returns true if OptFloat64 was set.
func (OptFloat64) Or ¶
func (o OptFloat64) Or(d float64) float64
Or returns value if set, or given parameter if does not.
type OptInt64 ¶
OptInt64 is optional int64.
func NewOptInt64 ¶
NewOptInt64 returns new OptInt64 with value set to v.
type Option ¶
type Option interface { ServerOption }
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 Route ¶
type Route struct {
// contains filtered or unexported fields
}
Route is route object.
func (Route) OperationID ¶
OperationID returns OpenAPI operationId.
type SecurityHandler ¶
type SecurityHandler interface { // HandleHeaderAuth handles HeaderAuth security. HandleHeaderAuth(ctx context.Context, operationName string, t HeaderAuth) (context.Context, error) }
SecurityHandler is handler for security parameters.
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, sec SecurityHandler, 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 SetParams ¶
type SetParams struct { // Key-Value namespace. Namespace string // Key name. Key string // Time-to-live for the key in seconds (floating). TTL OptFloat64 }
SetParams is parameters of set operation.
type SetReqWithContentType ¶
SetReqWithContentType wraps SetReq with Content-Type.
func (*SetReqWithContentType) GetContent ¶
func (s *SetReqWithContentType) GetContent() SetReq
GetContent returns the value of Content.
func (*SetReqWithContentType) GetContentType ¶
func (s *SetReqWithContentType) GetContentType() string
GetContentType returns the value of ContentType.
func (*SetReqWithContentType) SetContent ¶
func (s *SetReqWithContentType) SetContent(val SetReq)
SetContent sets the value of Content.
func (*SetReqWithContentType) SetContentType ¶
func (s *SetReqWithContentType) SetContentType(val string)
SetContentType sets the value of ContentType.
type UnimplementedHandler ¶
type UnimplementedHandler struct{}
UnimplementedHandler is no-op Handler which returns http.ErrNotImplemented.
func (UnimplementedHandler) Delete ¶
func (UnimplementedHandler) Delete(ctx context.Context, params DeleteParams) error
Delete implements delete operation.
Delete key. Does nothing if key not exists.
DELETE /{namespace}/{key}
func (UnimplementedHandler) DeleteNamespace ¶
func (UnimplementedHandler) DeleteNamespace(ctx context.Context, params DeleteNamespaceParams) error
DeleteNamespace implements deleteNamespace operation.
Delete namespace and all keys.
DELETE /{namespace}
func (UnimplementedHandler) Get ¶
Get implements get operation.
Get value by key.
GET /{namespace}/{key}
func (UnimplementedHandler) Keys ¶
func (UnimplementedHandler) Keys(ctx context.Context, params KeysParams) (r *Batch, _ error)
Keys implements keys operation.
List keys in namespace page by page. Iteration may not be consistent if there are updates between pages. At the end of page, operation will return empty list. Iteration order is non-deterministic, but generally tends to be from oldest key to newest key.
GET /{namespace}
func (UnimplementedHandler) Set ¶
func (UnimplementedHandler) Set(ctx context.Context, req *SetReqWithContentType, params SetParams) error
Set implements set operation.
Create or replace value in namespace.
POST /{namespace}/{key}