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) CreateTodo(ctx context.Context, request *CreateTodoReq) (CreateTodoRes, error)
- func (c *Client) DeleteTodo(ctx context.Context, params DeleteTodoParams) (DeleteTodoRes, error)
- func (c *Client) ListTodo(ctx context.Context, params ListTodoParams) (ListTodoRes, error)
- func (c *Client) ListTodoChildren(ctx context.Context, params ListTodoChildrenParams) (ListTodoChildrenRes, error)
- func (c *Client) ReadTodo(ctx context.Context, params ReadTodoParams) (ReadTodoRes, error)
- func (c *Client) ReadTodoParent(ctx context.Context, params ReadTodoParentParams) (ReadTodoParentRes, error)
- func (c *Client) ServerStatus(ctx context.Context) (ServerStatusRes, error)
- func (c *Client) UpdateTodo(ctx context.Context, request *UpdateTodoReq, params UpdateTodoParams) (UpdateTodoRes, error)
- type ClientOption
- type CreateTodoReq
- func (s *CreateTodoReq) Decode(d *jx.Decoder) error
- func (s *CreateTodoReq) Encode(e *jx.Encoder)
- func (s *CreateTodoReq) GetChildren() []int
- func (s *CreateTodoReq) GetCreatedAt() time.Time
- func (s *CreateTodoReq) GetParent() OptInt
- func (s *CreateTodoReq) GetPriority() int
- func (s *CreateTodoReq) GetStatus() CreateTodoReqStatus
- func (s *CreateTodoReq) GetText() string
- func (s *CreateTodoReq) MarshalJSON() ([]byte, error)
- func (s *CreateTodoReq) SetChildren(val []int)
- func (s *CreateTodoReq) SetCreatedAt(val time.Time)
- func (s *CreateTodoReq) SetParent(val OptInt)
- func (s *CreateTodoReq) SetPriority(val int)
- func (s *CreateTodoReq) SetStatus(val CreateTodoReqStatus)
- func (s *CreateTodoReq) SetText(val string)
- func (s *CreateTodoReq) UnmarshalJSON(data []byte) error
- func (s *CreateTodoReq) Validate() error
- type CreateTodoReqStatus
- func (CreateTodoReqStatus) AllValues() []CreateTodoReqStatus
- func (s *CreateTodoReqStatus) Decode(d *jx.Decoder) error
- func (s CreateTodoReqStatus) Encode(e *jx.Encoder)
- func (s CreateTodoReqStatus) MarshalJSON() ([]byte, error)
- func (s CreateTodoReqStatus) MarshalText() ([]byte, error)
- func (s *CreateTodoReqStatus) UnmarshalJSON(data []byte) error
- func (s *CreateTodoReqStatus) UnmarshalText(data []byte) error
- func (s CreateTodoReqStatus) Validate() error
- type CreateTodoRes
- type DeleteTodoNoContent
- type DeleteTodoParams
- type DeleteTodoRes
- type ErrorHandler
- type Handler
- type ListTodoChildrenOKApplicationJSON
- func (s *ListTodoChildrenOKApplicationJSON) Decode(d *jx.Decoder) error
- func (s ListTodoChildrenOKApplicationJSON) Encode(e *jx.Encoder)
- func (s ListTodoChildrenOKApplicationJSON) MarshalJSON() ([]byte, error)
- func (s *ListTodoChildrenOKApplicationJSON) UnmarshalJSON(data []byte) error
- func (s ListTodoChildrenOKApplicationJSON) Validate() error
- type ListTodoChildrenParams
- type ListTodoChildrenRes
- type ListTodoOKApplicationJSON
- func (s *ListTodoOKApplicationJSON) Decode(d *jx.Decoder) error
- func (s ListTodoOKApplicationJSON) Encode(e *jx.Encoder)
- func (s ListTodoOKApplicationJSON) MarshalJSON() ([]byte, error)
- func (s *ListTodoOKApplicationJSON) UnmarshalJSON(data []byte) error
- func (s ListTodoOKApplicationJSON) Validate() error
- type ListTodoParams
- type ListTodoRes
- type Middleware
- type OgentHandler
- func (h *OgentHandler) CreateTodo(ctx context.Context, req *CreateTodoReq) (CreateTodoRes, error)
- func (h *OgentHandler) DeleteTodo(ctx context.Context, params DeleteTodoParams) (DeleteTodoRes, error)
- func (h *OgentHandler) ListTodo(ctx context.Context, params ListTodoParams) (ListTodoRes, error)
- func (h *OgentHandler) ListTodoChildren(ctx context.Context, params ListTodoChildrenParams) (ListTodoChildrenRes, error)
- func (h *OgentHandler) ReadTodo(ctx context.Context, params ReadTodoParams) (ReadTodoRes, error)
- func (h *OgentHandler) ReadTodoParent(ctx context.Context, params ReadTodoParentParams) (ReadTodoParentRes, error)
- func (h *OgentHandler) UpdateTodo(ctx context.Context, req *UpdateTodoReq, params UpdateTodoParams) (UpdateTodoRes, 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 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 OptUpdateTodoReqStatus
- func (o *OptUpdateTodoReqStatus) Decode(d *jx.Decoder) error
- func (o OptUpdateTodoReqStatus) Encode(e *jx.Encoder)
- func (o OptUpdateTodoReqStatus) Get() (v UpdateTodoReqStatus, ok bool)
- func (o OptUpdateTodoReqStatus) IsSet() bool
- func (s OptUpdateTodoReqStatus) MarshalJSON() ([]byte, error)
- func (o OptUpdateTodoReqStatus) Or(d UpdateTodoReqStatus) UpdateTodoReqStatus
- func (o *OptUpdateTodoReqStatus) Reset()
- func (o *OptUpdateTodoReqStatus) SetTo(v UpdateTodoReqStatus)
- func (s *OptUpdateTodoReqStatus) UnmarshalJSON(data []byte) error
- type Option
- type R400
- func (s *R400) Decode(d *jx.Decoder) error
- func (s *R400) Encode(e *jx.Encoder)
- func (s *R400) GetCode() int
- func (s *R400) GetErrors() jx.Raw
- func (s *R400) GetStatus() string
- func (s *R400) MarshalJSON() ([]byte, error)
- func (s *R400) SetCode(val int)
- func (s *R400) SetErrors(val jx.Raw)
- func (s *R400) SetStatus(val string)
- func (s *R400) UnmarshalJSON(data []byte) error
- type R404
- func (s *R404) Decode(d *jx.Decoder) error
- func (s *R404) Encode(e *jx.Encoder)
- func (s *R404) GetCode() int
- func (s *R404) GetErrors() jx.Raw
- func (s *R404) GetStatus() string
- func (s *R404) MarshalJSON() ([]byte, error)
- func (s *R404) SetCode(val int)
- func (s *R404) SetErrors(val jx.Raw)
- func (s *R404) SetStatus(val string)
- func (s *R404) UnmarshalJSON(data []byte) error
- type R409
- func (s *R409) Decode(d *jx.Decoder) error
- func (s *R409) Encode(e *jx.Encoder)
- func (s *R409) GetCode() int
- func (s *R409) GetErrors() jx.Raw
- func (s *R409) GetStatus() string
- func (s *R409) MarshalJSON() ([]byte, error)
- func (s *R409) SetCode(val int)
- func (s *R409) SetErrors(val jx.Raw)
- func (s *R409) SetStatus(val string)
- func (s *R409) UnmarshalJSON(data []byte) error
- type R500
- func (s *R500) Decode(d *jx.Decoder) error
- func (s *R500) Encode(e *jx.Encoder)
- func (s *R500) GetCode() int
- func (s *R500) GetErrors() jx.Raw
- func (s *R500) GetStatus() string
- func (s *R500) MarshalJSON() ([]byte, error)
- func (s *R500) SetCode(val int)
- func (s *R500) SetErrors(val jx.Raw)
- func (s *R500) SetStatus(val string)
- func (s *R500) UnmarshalJSON(data []byte) error
- type ReadTodoParams
- type ReadTodoParentParams
- type ReadTodoParentRes
- type ReadTodoRes
- 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 ServerStatusOK
- type ServerStatusRes
- type ServerStatusServiceUnavailable
- type TodoChildrenList
- func (s *TodoChildrenList) Decode(d *jx.Decoder) error
- func (t *TodoChildrenList) Elem() TodoChildrenList
- func (s *TodoChildrenList) Encode(e *jx.Encoder)
- func (s *TodoChildrenList) GetCreatedAt() time.Time
- func (s *TodoChildrenList) GetID() int
- func (s *TodoChildrenList) GetPriority() int
- func (s *TodoChildrenList) GetStatus() TodoChildrenListStatus
- func (s *TodoChildrenList) GetText() string
- func (s *TodoChildrenList) MarshalJSON() ([]byte, error)
- func (s *TodoChildrenList) SetCreatedAt(val time.Time)
- func (s *TodoChildrenList) SetID(val int)
- func (s *TodoChildrenList) SetPriority(val int)
- func (s *TodoChildrenList) SetStatus(val TodoChildrenListStatus)
- func (s *TodoChildrenList) SetText(val string)
- func (s *TodoChildrenList) UnmarshalJSON(data []byte) error
- func (s *TodoChildrenList) Validate() error
- type TodoChildrenListStatus
- func (TodoChildrenListStatus) AllValues() []TodoChildrenListStatus
- func (s *TodoChildrenListStatus) Decode(d *jx.Decoder) error
- func (s TodoChildrenListStatus) Encode(e *jx.Encoder)
- func (s TodoChildrenListStatus) MarshalJSON() ([]byte, error)
- func (s TodoChildrenListStatus) MarshalText() ([]byte, error)
- func (s *TodoChildrenListStatus) UnmarshalJSON(data []byte) error
- func (s *TodoChildrenListStatus) UnmarshalText(data []byte) error
- func (s TodoChildrenListStatus) Validate() error
- type TodoCreate
- func (s *TodoCreate) Decode(d *jx.Decoder) error
- func (t *TodoCreate) Elem() TodoCreate
- func (s *TodoCreate) Encode(e *jx.Encoder)
- func (s *TodoCreate) GetCreatedAt() time.Time
- func (s *TodoCreate) GetID() int
- func (s *TodoCreate) GetPriority() int
- func (s *TodoCreate) GetStatus() TodoCreateStatus
- func (s *TodoCreate) GetText() string
- func (s *TodoCreate) MarshalJSON() ([]byte, error)
- func (s *TodoCreate) SetCreatedAt(val time.Time)
- func (s *TodoCreate) SetID(val int)
- func (s *TodoCreate) SetPriority(val int)
- func (s *TodoCreate) SetStatus(val TodoCreateStatus)
- func (s *TodoCreate) SetText(val string)
- func (s *TodoCreate) UnmarshalJSON(data []byte) error
- func (s *TodoCreate) Validate() error
- type TodoCreateStatus
- func (TodoCreateStatus) AllValues() []TodoCreateStatus
- func (s *TodoCreateStatus) Decode(d *jx.Decoder) error
- func (s TodoCreateStatus) Encode(e *jx.Encoder)
- func (s TodoCreateStatus) MarshalJSON() ([]byte, error)
- func (s TodoCreateStatus) MarshalText() ([]byte, error)
- func (s *TodoCreateStatus) UnmarshalJSON(data []byte) error
- func (s *TodoCreateStatus) UnmarshalText(data []byte) error
- func (s TodoCreateStatus) Validate() error
- type TodoList
- func (s *TodoList) Decode(d *jx.Decoder) error
- func (t *TodoList) Elem() TodoList
- func (s *TodoList) Encode(e *jx.Encoder)
- func (s *TodoList) GetCreatedAt() time.Time
- func (s *TodoList) GetID() int
- func (s *TodoList) GetPriority() int
- func (s *TodoList) GetStatus() TodoListStatus
- func (s *TodoList) GetText() string
- func (s *TodoList) MarshalJSON() ([]byte, error)
- func (s *TodoList) SetCreatedAt(val time.Time)
- func (s *TodoList) SetID(val int)
- func (s *TodoList) SetPriority(val int)
- func (s *TodoList) SetStatus(val TodoListStatus)
- func (s *TodoList) SetText(val string)
- func (s *TodoList) UnmarshalJSON(data []byte) error
- func (s *TodoList) Validate() error
- type TodoListStatus
- func (TodoListStatus) AllValues() []TodoListStatus
- func (s *TodoListStatus) Decode(d *jx.Decoder) error
- func (s TodoListStatus) Encode(e *jx.Encoder)
- func (s TodoListStatus) MarshalJSON() ([]byte, error)
- func (s TodoListStatus) MarshalText() ([]byte, error)
- func (s *TodoListStatus) UnmarshalJSON(data []byte) error
- func (s *TodoListStatus) UnmarshalText(data []byte) error
- func (s TodoListStatus) Validate() error
- type TodoParentRead
- func (s *TodoParentRead) Decode(d *jx.Decoder) error
- func (t *TodoParentRead) Elem() TodoParentRead
- func (s *TodoParentRead) Encode(e *jx.Encoder)
- func (s *TodoParentRead) GetCreatedAt() time.Time
- func (s *TodoParentRead) GetID() int
- func (s *TodoParentRead) GetPriority() int
- func (s *TodoParentRead) GetStatus() TodoParentReadStatus
- func (s *TodoParentRead) GetText() string
- func (s *TodoParentRead) MarshalJSON() ([]byte, error)
- func (s *TodoParentRead) SetCreatedAt(val time.Time)
- func (s *TodoParentRead) SetID(val int)
- func (s *TodoParentRead) SetPriority(val int)
- func (s *TodoParentRead) SetStatus(val TodoParentReadStatus)
- func (s *TodoParentRead) SetText(val string)
- func (s *TodoParentRead) UnmarshalJSON(data []byte) error
- func (s *TodoParentRead) Validate() error
- type TodoParentReadStatus
- func (TodoParentReadStatus) AllValues() []TodoParentReadStatus
- func (s *TodoParentReadStatus) Decode(d *jx.Decoder) error
- func (s TodoParentReadStatus) Encode(e *jx.Encoder)
- func (s TodoParentReadStatus) MarshalJSON() ([]byte, error)
- func (s TodoParentReadStatus) MarshalText() ([]byte, error)
- func (s *TodoParentReadStatus) UnmarshalJSON(data []byte) error
- func (s *TodoParentReadStatus) UnmarshalText(data []byte) error
- func (s TodoParentReadStatus) Validate() error
- type TodoRead
- func (s *TodoRead) Decode(d *jx.Decoder) error
- func (t *TodoRead) Elem() TodoRead
- func (s *TodoRead) Encode(e *jx.Encoder)
- func (s *TodoRead) GetCreatedAt() time.Time
- func (s *TodoRead) GetID() int
- func (s *TodoRead) GetPriority() int
- func (s *TodoRead) GetStatus() TodoReadStatus
- func (s *TodoRead) GetText() string
- func (s *TodoRead) MarshalJSON() ([]byte, error)
- func (s *TodoRead) SetCreatedAt(val time.Time)
- func (s *TodoRead) SetID(val int)
- func (s *TodoRead) SetPriority(val int)
- func (s *TodoRead) SetStatus(val TodoReadStatus)
- func (s *TodoRead) SetText(val string)
- func (s *TodoRead) UnmarshalJSON(data []byte) error
- func (s *TodoRead) Validate() error
- type TodoReadStatus
- func (TodoReadStatus) AllValues() []TodoReadStatus
- func (s *TodoReadStatus) Decode(d *jx.Decoder) error
- func (s TodoReadStatus) Encode(e *jx.Encoder)
- func (s TodoReadStatus) MarshalJSON() ([]byte, error)
- func (s TodoReadStatus) MarshalText() ([]byte, error)
- func (s *TodoReadStatus) UnmarshalJSON(data []byte) error
- func (s *TodoReadStatus) UnmarshalText(data []byte) error
- func (s TodoReadStatus) Validate() error
- type TodoUpdate
- func (s *TodoUpdate) Decode(d *jx.Decoder) error
- func (t *TodoUpdate) Elem() TodoUpdate
- func (s *TodoUpdate) Encode(e *jx.Encoder)
- func (s *TodoUpdate) GetCreatedAt() time.Time
- func (s *TodoUpdate) GetID() int
- func (s *TodoUpdate) GetPriority() int
- func (s *TodoUpdate) GetStatus() TodoUpdateStatus
- func (s *TodoUpdate) GetText() string
- func (s *TodoUpdate) MarshalJSON() ([]byte, error)
- func (s *TodoUpdate) SetCreatedAt(val time.Time)
- func (s *TodoUpdate) SetID(val int)
- func (s *TodoUpdate) SetPriority(val int)
- func (s *TodoUpdate) SetStatus(val TodoUpdateStatus)
- func (s *TodoUpdate) SetText(val string)
- func (s *TodoUpdate) UnmarshalJSON(data []byte) error
- func (s *TodoUpdate) Validate() error
- type TodoUpdateStatus
- func (TodoUpdateStatus) AllValues() []TodoUpdateStatus
- func (s *TodoUpdateStatus) Decode(d *jx.Decoder) error
- func (s TodoUpdateStatus) Encode(e *jx.Encoder)
- func (s TodoUpdateStatus) MarshalJSON() ([]byte, error)
- func (s TodoUpdateStatus) MarshalText() ([]byte, error)
- func (s *TodoUpdateStatus) UnmarshalJSON(data []byte) error
- func (s *TodoUpdateStatus) UnmarshalText(data []byte) error
- func (s TodoUpdateStatus) Validate() error
- type UnimplementedHandler
- func (UnimplementedHandler) CreateTodo(ctx context.Context, req *CreateTodoReq) (r CreateTodoRes, _ error)
- func (UnimplementedHandler) DeleteTodo(ctx context.Context, params DeleteTodoParams) (r DeleteTodoRes, _ error)
- func (UnimplementedHandler) ListTodo(ctx context.Context, params ListTodoParams) (r ListTodoRes, _ error)
- func (UnimplementedHandler) ListTodoChildren(ctx context.Context, params ListTodoChildrenParams) (r ListTodoChildrenRes, _ error)
- func (UnimplementedHandler) ReadTodo(ctx context.Context, params ReadTodoParams) (r ReadTodoRes, _ error)
- func (UnimplementedHandler) ReadTodoParent(ctx context.Context, params ReadTodoParentParams) (r ReadTodoParentRes, _ error)
- func (UnimplementedHandler) ServerStatus(ctx context.Context) (r ServerStatusRes, _ error)
- func (UnimplementedHandler) UpdateTodo(ctx context.Context, req *UpdateTodoReq, params UpdateTodoParams) (r UpdateTodoRes, _ error)
- type UpdateTodoParams
- type UpdateTodoReq
- func (s *UpdateTodoReq) Decode(d *jx.Decoder) error
- func (s *UpdateTodoReq) Encode(e *jx.Encoder)
- func (s *UpdateTodoReq) GetChildren() []int
- func (s *UpdateTodoReq) GetParent() OptInt
- func (s *UpdateTodoReq) GetPriority() OptInt
- func (s *UpdateTodoReq) GetStatus() OptUpdateTodoReqStatus
- func (s *UpdateTodoReq) GetText() OptString
- func (s *UpdateTodoReq) MarshalJSON() ([]byte, error)
- func (s *UpdateTodoReq) SetChildren(val []int)
- func (s *UpdateTodoReq) SetParent(val OptInt)
- func (s *UpdateTodoReq) SetPriority(val OptInt)
- func (s *UpdateTodoReq) SetStatus(val OptUpdateTodoReqStatus)
- func (s *UpdateTodoReq) SetText(val OptString)
- func (s *UpdateTodoReq) UnmarshalJSON(data []byte) error
- func (s *UpdateTodoReq) Validate() error
- type UpdateTodoReqStatus
- func (UpdateTodoReqStatus) AllValues() []UpdateTodoReqStatus
- func (s *UpdateTodoReqStatus) Decode(d *jx.Decoder) error
- func (s UpdateTodoReqStatus) Encode(e *jx.Encoder)
- func (s UpdateTodoReqStatus) MarshalJSON() ([]byte, error)
- func (s UpdateTodoReqStatus) MarshalText() ([]byte, error)
- func (s *UpdateTodoReqStatus) UnmarshalJSON(data []byte) error
- func (s *UpdateTodoReqStatus) UnmarshalText(data []byte) error
- func (s UpdateTodoReqStatus) Validate() error
- type UpdateTodoRes
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) CreateTodo ¶
func (c *Client) CreateTodo(ctx context.Context, request *CreateTodoReq) (CreateTodoRes, error)
CreateTodo invokes createTodo operation.
Creates a new Todo and persists it to storage.
POST /todos
func (*Client) DeleteTodo ¶
func (c *Client) DeleteTodo(ctx context.Context, params DeleteTodoParams) (DeleteTodoRes, error)
DeleteTodo invokes deleteTodo operation.
Deletes the Todo with the requested ID.
DELETE /todos/{id}
func (*Client) ListTodo ¶
func (c *Client) ListTodo(ctx context.Context, params ListTodoParams) (ListTodoRes, error)
ListTodo invokes listTodo operation.
List Todos.
GET /todos
func (*Client) ListTodoChildren ¶
func (c *Client) ListTodoChildren(ctx context.Context, params ListTodoChildrenParams) (ListTodoChildrenRes, error)
ListTodoChildren invokes listTodoChildren operation.
List attached Childrens.
GET /todos/{id}/children
func (*Client) ReadTodo ¶
func (c *Client) ReadTodo(ctx context.Context, params ReadTodoParams) (ReadTodoRes, error)
ReadTodo invokes readTodo operation.
Finds the Todo with the requested ID and returns it.
GET /todos/{id}
func (*Client) ReadTodoParent ¶
func (c *Client) ReadTodoParent(ctx context.Context, params ReadTodoParentParams) (ReadTodoParentRes, error)
ReadTodoParent invokes readTodoParent operation.
Find the attached Todo of the Todo with the given ID.
GET /todos/{id}/parent
func (*Client) ServerStatus ¶
func (c *Client) ServerStatus(ctx context.Context) (ServerStatusRes, error)
ServerStatus invokes ServerStatus operation.
Get information about the server.
GET /status
func (*Client) UpdateTodo ¶
func (c *Client) UpdateTodo(ctx context.Context, request *UpdateTodoReq, params UpdateTodoParams) (UpdateTodoRes, error)
UpdateTodo invokes updateTodo operation.
Updates a Todo and persists changes to storage.
PATCH /todos/{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 CreateTodoReq ¶
type CreateTodoReq struct { Text string `json:"text"` CreatedAt time.Time `json:"created_at"` Status CreateTodoReqStatus `json:"status"` Priority int `json:"priority"` Children []int `json:"children"` Parent OptInt `json:"parent"` }
func (*CreateTodoReq) Decode ¶
func (s *CreateTodoReq) Decode(d *jx.Decoder) error
Decode decodes CreateTodoReq from json.
func (*CreateTodoReq) Encode ¶
func (s *CreateTodoReq) Encode(e *jx.Encoder)
Encode implements json.Marshaler.
func (*CreateTodoReq) GetChildren ¶
func (s *CreateTodoReq) GetChildren() []int
GetChildren returns the value of Children.
func (*CreateTodoReq) GetCreatedAt ¶
func (s *CreateTodoReq) GetCreatedAt() time.Time
GetCreatedAt returns the value of CreatedAt.
func (*CreateTodoReq) GetParent ¶
func (s *CreateTodoReq) GetParent() OptInt
GetParent returns the value of Parent.
func (*CreateTodoReq) GetPriority ¶
func (s *CreateTodoReq) GetPriority() int
GetPriority returns the value of Priority.
func (*CreateTodoReq) GetStatus ¶
func (s *CreateTodoReq) GetStatus() CreateTodoReqStatus
GetStatus returns the value of Status.
func (*CreateTodoReq) GetText ¶
func (s *CreateTodoReq) GetText() string
GetText returns the value of Text.
func (*CreateTodoReq) MarshalJSON ¶
func (s *CreateTodoReq) MarshalJSON() ([]byte, error)
MarshalJSON implements stdjson.Marshaler.
func (*CreateTodoReq) SetChildren ¶
func (s *CreateTodoReq) SetChildren(val []int)
SetChildren sets the value of Children.
func (*CreateTodoReq) SetCreatedAt ¶
func (s *CreateTodoReq) SetCreatedAt(val time.Time)
SetCreatedAt sets the value of CreatedAt.
func (*CreateTodoReq) SetParent ¶
func (s *CreateTodoReq) SetParent(val OptInt)
SetParent sets the value of Parent.
func (*CreateTodoReq) SetPriority ¶
func (s *CreateTodoReq) SetPriority(val int)
SetPriority sets the value of Priority.
func (*CreateTodoReq) SetStatus ¶
func (s *CreateTodoReq) SetStatus(val CreateTodoReqStatus)
SetStatus sets the value of Status.
func (*CreateTodoReq) SetText ¶
func (s *CreateTodoReq) SetText(val string)
SetText sets the value of Text.
func (*CreateTodoReq) UnmarshalJSON ¶
func (s *CreateTodoReq) UnmarshalJSON(data []byte) error
UnmarshalJSON implements stdjson.Unmarshaler.
func (*CreateTodoReq) Validate ¶
func (s *CreateTodoReq) Validate() error
type CreateTodoReqStatus ¶
type CreateTodoReqStatus string
const ( CreateTodoReqStatusINPROGRESS CreateTodoReqStatus = "IN_PROGRESS" CreateTodoReqStatusCOMPLETED CreateTodoReqStatus = "COMPLETED" )
func (CreateTodoReqStatus) AllValues ¶
func (CreateTodoReqStatus) AllValues() []CreateTodoReqStatus
AllValues returns all CreateTodoReqStatus values.
func (*CreateTodoReqStatus) Decode ¶
func (s *CreateTodoReqStatus) Decode(d *jx.Decoder) error
Decode decodes CreateTodoReqStatus from json.
func (CreateTodoReqStatus) Encode ¶
func (s CreateTodoReqStatus) Encode(e *jx.Encoder)
Encode encodes CreateTodoReqStatus as json.
func (CreateTodoReqStatus) MarshalJSON ¶
func (s CreateTodoReqStatus) MarshalJSON() ([]byte, error)
MarshalJSON implements stdjson.Marshaler.
func (CreateTodoReqStatus) MarshalText ¶
func (s CreateTodoReqStatus) MarshalText() ([]byte, error)
MarshalText implements encoding.TextMarshaler.
func (*CreateTodoReqStatus) UnmarshalJSON ¶
func (s *CreateTodoReqStatus) UnmarshalJSON(data []byte) error
UnmarshalJSON implements stdjson.Unmarshaler.
func (*CreateTodoReqStatus) UnmarshalText ¶
func (s *CreateTodoReqStatus) UnmarshalText(data []byte) error
UnmarshalText implements encoding.TextUnmarshaler.
func (CreateTodoReqStatus) Validate ¶
func (s CreateTodoReqStatus) Validate() error
type CreateTodoRes ¶
type CreateTodoRes interface {
// contains filtered or unexported methods
}
type DeleteTodoNoContent ¶
type DeleteTodoNoContent struct{}
DeleteTodoNoContent is response for DeleteTodo operation.
type DeleteTodoParams ¶
type DeleteTodoParams struct { // ID of the Todo. ID int }
DeleteTodoParams is parameters of deleteTodo operation.
type DeleteTodoRes ¶
type DeleteTodoRes interface {
// contains filtered or unexported methods
}
type Handler ¶
type Handler interface { // CreateTodo implements createTodo operation. // // Creates a new Todo and persists it to storage. // // POST /todos CreateTodo(ctx context.Context, req *CreateTodoReq) (CreateTodoRes, error) // DeleteTodo implements deleteTodo operation. // // Deletes the Todo with the requested ID. // // DELETE /todos/{id} DeleteTodo(ctx context.Context, params DeleteTodoParams) (DeleteTodoRes, error) // ListTodo implements listTodo operation. // // List Todos. // // GET /todos ListTodo(ctx context.Context, params ListTodoParams) (ListTodoRes, error) // ListTodoChildren implements listTodoChildren operation. // // List attached Childrens. // // GET /todos/{id}/children ListTodoChildren(ctx context.Context, params ListTodoChildrenParams) (ListTodoChildrenRes, error) // ReadTodo implements readTodo operation. // // Finds the Todo with the requested ID and returns it. // // GET /todos/{id} ReadTodo(ctx context.Context, params ReadTodoParams) (ReadTodoRes, error) // ReadTodoParent implements readTodoParent operation. // // Find the attached Todo of the Todo with the given ID. // // GET /todos/{id}/parent ReadTodoParent(ctx context.Context, params ReadTodoParentParams) (ReadTodoParentRes, error) // ServerStatus implements ServerStatus operation. // // Get information about the server. // // GET /status ServerStatus(ctx context.Context) (ServerStatusRes, error) // UpdateTodo implements updateTodo operation. // // Updates a Todo and persists changes to storage. // // PATCH /todos/{id} UpdateTodo(ctx context.Context, req *UpdateTodoReq, params UpdateTodoParams) (UpdateTodoRes, error) }
Handler handles operations described by OpenAPI v3 specification.
type ListTodoChildrenOKApplicationJSON ¶
type ListTodoChildrenOKApplicationJSON []TodoChildrenList
func (*ListTodoChildrenOKApplicationJSON) Decode ¶
func (s *ListTodoChildrenOKApplicationJSON) Decode(d *jx.Decoder) error
Decode decodes ListTodoChildrenOKApplicationJSON from json.
func (ListTodoChildrenOKApplicationJSON) Encode ¶
func (s ListTodoChildrenOKApplicationJSON) Encode(e *jx.Encoder)
Encode encodes ListTodoChildrenOKApplicationJSON as json.
func (ListTodoChildrenOKApplicationJSON) MarshalJSON ¶
func (s ListTodoChildrenOKApplicationJSON) MarshalJSON() ([]byte, error)
MarshalJSON implements stdjson.Marshaler.
func (*ListTodoChildrenOKApplicationJSON) UnmarshalJSON ¶
func (s *ListTodoChildrenOKApplicationJSON) UnmarshalJSON(data []byte) error
UnmarshalJSON implements stdjson.Unmarshaler.
func (ListTodoChildrenOKApplicationJSON) Validate ¶
func (s ListTodoChildrenOKApplicationJSON) Validate() error
type ListTodoChildrenParams ¶
type ListTodoChildrenParams struct { // ID of the Todo. ID int // What page to render. Page OptInt // Item count to render per page. ItemsPerPage OptInt }
ListTodoChildrenParams is parameters of listTodoChildren operation.
type ListTodoChildrenRes ¶
type ListTodoChildrenRes interface {
// contains filtered or unexported methods
}
type ListTodoOKApplicationJSON ¶
type ListTodoOKApplicationJSON []TodoList
func (*ListTodoOKApplicationJSON) Decode ¶
func (s *ListTodoOKApplicationJSON) Decode(d *jx.Decoder) error
Decode decodes ListTodoOKApplicationJSON from json.
func (ListTodoOKApplicationJSON) Encode ¶
func (s ListTodoOKApplicationJSON) Encode(e *jx.Encoder)
Encode encodes ListTodoOKApplicationJSON as json.
func (ListTodoOKApplicationJSON) MarshalJSON ¶
func (s ListTodoOKApplicationJSON) MarshalJSON() ([]byte, error)
MarshalJSON implements stdjson.Marshaler.
func (*ListTodoOKApplicationJSON) UnmarshalJSON ¶
func (s *ListTodoOKApplicationJSON) UnmarshalJSON(data []byte) error
UnmarshalJSON implements stdjson.Unmarshaler.
func (ListTodoOKApplicationJSON) Validate ¶
func (s ListTodoOKApplicationJSON) Validate() error
type ListTodoParams ¶
type ListTodoParams struct { // What page to render. Page OptInt // Item count to render per page. ItemsPerPage OptInt }
ListTodoParams is parameters of listTodo operation.
type ListTodoRes ¶
type ListTodoRes interface {
// contains filtered or unexported methods
}
type OgentHandler ¶
type OgentHandler struct {
// contains filtered or unexported fields
}
OgentHandler implements the ogen generated Handler interface and uses Ent as data layer.
func NewOgentHandler ¶
func NewOgentHandler(c *ent.Client) *OgentHandler
NewOgentHandler returns a new OgentHandler.
func (*OgentHandler) CreateTodo ¶
func (h *OgentHandler) CreateTodo(ctx context.Context, req *CreateTodoReq) (CreateTodoRes, error)
CreateTodo handles POST /todos requests.
func (*OgentHandler) DeleteTodo ¶
func (h *OgentHandler) DeleteTodo(ctx context.Context, params DeleteTodoParams) (DeleteTodoRes, error)
DeleteTodo handles DELETE /todos/{id} requests.
func (*OgentHandler) ListTodo ¶
func (h *OgentHandler) ListTodo(ctx context.Context, params ListTodoParams) (ListTodoRes, error)
ListTodo handles GET /todos requests.
func (*OgentHandler) ListTodoChildren ¶
func (h *OgentHandler) ListTodoChildren(ctx context.Context, params ListTodoChildrenParams) (ListTodoChildrenRes, error)
ListTodoChildren handles GET /todos/{id}/children requests.
func (*OgentHandler) ReadTodo ¶
func (h *OgentHandler) ReadTodo(ctx context.Context, params ReadTodoParams) (ReadTodoRes, error)
ReadTodo handles GET /todos/{id} requests.
func (*OgentHandler) ReadTodoParent ¶
func (h *OgentHandler) ReadTodoParent(ctx context.Context, params ReadTodoParentParams) (ReadTodoParentRes, error)
ReadTodoParent handles GET /todos/{id}/parent requests.
func (*OgentHandler) UpdateTodo ¶
func (h *OgentHandler) UpdateTodo(ctx context.Context, req *UpdateTodoReq, params UpdateTodoParams) (UpdateTodoRes, error)
UpdateTodo handles PATCH /todos/{id} requests.
type OptInt ¶
OptInt is optional int.
func (OptInt) MarshalJSON ¶
MarshalJSON implements stdjson.Marshaler.
func (*OptInt) 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 OptUpdateTodoReqStatus ¶
type OptUpdateTodoReqStatus struct { Value UpdateTodoReqStatus Set bool }
OptUpdateTodoReqStatus is optional UpdateTodoReqStatus.
func NewOptUpdateTodoReqStatus ¶
func NewOptUpdateTodoReqStatus(v UpdateTodoReqStatus) OptUpdateTodoReqStatus
NewOptUpdateTodoReqStatus returns new OptUpdateTodoReqStatus with value set to v.
func (*OptUpdateTodoReqStatus) Decode ¶
func (o *OptUpdateTodoReqStatus) Decode(d *jx.Decoder) error
Decode decodes UpdateTodoReqStatus from json.
func (OptUpdateTodoReqStatus) Encode ¶
func (o OptUpdateTodoReqStatus) Encode(e *jx.Encoder)
Encode encodes UpdateTodoReqStatus as json.
func (OptUpdateTodoReqStatus) Get ¶
func (o OptUpdateTodoReqStatus) Get() (v UpdateTodoReqStatus, ok bool)
Get returns value and boolean that denotes whether value was set.
func (OptUpdateTodoReqStatus) IsSet ¶
func (o OptUpdateTodoReqStatus) IsSet() bool
IsSet returns true if OptUpdateTodoReqStatus was set.
func (OptUpdateTodoReqStatus) MarshalJSON ¶
func (s OptUpdateTodoReqStatus) MarshalJSON() ([]byte, error)
MarshalJSON implements stdjson.Marshaler.
func (OptUpdateTodoReqStatus) Or ¶
func (o OptUpdateTodoReqStatus) Or(d UpdateTodoReqStatus) UpdateTodoReqStatus
Or returns value if set, or given parameter if does not.
func (*OptUpdateTodoReqStatus) SetTo ¶
func (o *OptUpdateTodoReqStatus) SetTo(v UpdateTodoReqStatus)
SetTo sets value to v.
func (*OptUpdateTodoReqStatus) UnmarshalJSON ¶
func (s *OptUpdateTodoReqStatus) UnmarshalJSON(data []byte) error
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 R400 ¶
type R400 struct { Code int `json:"code"` Status string `json:"status"` Errors jx.Raw `json:"errors"` }
func (*R400) MarshalJSON ¶
MarshalJSON implements stdjson.Marshaler.
func (*R400) UnmarshalJSON ¶
UnmarshalJSON implements stdjson.Unmarshaler.
type R404 ¶
type R404 struct { Code int `json:"code"` Status string `json:"status"` Errors jx.Raw `json:"errors"` }
func (*R404) MarshalJSON ¶
MarshalJSON implements stdjson.Marshaler.
func (*R404) UnmarshalJSON ¶
UnmarshalJSON implements stdjson.Unmarshaler.
type R409 ¶
type R409 struct { Code int `json:"code"` Status string `json:"status"` Errors jx.Raw `json:"errors"` }
func (*R409) MarshalJSON ¶
MarshalJSON implements stdjson.Marshaler.
func (*R409) UnmarshalJSON ¶
UnmarshalJSON implements stdjson.Unmarshaler.
type R500 ¶
type R500 struct { Code int `json:"code"` Status string `json:"status"` Errors jx.Raw `json:"errors"` }
func (*R500) MarshalJSON ¶
MarshalJSON implements stdjson.Marshaler.
func (*R500) UnmarshalJSON ¶
UnmarshalJSON implements stdjson.Unmarshaler.
type ReadTodoParams ¶
type ReadTodoParams struct { // ID of the Todo. ID int }
ReadTodoParams is parameters of readTodo operation.
type ReadTodoParentParams ¶
type ReadTodoParentParams struct { // ID of the Todo. ID int }
ReadTodoParentParams is parameters of readTodoParent operation.
type ReadTodoParentRes ¶
type ReadTodoParentRes interface {
// contains filtered or unexported methods
}
type ReadTodoRes ¶
type ReadTodoRes interface {
// contains filtered or unexported methods
}
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 ServerStatusOK ¶
type ServerStatusRes ¶
type ServerStatusRes interface {
// contains filtered or unexported methods
}
type ServerStatusServiceUnavailable ¶
type ServerStatusServiceUnavailable struct{}
ServerStatusServiceUnavailable is response for ServerStatus operation.
type TodoChildrenList ¶
type TodoChildrenList struct { ID int `json:"id"` Text string `json:"text"` CreatedAt time.Time `json:"created_at"` Status TodoChildrenListStatus `json:"status"` Priority int `json:"priority"` }
Ref: #/components/schemas/Todo_ChildrenList
func NewTodoChildrenList ¶
func NewTodoChildrenList(e *ent.Todo) *TodoChildrenList
func NewTodoChildrenLists ¶
func NewTodoChildrenLists(es []*ent.Todo) []TodoChildrenList
func (*TodoChildrenList) Decode ¶
func (s *TodoChildrenList) Decode(d *jx.Decoder) error
Decode decodes TodoChildrenList from json.
func (*TodoChildrenList) Elem ¶
func (t *TodoChildrenList) Elem() TodoChildrenList
func (*TodoChildrenList) Encode ¶
func (s *TodoChildrenList) Encode(e *jx.Encoder)
Encode implements json.Marshaler.
func (*TodoChildrenList) GetCreatedAt ¶
func (s *TodoChildrenList) GetCreatedAt() time.Time
GetCreatedAt returns the value of CreatedAt.
func (*TodoChildrenList) GetID ¶
func (s *TodoChildrenList) GetID() int
GetID returns the value of ID.
func (*TodoChildrenList) GetPriority ¶
func (s *TodoChildrenList) GetPriority() int
GetPriority returns the value of Priority.
func (*TodoChildrenList) GetStatus ¶
func (s *TodoChildrenList) GetStatus() TodoChildrenListStatus
GetStatus returns the value of Status.
func (*TodoChildrenList) GetText ¶
func (s *TodoChildrenList) GetText() string
GetText returns the value of Text.
func (*TodoChildrenList) MarshalJSON ¶
func (s *TodoChildrenList) MarshalJSON() ([]byte, error)
MarshalJSON implements stdjson.Marshaler.
func (*TodoChildrenList) SetCreatedAt ¶
func (s *TodoChildrenList) SetCreatedAt(val time.Time)
SetCreatedAt sets the value of CreatedAt.
func (*TodoChildrenList) SetID ¶
func (s *TodoChildrenList) SetID(val int)
SetID sets the value of ID.
func (*TodoChildrenList) SetPriority ¶
func (s *TodoChildrenList) SetPriority(val int)
SetPriority sets the value of Priority.
func (*TodoChildrenList) SetStatus ¶
func (s *TodoChildrenList) SetStatus(val TodoChildrenListStatus)
SetStatus sets the value of Status.
func (*TodoChildrenList) SetText ¶
func (s *TodoChildrenList) SetText(val string)
SetText sets the value of Text.
func (*TodoChildrenList) UnmarshalJSON ¶
func (s *TodoChildrenList) UnmarshalJSON(data []byte) error
UnmarshalJSON implements stdjson.Unmarshaler.
func (*TodoChildrenList) Validate ¶
func (s *TodoChildrenList) Validate() error
type TodoChildrenListStatus ¶
type TodoChildrenListStatus string
const ( TodoChildrenListStatusINPROGRESS TodoChildrenListStatus = "IN_PROGRESS" TodoChildrenListStatusCOMPLETED TodoChildrenListStatus = "COMPLETED" )
func (TodoChildrenListStatus) AllValues ¶
func (TodoChildrenListStatus) AllValues() []TodoChildrenListStatus
AllValues returns all TodoChildrenListStatus values.
func (*TodoChildrenListStatus) Decode ¶
func (s *TodoChildrenListStatus) Decode(d *jx.Decoder) error
Decode decodes TodoChildrenListStatus from json.
func (TodoChildrenListStatus) Encode ¶
func (s TodoChildrenListStatus) Encode(e *jx.Encoder)
Encode encodes TodoChildrenListStatus as json.
func (TodoChildrenListStatus) MarshalJSON ¶
func (s TodoChildrenListStatus) MarshalJSON() ([]byte, error)
MarshalJSON implements stdjson.Marshaler.
func (TodoChildrenListStatus) MarshalText ¶
func (s TodoChildrenListStatus) MarshalText() ([]byte, error)
MarshalText implements encoding.TextMarshaler.
func (*TodoChildrenListStatus) UnmarshalJSON ¶
func (s *TodoChildrenListStatus) UnmarshalJSON(data []byte) error
UnmarshalJSON implements stdjson.Unmarshaler.
func (*TodoChildrenListStatus) UnmarshalText ¶
func (s *TodoChildrenListStatus) UnmarshalText(data []byte) error
UnmarshalText implements encoding.TextUnmarshaler.
func (TodoChildrenListStatus) Validate ¶
func (s TodoChildrenListStatus) Validate() error
type TodoCreate ¶
type TodoCreate struct { ID int `json:"id"` Text string `json:"text"` CreatedAt time.Time `json:"created_at"` Status TodoCreateStatus `json:"status"` Priority int `json:"priority"` }
Ref: #/components/schemas/TodoCreate
func NewTodoCreate ¶
func NewTodoCreate(e *ent.Todo) *TodoCreate
func NewTodoCreates ¶
func NewTodoCreates(es []*ent.Todo) []TodoCreate
func (*TodoCreate) Decode ¶
func (s *TodoCreate) Decode(d *jx.Decoder) error
Decode decodes TodoCreate from json.
func (*TodoCreate) Elem ¶
func (t *TodoCreate) Elem() TodoCreate
func (*TodoCreate) Encode ¶
func (s *TodoCreate) Encode(e *jx.Encoder)
Encode implements json.Marshaler.
func (*TodoCreate) GetCreatedAt ¶
func (s *TodoCreate) GetCreatedAt() time.Time
GetCreatedAt returns the value of CreatedAt.
func (*TodoCreate) GetPriority ¶
func (s *TodoCreate) GetPriority() int
GetPriority returns the value of Priority.
func (*TodoCreate) GetStatus ¶
func (s *TodoCreate) GetStatus() TodoCreateStatus
GetStatus returns the value of Status.
func (*TodoCreate) GetText ¶
func (s *TodoCreate) GetText() string
GetText returns the value of Text.
func (*TodoCreate) MarshalJSON ¶
func (s *TodoCreate) MarshalJSON() ([]byte, error)
MarshalJSON implements stdjson.Marshaler.
func (*TodoCreate) SetCreatedAt ¶
func (s *TodoCreate) SetCreatedAt(val time.Time)
SetCreatedAt sets the value of CreatedAt.
func (*TodoCreate) SetPriority ¶
func (s *TodoCreate) SetPriority(val int)
SetPriority sets the value of Priority.
func (*TodoCreate) SetStatus ¶
func (s *TodoCreate) SetStatus(val TodoCreateStatus)
SetStatus sets the value of Status.
func (*TodoCreate) SetText ¶
func (s *TodoCreate) SetText(val string)
SetText sets the value of Text.
func (*TodoCreate) UnmarshalJSON ¶
func (s *TodoCreate) UnmarshalJSON(data []byte) error
UnmarshalJSON implements stdjson.Unmarshaler.
func (*TodoCreate) Validate ¶
func (s *TodoCreate) Validate() error
type TodoCreateStatus ¶
type TodoCreateStatus string
const ( TodoCreateStatusINPROGRESS TodoCreateStatus = "IN_PROGRESS" TodoCreateStatusCOMPLETED TodoCreateStatus = "COMPLETED" )
func (TodoCreateStatus) AllValues ¶
func (TodoCreateStatus) AllValues() []TodoCreateStatus
AllValues returns all TodoCreateStatus values.
func (*TodoCreateStatus) Decode ¶
func (s *TodoCreateStatus) Decode(d *jx.Decoder) error
Decode decodes TodoCreateStatus from json.
func (TodoCreateStatus) Encode ¶
func (s TodoCreateStatus) Encode(e *jx.Encoder)
Encode encodes TodoCreateStatus as json.
func (TodoCreateStatus) MarshalJSON ¶
func (s TodoCreateStatus) MarshalJSON() ([]byte, error)
MarshalJSON implements stdjson.Marshaler.
func (TodoCreateStatus) MarshalText ¶
func (s TodoCreateStatus) MarshalText() ([]byte, error)
MarshalText implements encoding.TextMarshaler.
func (*TodoCreateStatus) UnmarshalJSON ¶
func (s *TodoCreateStatus) UnmarshalJSON(data []byte) error
UnmarshalJSON implements stdjson.Unmarshaler.
func (*TodoCreateStatus) UnmarshalText ¶
func (s *TodoCreateStatus) UnmarshalText(data []byte) error
UnmarshalText implements encoding.TextUnmarshaler.
func (TodoCreateStatus) Validate ¶
func (s TodoCreateStatus) Validate() error
type TodoList ¶
type TodoList struct { ID int `json:"id"` Text string `json:"text"` CreatedAt time.Time `json:"created_at"` Status TodoListStatus `json:"status"` Priority int `json:"priority"` }
Ref: #/components/schemas/TodoList
func NewTodoList ¶
func NewTodoLists ¶
func (*TodoList) GetCreatedAt ¶
GetCreatedAt returns the value of CreatedAt.
func (*TodoList) GetPriority ¶
GetPriority returns the value of Priority.
func (*TodoList) GetStatus ¶
func (s *TodoList) GetStatus() TodoListStatus
GetStatus returns the value of Status.
func (*TodoList) MarshalJSON ¶
MarshalJSON implements stdjson.Marshaler.
func (*TodoList) SetCreatedAt ¶
SetCreatedAt sets the value of CreatedAt.
func (*TodoList) SetPriority ¶
SetPriority sets the value of Priority.
func (*TodoList) SetStatus ¶
func (s *TodoList) SetStatus(val TodoListStatus)
SetStatus sets the value of Status.
func (*TodoList) UnmarshalJSON ¶
UnmarshalJSON implements stdjson.Unmarshaler.
type TodoListStatus ¶
type TodoListStatus string
const ( TodoListStatusINPROGRESS TodoListStatus = "IN_PROGRESS" TodoListStatusCOMPLETED TodoListStatus = "COMPLETED" )
func (TodoListStatus) AllValues ¶
func (TodoListStatus) AllValues() []TodoListStatus
AllValues returns all TodoListStatus values.
func (*TodoListStatus) Decode ¶
func (s *TodoListStatus) Decode(d *jx.Decoder) error
Decode decodes TodoListStatus from json.
func (TodoListStatus) Encode ¶
func (s TodoListStatus) Encode(e *jx.Encoder)
Encode encodes TodoListStatus as json.
func (TodoListStatus) MarshalJSON ¶
func (s TodoListStatus) MarshalJSON() ([]byte, error)
MarshalJSON implements stdjson.Marshaler.
func (TodoListStatus) MarshalText ¶
func (s TodoListStatus) MarshalText() ([]byte, error)
MarshalText implements encoding.TextMarshaler.
func (*TodoListStatus) UnmarshalJSON ¶
func (s *TodoListStatus) UnmarshalJSON(data []byte) error
UnmarshalJSON implements stdjson.Unmarshaler.
func (*TodoListStatus) UnmarshalText ¶
func (s *TodoListStatus) UnmarshalText(data []byte) error
UnmarshalText implements encoding.TextUnmarshaler.
func (TodoListStatus) Validate ¶
func (s TodoListStatus) Validate() error
type TodoParentRead ¶
type TodoParentRead struct { ID int `json:"id"` Text string `json:"text"` CreatedAt time.Time `json:"created_at"` Status TodoParentReadStatus `json:"status"` Priority int `json:"priority"` }
Ref: #/components/schemas/Todo_ParentRead
func NewTodoParentRead ¶
func NewTodoParentRead(e *ent.Todo) *TodoParentRead
func NewTodoParentReads ¶
func NewTodoParentReads(es []*ent.Todo) []TodoParentRead
func (*TodoParentRead) Decode ¶
func (s *TodoParentRead) Decode(d *jx.Decoder) error
Decode decodes TodoParentRead from json.
func (*TodoParentRead) Elem ¶
func (t *TodoParentRead) Elem() TodoParentRead
func (*TodoParentRead) Encode ¶
func (s *TodoParentRead) Encode(e *jx.Encoder)
Encode implements json.Marshaler.
func (*TodoParentRead) GetCreatedAt ¶
func (s *TodoParentRead) GetCreatedAt() time.Time
GetCreatedAt returns the value of CreatedAt.
func (*TodoParentRead) GetPriority ¶
func (s *TodoParentRead) GetPriority() int
GetPriority returns the value of Priority.
func (*TodoParentRead) GetStatus ¶
func (s *TodoParentRead) GetStatus() TodoParentReadStatus
GetStatus returns the value of Status.
func (*TodoParentRead) GetText ¶
func (s *TodoParentRead) GetText() string
GetText returns the value of Text.
func (*TodoParentRead) MarshalJSON ¶
func (s *TodoParentRead) MarshalJSON() ([]byte, error)
MarshalJSON implements stdjson.Marshaler.
func (*TodoParentRead) SetCreatedAt ¶
func (s *TodoParentRead) SetCreatedAt(val time.Time)
SetCreatedAt sets the value of CreatedAt.
func (*TodoParentRead) SetPriority ¶
func (s *TodoParentRead) SetPriority(val int)
SetPriority sets the value of Priority.
func (*TodoParentRead) SetStatus ¶
func (s *TodoParentRead) SetStatus(val TodoParentReadStatus)
SetStatus sets the value of Status.
func (*TodoParentRead) SetText ¶
func (s *TodoParentRead) SetText(val string)
SetText sets the value of Text.
func (*TodoParentRead) UnmarshalJSON ¶
func (s *TodoParentRead) UnmarshalJSON(data []byte) error
UnmarshalJSON implements stdjson.Unmarshaler.
func (*TodoParentRead) Validate ¶
func (s *TodoParentRead) Validate() error
type TodoParentReadStatus ¶
type TodoParentReadStatus string
const ( TodoParentReadStatusINPROGRESS TodoParentReadStatus = "IN_PROGRESS" TodoParentReadStatusCOMPLETED TodoParentReadStatus = "COMPLETED" )
func (TodoParentReadStatus) AllValues ¶
func (TodoParentReadStatus) AllValues() []TodoParentReadStatus
AllValues returns all TodoParentReadStatus values.
func (*TodoParentReadStatus) Decode ¶
func (s *TodoParentReadStatus) Decode(d *jx.Decoder) error
Decode decodes TodoParentReadStatus from json.
func (TodoParentReadStatus) Encode ¶
func (s TodoParentReadStatus) Encode(e *jx.Encoder)
Encode encodes TodoParentReadStatus as json.
func (TodoParentReadStatus) MarshalJSON ¶
func (s TodoParentReadStatus) MarshalJSON() ([]byte, error)
MarshalJSON implements stdjson.Marshaler.
func (TodoParentReadStatus) MarshalText ¶
func (s TodoParentReadStatus) MarshalText() ([]byte, error)
MarshalText implements encoding.TextMarshaler.
func (*TodoParentReadStatus) UnmarshalJSON ¶
func (s *TodoParentReadStatus) UnmarshalJSON(data []byte) error
UnmarshalJSON implements stdjson.Unmarshaler.
func (*TodoParentReadStatus) UnmarshalText ¶
func (s *TodoParentReadStatus) UnmarshalText(data []byte) error
UnmarshalText implements encoding.TextUnmarshaler.
func (TodoParentReadStatus) Validate ¶
func (s TodoParentReadStatus) Validate() error
type TodoRead ¶
type TodoRead struct { ID int `json:"id"` Text string `json:"text"` CreatedAt time.Time `json:"created_at"` Status TodoReadStatus `json:"status"` Priority int `json:"priority"` }
Ref: #/components/schemas/TodoRead
func NewTodoRead ¶
func NewTodoReads ¶
func (*TodoRead) GetCreatedAt ¶
GetCreatedAt returns the value of CreatedAt.
func (*TodoRead) GetPriority ¶
GetPriority returns the value of Priority.
func (*TodoRead) GetStatus ¶
func (s *TodoRead) GetStatus() TodoReadStatus
GetStatus returns the value of Status.
func (*TodoRead) MarshalJSON ¶
MarshalJSON implements stdjson.Marshaler.
func (*TodoRead) SetCreatedAt ¶
SetCreatedAt sets the value of CreatedAt.
func (*TodoRead) SetPriority ¶
SetPriority sets the value of Priority.
func (*TodoRead) SetStatus ¶
func (s *TodoRead) SetStatus(val TodoReadStatus)
SetStatus sets the value of Status.
func (*TodoRead) UnmarshalJSON ¶
UnmarshalJSON implements stdjson.Unmarshaler.
type TodoReadStatus ¶
type TodoReadStatus string
const ( TodoReadStatusINPROGRESS TodoReadStatus = "IN_PROGRESS" TodoReadStatusCOMPLETED TodoReadStatus = "COMPLETED" )
func (TodoReadStatus) AllValues ¶
func (TodoReadStatus) AllValues() []TodoReadStatus
AllValues returns all TodoReadStatus values.
func (*TodoReadStatus) Decode ¶
func (s *TodoReadStatus) Decode(d *jx.Decoder) error
Decode decodes TodoReadStatus from json.
func (TodoReadStatus) Encode ¶
func (s TodoReadStatus) Encode(e *jx.Encoder)
Encode encodes TodoReadStatus as json.
func (TodoReadStatus) MarshalJSON ¶
func (s TodoReadStatus) MarshalJSON() ([]byte, error)
MarshalJSON implements stdjson.Marshaler.
func (TodoReadStatus) MarshalText ¶
func (s TodoReadStatus) MarshalText() ([]byte, error)
MarshalText implements encoding.TextMarshaler.
func (*TodoReadStatus) UnmarshalJSON ¶
func (s *TodoReadStatus) UnmarshalJSON(data []byte) error
UnmarshalJSON implements stdjson.Unmarshaler.
func (*TodoReadStatus) UnmarshalText ¶
func (s *TodoReadStatus) UnmarshalText(data []byte) error
UnmarshalText implements encoding.TextUnmarshaler.
func (TodoReadStatus) Validate ¶
func (s TodoReadStatus) Validate() error
type TodoUpdate ¶
type TodoUpdate struct { ID int `json:"id"` Text string `json:"text"` CreatedAt time.Time `json:"created_at"` Status TodoUpdateStatus `json:"status"` Priority int `json:"priority"` }
Ref: #/components/schemas/TodoUpdate
func NewTodoUpdate ¶
func NewTodoUpdate(e *ent.Todo) *TodoUpdate
func NewTodoUpdates ¶
func NewTodoUpdates(es []*ent.Todo) []TodoUpdate
func (*TodoUpdate) Decode ¶
func (s *TodoUpdate) Decode(d *jx.Decoder) error
Decode decodes TodoUpdate from json.
func (*TodoUpdate) Elem ¶
func (t *TodoUpdate) Elem() TodoUpdate
func (*TodoUpdate) Encode ¶
func (s *TodoUpdate) Encode(e *jx.Encoder)
Encode implements json.Marshaler.
func (*TodoUpdate) GetCreatedAt ¶
func (s *TodoUpdate) GetCreatedAt() time.Time
GetCreatedAt returns the value of CreatedAt.
func (*TodoUpdate) GetPriority ¶
func (s *TodoUpdate) GetPriority() int
GetPriority returns the value of Priority.
func (*TodoUpdate) GetStatus ¶
func (s *TodoUpdate) GetStatus() TodoUpdateStatus
GetStatus returns the value of Status.
func (*TodoUpdate) GetText ¶
func (s *TodoUpdate) GetText() string
GetText returns the value of Text.
func (*TodoUpdate) MarshalJSON ¶
func (s *TodoUpdate) MarshalJSON() ([]byte, error)
MarshalJSON implements stdjson.Marshaler.
func (*TodoUpdate) SetCreatedAt ¶
func (s *TodoUpdate) SetCreatedAt(val time.Time)
SetCreatedAt sets the value of CreatedAt.
func (*TodoUpdate) SetPriority ¶
func (s *TodoUpdate) SetPriority(val int)
SetPriority sets the value of Priority.
func (*TodoUpdate) SetStatus ¶
func (s *TodoUpdate) SetStatus(val TodoUpdateStatus)
SetStatus sets the value of Status.
func (*TodoUpdate) SetText ¶
func (s *TodoUpdate) SetText(val string)
SetText sets the value of Text.
func (*TodoUpdate) UnmarshalJSON ¶
func (s *TodoUpdate) UnmarshalJSON(data []byte) error
UnmarshalJSON implements stdjson.Unmarshaler.
func (*TodoUpdate) Validate ¶
func (s *TodoUpdate) Validate() error
type TodoUpdateStatus ¶
type TodoUpdateStatus string
const ( TodoUpdateStatusINPROGRESS TodoUpdateStatus = "IN_PROGRESS" TodoUpdateStatusCOMPLETED TodoUpdateStatus = "COMPLETED" )
func (TodoUpdateStatus) AllValues ¶
func (TodoUpdateStatus) AllValues() []TodoUpdateStatus
AllValues returns all TodoUpdateStatus values.
func (*TodoUpdateStatus) Decode ¶
func (s *TodoUpdateStatus) Decode(d *jx.Decoder) error
Decode decodes TodoUpdateStatus from json.
func (TodoUpdateStatus) Encode ¶
func (s TodoUpdateStatus) Encode(e *jx.Encoder)
Encode encodes TodoUpdateStatus as json.
func (TodoUpdateStatus) MarshalJSON ¶
func (s TodoUpdateStatus) MarshalJSON() ([]byte, error)
MarshalJSON implements stdjson.Marshaler.
func (TodoUpdateStatus) MarshalText ¶
func (s TodoUpdateStatus) MarshalText() ([]byte, error)
MarshalText implements encoding.TextMarshaler.
func (*TodoUpdateStatus) UnmarshalJSON ¶
func (s *TodoUpdateStatus) UnmarshalJSON(data []byte) error
UnmarshalJSON implements stdjson.Unmarshaler.
func (*TodoUpdateStatus) UnmarshalText ¶
func (s *TodoUpdateStatus) UnmarshalText(data []byte) error
UnmarshalText implements encoding.TextUnmarshaler.
func (TodoUpdateStatus) Validate ¶
func (s TodoUpdateStatus) Validate() error
type UnimplementedHandler ¶
type UnimplementedHandler struct{}
UnimplementedHandler is no-op Handler which returns http.ErrNotImplemented.
func (UnimplementedHandler) CreateTodo ¶
func (UnimplementedHandler) CreateTodo(ctx context.Context, req *CreateTodoReq) (r CreateTodoRes, _ error)
CreateTodo implements createTodo operation.
Creates a new Todo and persists it to storage.
POST /todos
func (UnimplementedHandler) DeleteTodo ¶
func (UnimplementedHandler) DeleteTodo(ctx context.Context, params DeleteTodoParams) (r DeleteTodoRes, _ error)
DeleteTodo implements deleteTodo operation.
Deletes the Todo with the requested ID.
DELETE /todos/{id}
func (UnimplementedHandler) ListTodo ¶
func (UnimplementedHandler) ListTodo(ctx context.Context, params ListTodoParams) (r ListTodoRes, _ error)
ListTodo implements listTodo operation.
List Todos.
GET /todos
func (UnimplementedHandler) ListTodoChildren ¶
func (UnimplementedHandler) ListTodoChildren(ctx context.Context, params ListTodoChildrenParams) (r ListTodoChildrenRes, _ error)
ListTodoChildren implements listTodoChildren operation.
List attached Childrens.
GET /todos/{id}/children
func (UnimplementedHandler) ReadTodo ¶
func (UnimplementedHandler) ReadTodo(ctx context.Context, params ReadTodoParams) (r ReadTodoRes, _ error)
ReadTodo implements readTodo operation.
Finds the Todo with the requested ID and returns it.
GET /todos/{id}
func (UnimplementedHandler) ReadTodoParent ¶
func (UnimplementedHandler) ReadTodoParent(ctx context.Context, params ReadTodoParentParams) (r ReadTodoParentRes, _ error)
ReadTodoParent implements readTodoParent operation.
Find the attached Todo of the Todo with the given ID.
GET /todos/{id}/parent
func (UnimplementedHandler) ServerStatus ¶
func (UnimplementedHandler) ServerStatus(ctx context.Context) (r ServerStatusRes, _ error)
ServerStatus implements ServerStatus operation.
Get information about the server.
GET /status
func (UnimplementedHandler) UpdateTodo ¶
func (UnimplementedHandler) UpdateTodo(ctx context.Context, req *UpdateTodoReq, params UpdateTodoParams) (r UpdateTodoRes, _ error)
UpdateTodo implements updateTodo operation.
Updates a Todo and persists changes to storage.
PATCH /todos/{id}
type UpdateTodoParams ¶
type UpdateTodoParams struct { // ID of the Todo. ID int }
UpdateTodoParams is parameters of updateTodo operation.
type UpdateTodoReq ¶
type UpdateTodoReq struct { Text OptString `json:"text"` Status OptUpdateTodoReqStatus `json:"status"` Priority OptInt `json:"priority"` Children []int `json:"children"` Parent OptInt `json:"parent"` }
func (*UpdateTodoReq) Decode ¶
func (s *UpdateTodoReq) Decode(d *jx.Decoder) error
Decode decodes UpdateTodoReq from json.
func (*UpdateTodoReq) Encode ¶
func (s *UpdateTodoReq) Encode(e *jx.Encoder)
Encode implements json.Marshaler.
func (*UpdateTodoReq) GetChildren ¶
func (s *UpdateTodoReq) GetChildren() []int
GetChildren returns the value of Children.
func (*UpdateTodoReq) GetParent ¶
func (s *UpdateTodoReq) GetParent() OptInt
GetParent returns the value of Parent.
func (*UpdateTodoReq) GetPriority ¶
func (s *UpdateTodoReq) GetPriority() OptInt
GetPriority returns the value of Priority.
func (*UpdateTodoReq) GetStatus ¶
func (s *UpdateTodoReq) GetStatus() OptUpdateTodoReqStatus
GetStatus returns the value of Status.
func (*UpdateTodoReq) GetText ¶
func (s *UpdateTodoReq) GetText() OptString
GetText returns the value of Text.
func (*UpdateTodoReq) MarshalJSON ¶
func (s *UpdateTodoReq) MarshalJSON() ([]byte, error)
MarshalJSON implements stdjson.Marshaler.
func (*UpdateTodoReq) SetChildren ¶
func (s *UpdateTodoReq) SetChildren(val []int)
SetChildren sets the value of Children.
func (*UpdateTodoReq) SetParent ¶
func (s *UpdateTodoReq) SetParent(val OptInt)
SetParent sets the value of Parent.
func (*UpdateTodoReq) SetPriority ¶
func (s *UpdateTodoReq) SetPriority(val OptInt)
SetPriority sets the value of Priority.
func (*UpdateTodoReq) SetStatus ¶
func (s *UpdateTodoReq) SetStatus(val OptUpdateTodoReqStatus)
SetStatus sets the value of Status.
func (*UpdateTodoReq) SetText ¶
func (s *UpdateTodoReq) SetText(val OptString)
SetText sets the value of Text.
func (*UpdateTodoReq) UnmarshalJSON ¶
func (s *UpdateTodoReq) UnmarshalJSON(data []byte) error
UnmarshalJSON implements stdjson.Unmarshaler.
func (*UpdateTodoReq) Validate ¶
func (s *UpdateTodoReq) Validate() error
type UpdateTodoReqStatus ¶
type UpdateTodoReqStatus string
const ( UpdateTodoReqStatusINPROGRESS UpdateTodoReqStatus = "IN_PROGRESS" UpdateTodoReqStatusCOMPLETED UpdateTodoReqStatus = "COMPLETED" )
func (UpdateTodoReqStatus) AllValues ¶
func (UpdateTodoReqStatus) AllValues() []UpdateTodoReqStatus
AllValues returns all UpdateTodoReqStatus values.
func (*UpdateTodoReqStatus) Decode ¶
func (s *UpdateTodoReqStatus) Decode(d *jx.Decoder) error
Decode decodes UpdateTodoReqStatus from json.
func (UpdateTodoReqStatus) Encode ¶
func (s UpdateTodoReqStatus) Encode(e *jx.Encoder)
Encode encodes UpdateTodoReqStatus as json.
func (UpdateTodoReqStatus) MarshalJSON ¶
func (s UpdateTodoReqStatus) MarshalJSON() ([]byte, error)
MarshalJSON implements stdjson.Marshaler.
func (UpdateTodoReqStatus) MarshalText ¶
func (s UpdateTodoReqStatus) MarshalText() ([]byte, error)
MarshalText implements encoding.TextMarshaler.
func (*UpdateTodoReqStatus) UnmarshalJSON ¶
func (s *UpdateTodoReqStatus) UnmarshalJSON(data []byte) error
UnmarshalJSON implements stdjson.Unmarshaler.
func (*UpdateTodoReqStatus) UnmarshalText ¶
func (s *UpdateTodoReqStatus) UnmarshalText(data []byte) error
UnmarshalText implements encoding.TextUnmarshaler.
func (UpdateTodoReqStatus) Validate ¶
func (s UpdateTodoReqStatus) Validate() error
type UpdateTodoRes ¶
type UpdateTodoRes interface {
// contains filtered or unexported methods
}
Source Files
¶
- oas_cfg_gen.go
- oas_client_gen.go
- oas_defaults_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
- oas_validators_gen.go
- ogent.go
- responses.go