Documentation
¶
Overview ¶
Code generated by ogen, DO NOT EDIT.
Index ¶
- func WithServerURL(ctx context.Context, u *url.URL) context.Context
- type Client
- func (c *Client) CreateTask(ctx context.Context, request *NewTask) (*Task, error)
- func (c *Client) DeleteTask(ctx context.Context, params DeleteTaskParams) (DeleteTaskRes, error)
- func (c *Client) GetTaskById(ctx context.Context, params GetTaskByIdParams) (GetTaskByIdRes, error)
- func (c *Client) GetTasks(ctx context.Context) ([]Task, error)
- func (c *Client) UpdateTask(ctx context.Context, request *UpdateTask, params UpdateTaskParams) (UpdateTaskRes, error)
- type ClientOption
- type CompletedEnum
- func (CompletedEnum) AllValues() []CompletedEnum
- func (s *CompletedEnum) Decode(d *jx.Decoder) error
- func (s CompletedEnum) Encode(e *jx.Encoder)
- func (s CompletedEnum) MarshalJSON() ([]byte, error)
- func (s CompletedEnum) MarshalText() ([]byte, error)
- func (s *CompletedEnum) UnmarshalJSON(data []byte) error
- func (s *CompletedEnum) UnmarshalText(data []byte) error
- func (s CompletedEnum) Validate() error
- type Counter
- func (s *Counter) Decode(d *jx.Decoder) error
- func (s *Counter) Encode(e *jx.Encoder)
- func (s *Counter) GetMaxValue() float64
- func (s *Counter) GetScale() string
- func (s *Counter) GetValue() float64
- func (s *Counter) MarshalJSON() ([]byte, error)
- func (s *Counter) SetMaxValue(val float64)
- func (s *Counter) SetScale(val string)
- func (s *Counter) SetValue(val float64)
- func (s *Counter) UnmarshalJSON(data []byte) error
- func (s *Counter) Validate() error
- type DeleteTaskNoContent
- type DeleteTaskParams
- type DeleteTaskRes
- type Error
- func (s *Error) Decode(d *jx.Decoder) error
- func (s *Error) Encode(e *jx.Encoder)
- func (s *Error) GetCode() int64
- func (s *Error) GetMessage() string
- func (s *Error) MarshalJSON() ([]byte, error)
- func (s *Error) SetCode(val int64)
- func (s *Error) SetMessage(val string)
- func (s *Error) UnmarshalJSON(data []byte) error
- type ErrorHandler
- type ErrorStatusCode
- type GetTaskByIdParams
- type GetTaskByIdRes
- type Handler
- type Invoker
- type Middleware
- type NewTask
- func (s *NewTask) Decode(d *jx.Decoder) error
- func (s *NewTask) Encode(e *jx.Encoder)
- func (s *NewTask) GetCompleted() OptCompletedEnum
- func (s *NewTask) GetCounter() OptCounter
- func (s *NewTask) GetText() OptString
- func (s *NewTask) GetTitle() string
- func (s *NewTask) MarshalJSON() ([]byte, error)
- func (s *NewTask) SetCompleted(val OptCompletedEnum)
- func (s *NewTask) SetCounter(val OptCounter)
- func (s *NewTask) SetText(val OptString)
- func (s *NewTask) SetTitle(val string)
- func (s *NewTask) UnmarshalJSON(data []byte) error
- func (s *NewTask) Validate() error
- type OptCompletedEnum
- func (o *OptCompletedEnum) Decode(d *jx.Decoder) error
- func (o OptCompletedEnum) Encode(e *jx.Encoder)
- func (o OptCompletedEnum) Get() (v CompletedEnum, ok bool)
- func (o OptCompletedEnum) IsSet() bool
- func (s OptCompletedEnum) MarshalJSON() ([]byte, error)
- func (o OptCompletedEnum) Or(d CompletedEnum) CompletedEnum
- func (o *OptCompletedEnum) Reset()
- func (o *OptCompletedEnum) SetTo(v CompletedEnum)
- func (s *OptCompletedEnum) UnmarshalJSON(data []byte) error
- type OptCounter
- func (o *OptCounter) Decode(d *jx.Decoder) error
- func (o OptCounter) Encode(e *jx.Encoder)
- func (o OptCounter) Get() (v Counter, ok bool)
- func (o OptCounter) IsSet() bool
- func (s OptCounter) MarshalJSON() ([]byte, error)
- func (o OptCounter) Or(d Counter) Counter
- func (o *OptCounter) Reset()
- func (o *OptCounter) SetTo(v Counter)
- func (s *OptCounter) UnmarshalJSON(data []byte) error
- type OptInt64
- func (o *OptInt64) Decode(d *jx.Decoder) error
- func (o OptInt64) Encode(e *jx.Encoder)
- func (o OptInt64) Get() (v int64, ok bool)
- func (o OptInt64) IsSet() bool
- func (s OptInt64) MarshalJSON() ([]byte, error)
- func (o OptInt64) Or(d int64) int64
- func (o *OptInt64) Reset()
- func (o *OptInt64) SetTo(v int64)
- func (s *OptInt64) 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 RemoteUserAuth
- type Route
- type SecurityHandler
- type SecuritySource
- 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 Task
- func (s *Task) Decode(d *jx.Decoder) error
- func (s *Task) Encode(e *jx.Encoder)
- func (s *Task) GetCompleted() CompletedEnum
- func (s *Task) GetCounter() OptCounter
- func (s *Task) GetID() OptInt64
- func (s *Task) GetText() string
- func (s *Task) GetTitle() string
- func (s *Task) MarshalJSON() ([]byte, error)
- func (s *Task) SetCompleted(val CompletedEnum)
- func (s *Task) SetCounter(val OptCounter)
- func (s *Task) SetID(val OptInt64)
- func (s *Task) SetText(val string)
- func (s *Task) SetTitle(val string)
- func (s *Task) UnmarshalJSON(data []byte) error
- func (s *Task) Validate() error
- type TaskNotFound
- type UnimplementedHandler
- func (UnimplementedHandler) CreateTask(ctx context.Context, req *NewTask) (r *Task, _ error)
- func (UnimplementedHandler) DeleteTask(ctx context.Context, params DeleteTaskParams) (r DeleteTaskRes, _ error)
- func (UnimplementedHandler) GetTaskById(ctx context.Context, params GetTaskByIdParams) (r GetTaskByIdRes, _ error)
- func (UnimplementedHandler) GetTasks(ctx context.Context) (r []Task, _ error)
- func (UnimplementedHandler) NewError(ctx context.Context, err error) (r *ErrorStatusCode)
- func (UnimplementedHandler) UpdateTask(ctx context.Context, req *UpdateTask, params UpdateTaskParams) (r UpdateTaskRes, _ error)
- type UpdateTask
- func (s *UpdateTask) Decode(d *jx.Decoder) error
- func (s *UpdateTask) Encode(e *jx.Encoder)
- func (s *UpdateTask) GetCompleted() OptCompletedEnum
- func (s *UpdateTask) GetCounter() OptCounter
- func (s *UpdateTask) GetID() OptInt64
- func (s *UpdateTask) GetText() OptString
- func (s *UpdateTask) GetTitle() string
- func (s *UpdateTask) MarshalJSON() ([]byte, error)
- func (s *UpdateTask) SetCompleted(val OptCompletedEnum)
- func (s *UpdateTask) SetCounter(val OptCounter)
- func (s *UpdateTask) SetID(val OptInt64)
- func (s *UpdateTask) SetText(val OptString)
- func (s *UpdateTask) SetTitle(val string)
- func (s *UpdateTask) UnmarshalJSON(data []byte) error
- func (s *UpdateTask) Validate() error
- type UpdateTaskParams
- type UpdateTaskRes
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, sec SecuritySource, opts ...ClientOption) (*Client, error)
NewClient initializes new Client defined by OAS.
func (*Client) CreateTask ¶
CreateTask invokes createTask operation.
Creates a new task.
POST /tasks
func (*Client) DeleteTask ¶
func (c *Client) DeleteTask(ctx context.Context, params DeleteTaskParams) (DeleteTaskRes, error)
DeleteTask invokes deleteTask operation.
Deletes a specific task by its ID.
DELETE /tasks/{id}
func (*Client) GetTaskById ¶
func (c *Client) GetTaskById(ctx context.Context, params GetTaskByIdParams) (GetTaskByIdRes, error)
GetTaskById invokes getTaskById operation.
Retrieves a specific task by its ID.
GET /tasks/{id}
func (*Client) GetTasks ¶
GetTasks invokes getTasks operation.
Retrieves a list of all tasks.
GET /tasks
func (*Client) UpdateTask ¶
func (c *Client) UpdateTask(ctx context.Context, request *UpdateTask, params UpdateTaskParams) (UpdateTaskRes, error)
UpdateTask invokes updateTask operation.
Updates a specific task by its ID.
PUT /tasks/{id}
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 CompletedEnum ¶
type CompletedEnum string
Indicates whether the task is completed or not. Ref: #/components/schemas/CompletedEnum
const ( CompletedEnumYes CompletedEnum = "yes" CompletedEnumNo CompletedEnum = "no" CompletedEnumCancelled CompletedEnum = "cancelled" )
func (CompletedEnum) AllValues ¶
func (CompletedEnum) AllValues() []CompletedEnum
AllValues returns all CompletedEnum values.
func (*CompletedEnum) Decode ¶
func (s *CompletedEnum) Decode(d *jx.Decoder) error
Decode decodes CompletedEnum from json.
func (CompletedEnum) Encode ¶
func (s CompletedEnum) Encode(e *jx.Encoder)
Encode encodes CompletedEnum as json.
func (CompletedEnum) MarshalJSON ¶
func (s CompletedEnum) MarshalJSON() ([]byte, error)
MarshalJSON implements stdjson.Marshaler.
func (CompletedEnum) MarshalText ¶
func (s CompletedEnum) MarshalText() ([]byte, error)
MarshalText implements encoding.TextMarshaler.
func (*CompletedEnum) UnmarshalJSON ¶
func (s *CompletedEnum) UnmarshalJSON(data []byte) error
UnmarshalJSON implements stdjson.Unmarshaler.
func (*CompletedEnum) UnmarshalText ¶
func (s *CompletedEnum) UnmarshalText(data []byte) error
UnmarshalText implements encoding.TextUnmarshaler.
func (CompletedEnum) Validate ¶
func (s CompletedEnum) Validate() error
type Counter ¶
type Counter struct {
// The value of the counter.
Value float64 `json:"value"`
// The scale of the counter.
Scale string `json:"scale"`
// The max value of the counter.
MaxValue float64 `json:"max_value"`
}
Ref: #/components/schemas/Counter
func (*Counter) GetMaxValue ¶
GetMaxValue returns the value of MaxValue.
func (*Counter) MarshalJSON ¶
MarshalJSON implements stdjson.Marshaler.
func (*Counter) SetMaxValue ¶
SetMaxValue sets the value of MaxValue.
func (*Counter) UnmarshalJSON ¶
UnmarshalJSON implements stdjson.Unmarshaler.
type DeleteTaskNoContent ¶
type DeleteTaskNoContent struct{}
DeleteTaskNoContent is response for DeleteTask operation.
type DeleteTaskParams ¶
type DeleteTaskParams struct {
// ID of the task to retrieve or update.
ID int64
}
DeleteTaskParams is parameters of deleteTask operation.
type DeleteTaskRes ¶
type DeleteTaskRes interface {
// contains filtered or unexported methods
}
type Error ¶
Represents error object. 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 GetTaskByIdParams ¶
type GetTaskByIdParams struct {
// ID of the task to retrieve or update.
ID int64
}
GetTaskByIdParams is parameters of getTaskById operation.
type GetTaskByIdRes ¶
type GetTaskByIdRes interface {
// contains filtered or unexported methods
}
type Handler ¶
type Handler interface {
// CreateTask implements createTask operation.
//
// Creates a new task.
//
// POST /tasks
CreateTask(ctx context.Context, req *NewTask) (*Task, error)
// DeleteTask implements deleteTask operation.
//
// Deletes a specific task by its ID.
//
// DELETE /tasks/{id}
DeleteTask(ctx context.Context, params DeleteTaskParams) (DeleteTaskRes, error)
// GetTaskById implements getTaskById operation.
//
// Retrieves a specific task by its ID.
//
// GET /tasks/{id}
GetTaskById(ctx context.Context, params GetTaskByIdParams) (GetTaskByIdRes, error)
// GetTasks implements getTasks operation.
//
// Retrieves a list of all tasks.
//
// GET /tasks
GetTasks(ctx context.Context) ([]Task, error)
// UpdateTask implements updateTask operation.
//
// Updates a specific task by its ID.
//
// PUT /tasks/{id}
UpdateTask(ctx context.Context, req *UpdateTask, params UpdateTaskParams) (UpdateTaskRes, 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 {
// CreateTask invokes createTask operation.
//
// Creates a new task.
//
// POST /tasks
CreateTask(ctx context.Context, request *NewTask) (*Task, error)
// DeleteTask invokes deleteTask operation.
//
// Deletes a specific task by its ID.
//
// DELETE /tasks/{id}
DeleteTask(ctx context.Context, params DeleteTaskParams) (DeleteTaskRes, error)
// GetTaskById invokes getTaskById operation.
//
// Retrieves a specific task by its ID.
//
// GET /tasks/{id}
GetTaskById(ctx context.Context, params GetTaskByIdParams) (GetTaskByIdRes, error)
// GetTasks invokes getTasks operation.
//
// Retrieves a list of all tasks.
//
// GET /tasks
GetTasks(ctx context.Context) ([]Task, error)
// UpdateTask invokes updateTask operation.
//
// Updates a specific task by its ID.
//
// PUT /tasks/{id}
UpdateTask(ctx context.Context, request *UpdateTask, params UpdateTaskParams) (UpdateTaskRes, error)
}
Invoker invokes operations described by OpenAPI v3 specification.
type NewTask ¶
type NewTask struct {
// The title of the new task.
Title string `json:"title"`
// The description of the task.
Text OptString `json:"text"`
Completed OptCompletedEnum `json:"completed"`
Counter OptCounter `json:"counter"`
}
Ref: #/components/schemas/NewTask
func (*NewTask) GetCompleted ¶
func (s *NewTask) GetCompleted() OptCompletedEnum
GetCompleted returns the value of Completed.
func (*NewTask) GetCounter ¶
func (s *NewTask) GetCounter() OptCounter
GetCounter returns the value of Counter.
func (*NewTask) MarshalJSON ¶
MarshalJSON implements stdjson.Marshaler.
func (*NewTask) SetCompleted ¶
func (s *NewTask) SetCompleted(val OptCompletedEnum)
SetCompleted sets the value of Completed.
func (*NewTask) SetCounter ¶
func (s *NewTask) SetCounter(val OptCounter)
SetCounter sets the value of Counter.
func (*NewTask) UnmarshalJSON ¶
UnmarshalJSON implements stdjson.Unmarshaler.
type OptCompletedEnum ¶
type OptCompletedEnum struct {
Value CompletedEnum
Set bool
}
OptCompletedEnum is optional CompletedEnum.
func NewOptCompletedEnum ¶
func NewOptCompletedEnum(v CompletedEnum) OptCompletedEnum
NewOptCompletedEnum returns new OptCompletedEnum with value set to v.
func (*OptCompletedEnum) Decode ¶
func (o *OptCompletedEnum) Decode(d *jx.Decoder) error
Decode decodes CompletedEnum from json.
func (OptCompletedEnum) Encode ¶
func (o OptCompletedEnum) Encode(e *jx.Encoder)
Encode encodes CompletedEnum as json.
func (OptCompletedEnum) Get ¶
func (o OptCompletedEnum) Get() (v CompletedEnum, ok bool)
Get returns value and boolean that denotes whether value was set.
func (OptCompletedEnum) IsSet ¶
func (o OptCompletedEnum) IsSet() bool
IsSet returns true if OptCompletedEnum was set.
func (OptCompletedEnum) MarshalJSON ¶
func (s OptCompletedEnum) MarshalJSON() ([]byte, error)
MarshalJSON implements stdjson.Marshaler.
func (OptCompletedEnum) Or ¶
func (o OptCompletedEnum) Or(d CompletedEnum) CompletedEnum
Or returns value if set, or given parameter if does not.
func (*OptCompletedEnum) SetTo ¶
func (o *OptCompletedEnum) SetTo(v CompletedEnum)
SetTo sets value to v.
func (*OptCompletedEnum) UnmarshalJSON ¶
func (s *OptCompletedEnum) UnmarshalJSON(data []byte) error
UnmarshalJSON implements stdjson.Unmarshaler.
type OptCounter ¶
OptCounter is optional Counter.
func NewOptCounter ¶
func NewOptCounter(v Counter) OptCounter
NewOptCounter returns new OptCounter with value set to v.
func (*OptCounter) Decode ¶
func (o *OptCounter) Decode(d *jx.Decoder) error
Decode decodes Counter from json.
func (OptCounter) Encode ¶
func (o OptCounter) Encode(e *jx.Encoder)
Encode encodes Counter as json.
func (OptCounter) Get ¶
func (o OptCounter) Get() (v Counter, ok bool)
Get returns value and boolean that denotes whether value was set.
func (OptCounter) IsSet ¶
func (o OptCounter) IsSet() bool
IsSet returns true if OptCounter was set.
func (OptCounter) MarshalJSON ¶
func (s OptCounter) MarshalJSON() ([]byte, error)
MarshalJSON implements stdjson.Marshaler.
func (OptCounter) Or ¶
func (o OptCounter) Or(d Counter) Counter
Or returns value if set, or given parameter if does not.
func (*OptCounter) UnmarshalJSON ¶
func (s *OptCounter) UnmarshalJSON(data []byte) error
UnmarshalJSON implements stdjson.Unmarshaler.
type OptInt64 ¶
OptInt64 is optional int64.
func NewOptInt64 ¶
NewOptInt64 returns new OptInt64 with value set to v.
func (OptInt64) MarshalJSON ¶
MarshalJSON implements stdjson.Marshaler.
func (*OptInt64) 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 {
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 RemoteUserAuth ¶
type RemoteUserAuth struct {
APIKey string
}
func (*RemoteUserAuth) GetAPIKey ¶
func (s *RemoteUserAuth) GetAPIKey() string
GetAPIKey returns the value of APIKey.
func (*RemoteUserAuth) SetAPIKey ¶
func (s *RemoteUserAuth) SetAPIKey(val string)
SetAPIKey sets the value of APIKey.
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 {
// HandleRemoteUserAuth handles RemoteUserAuth security.
HandleRemoteUserAuth(ctx context.Context, operationName string, t RemoteUserAuth) (context.Context, error)
}
SecurityHandler is handler for security parameters.
type SecuritySource ¶
type SecuritySource interface {
// RemoteUserAuth provides RemoteUserAuth security value.
RemoteUserAuth(ctx context.Context, operationName string) (RemoteUserAuth, error)
}
SecuritySource is provider of security values (tokens, passwords, etc.).
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 Task ¶
type Task struct {
// The unique identifier for the task.
ID OptInt64 `json:"id"`
// The title of the task.
Title string `json:"title"`
// The description of the task.
Text string `json:"text"`
Completed CompletedEnum `json:"completed"`
Counter OptCounter `json:"counter"`
}
Ref: #/components/schemas/Task
func (*Task) GetCompleted ¶
func (s *Task) GetCompleted() CompletedEnum
GetCompleted returns the value of Completed.
func (*Task) GetCounter ¶
func (s *Task) GetCounter() OptCounter
GetCounter returns the value of Counter.
func (*Task) MarshalJSON ¶
MarshalJSON implements stdjson.Marshaler.
func (*Task) SetCompleted ¶
func (s *Task) SetCompleted(val CompletedEnum)
SetCompleted sets the value of Completed.
func (*Task) SetCounter ¶
func (s *Task) SetCounter(val OptCounter)
SetCounter sets the value of Counter.
func (*Task) UnmarshalJSON ¶
UnmarshalJSON implements stdjson.Unmarshaler.
type TaskNotFound ¶
type TaskNotFound struct {
Error OptString `json:"error"`
}
func (*TaskNotFound) Decode ¶
func (s *TaskNotFound) Decode(d *jx.Decoder) error
Decode decodes TaskNotFound from json.
func (*TaskNotFound) Encode ¶
func (s *TaskNotFound) Encode(e *jx.Encoder)
Encode implements json.Marshaler.
func (*TaskNotFound) GetError ¶
func (s *TaskNotFound) GetError() OptString
GetError returns the value of Error.
func (*TaskNotFound) MarshalJSON ¶
func (s *TaskNotFound) MarshalJSON() ([]byte, error)
MarshalJSON implements stdjson.Marshaler.
func (*TaskNotFound) SetError ¶
func (s *TaskNotFound) SetError(val OptString)
SetError sets the value of Error.
func (*TaskNotFound) UnmarshalJSON ¶
func (s *TaskNotFound) UnmarshalJSON(data []byte) error
UnmarshalJSON implements stdjson.Unmarshaler.
type UnimplementedHandler ¶
type UnimplementedHandler struct{}
UnimplementedHandler is no-op Handler which returns http.ErrNotImplemented.
func (UnimplementedHandler) CreateTask ¶
CreateTask implements createTask operation.
Creates a new task.
POST /tasks
func (UnimplementedHandler) DeleteTask ¶
func (UnimplementedHandler) DeleteTask(ctx context.Context, params DeleteTaskParams) (r DeleteTaskRes, _ error)
DeleteTask implements deleteTask operation.
Deletes a specific task by its ID.
DELETE /tasks/{id}
func (UnimplementedHandler) GetTaskById ¶
func (UnimplementedHandler) GetTaskById(ctx context.Context, params GetTaskByIdParams) (r GetTaskByIdRes, _ error)
GetTaskById implements getTaskById operation.
Retrieves a specific task by its ID.
GET /tasks/{id}
func (UnimplementedHandler) GetTasks ¶
func (UnimplementedHandler) GetTasks(ctx context.Context) (r []Task, _ error)
GetTasks implements getTasks operation.
Retrieves a list of all tasks.
GET /tasks
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) UpdateTask ¶
func (UnimplementedHandler) UpdateTask(ctx context.Context, req *UpdateTask, params UpdateTaskParams) (r UpdateTaskRes, _ error)
UpdateTask implements updateTask operation.
Updates a specific task by its ID.
PUT /tasks/{id}
type UpdateTask ¶
type UpdateTask struct {
// The unique identifier for the task.
ID OptInt64 `json:"id"`
// The title of the new task.
Title string `json:"title"`
// The description of the task.
Text OptString `json:"text"`
Completed OptCompletedEnum `json:"completed"`
Counter OptCounter `json:"counter"`
}
Ref: #/components/schemas/UpdateTask
func (*UpdateTask) Decode ¶
func (s *UpdateTask) Decode(d *jx.Decoder) error
Decode decodes UpdateTask from json.
func (*UpdateTask) Encode ¶
func (s *UpdateTask) Encode(e *jx.Encoder)
Encode implements json.Marshaler.
func (*UpdateTask) GetCompleted ¶
func (s *UpdateTask) GetCompleted() OptCompletedEnum
GetCompleted returns the value of Completed.
func (*UpdateTask) GetCounter ¶
func (s *UpdateTask) GetCounter() OptCounter
GetCounter returns the value of Counter.
func (*UpdateTask) GetText ¶
func (s *UpdateTask) GetText() OptString
GetText returns the value of Text.
func (*UpdateTask) GetTitle ¶
func (s *UpdateTask) GetTitle() string
GetTitle returns the value of Title.
func (*UpdateTask) MarshalJSON ¶
func (s *UpdateTask) MarshalJSON() ([]byte, error)
MarshalJSON implements stdjson.Marshaler.
func (*UpdateTask) SetCompleted ¶
func (s *UpdateTask) SetCompleted(val OptCompletedEnum)
SetCompleted sets the value of Completed.
func (*UpdateTask) SetCounter ¶
func (s *UpdateTask) SetCounter(val OptCounter)
SetCounter sets the value of Counter.
func (*UpdateTask) SetText ¶
func (s *UpdateTask) SetText(val OptString)
SetText sets the value of Text.
func (*UpdateTask) SetTitle ¶
func (s *UpdateTask) SetTitle(val string)
SetTitle sets the value of Title.
func (*UpdateTask) UnmarshalJSON ¶
func (s *UpdateTask) UnmarshalJSON(data []byte) error
UnmarshalJSON implements stdjson.Unmarshaler.
func (*UpdateTask) Validate ¶
func (s *UpdateTask) Validate() error
type UpdateTaskParams ¶
type UpdateTaskParams struct {
// ID of the task to retrieve or update.
ID int64
}
UpdateTaskParams is parameters of updateTask operation.
type UpdateTaskRes ¶
type UpdateTaskRes interface {
// contains filtered or unexported methods
}
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_security_gen.go
- oas_server_gen.go
- oas_unimplemented_gen.go
- oas_validators_gen.go