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) MarkDone(ctx context.Context, params MarkDoneParams) error
- func (c *Client) ReadTodo(ctx context.Context, params ReadTodoParams) (ReadTodoRes, 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) GetDone() OptBool
- func (s *CreateTodoReq) GetTitle() string
- func (s *CreateTodoReq) MarshalJSON() ([]byte, error)
- func (s *CreateTodoReq) SetDone(val OptBool)
- func (s *CreateTodoReq) SetTitle(val string)
- func (s *CreateTodoReq) UnmarshalJSON(data []byte) error
- type CreateTodoRes
- type DeleteTodoNoContent
- type DeleteTodoParams
- type DeleteTodoRes
- type ErrorHandler
- type Handler
- 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 MarkDoneNoContent
- type MarkDoneParams
- 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) ReadTodo(ctx context.Context, params ReadTodoParams) (ReadTodoRes, error)
- func (h *OgentHandler) UpdateTodo(ctx context.Context, req *UpdateTodoReq, params UpdateTodoParams) (UpdateTodoRes, error)
- type OptBool
- func (o *OptBool) Decode(d *jx.Decoder) error
- func (o OptBool) Encode(e *jx.Encoder)
- func (o OptBool) Get() (v bool, ok bool)
- func (o OptBool) IsSet() bool
- func (s OptBool) MarshalJSON() ([]byte, error)
- func (o OptBool) Or(d bool) bool
- func (o *OptBool) Reset()
- func (o *OptBool) SetTo(v bool)
- func (s *OptBool) UnmarshalJSON(data []byte) error
- type OptInt
- 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 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 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 TodoCreate
- func (s *TodoCreate) Decode(d *jx.Decoder) error
- func (t *TodoCreate) Elem() TodoCreate
- func (s *TodoCreate) Encode(e *jx.Encoder)
- func (s *TodoCreate) GetDone() OptBool
- func (s *TodoCreate) GetID() int
- func (s *TodoCreate) GetTitle() string
- func (s *TodoCreate) MarshalJSON() ([]byte, error)
- func (s *TodoCreate) SetDone(val OptBool)
- func (s *TodoCreate) SetID(val int)
- func (s *TodoCreate) SetTitle(val string)
- func (s *TodoCreate) UnmarshalJSON(data []byte) 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) GetDone() OptBool
- func (s *TodoList) GetID() int
- func (s *TodoList) GetTitle() string
- func (s *TodoList) MarshalJSON() ([]byte, error)
- func (s *TodoList) SetDone(val OptBool)
- func (s *TodoList) SetID(val int)
- func (s *TodoList) SetTitle(val string)
- func (s *TodoList) UnmarshalJSON(data []byte) 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) GetDone() OptBool
- func (s *TodoRead) GetID() int
- func (s *TodoRead) GetTitle() string
- func (s *TodoRead) MarshalJSON() ([]byte, error)
- func (s *TodoRead) SetDone(val OptBool)
- func (s *TodoRead) SetID(val int)
- func (s *TodoRead) SetTitle(val string)
- func (s *TodoRead) UnmarshalJSON(data []byte) 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) GetDone() OptBool
- func (s *TodoUpdate) GetID() int
- func (s *TodoUpdate) GetTitle() string
- func (s *TodoUpdate) MarshalJSON() ([]byte, error)
- func (s *TodoUpdate) SetDone(val OptBool)
- func (s *TodoUpdate) SetID(val int)
- func (s *TodoUpdate) SetTitle(val string)
- func (s *TodoUpdate) UnmarshalJSON(data []byte) 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) MarkDone(ctx context.Context, params MarkDoneParams) error
- func (UnimplementedHandler) ReadTodo(ctx context.Context, params ReadTodoParams) (r ReadTodoRes, _ 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) GetDone() OptBool
- func (s *UpdateTodoReq) GetTitle() OptString
- func (s *UpdateTodoReq) MarshalJSON() ([]byte, error)
- func (s *UpdateTodoReq) SetDone(val OptBool)
- func (s *UpdateTodoReq) SetTitle(val OptString)
- func (s *UpdateTodoReq) UnmarshalJSON(data []byte) 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) MarkDone ¶
func (c *Client) MarkDone(ctx context.Context, params MarkDoneParams) error
MarkDone invokes markDone operation.
Marks a todo item as done.
PATCH /todos/{id}/done
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) 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 ¶
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) GetDone ¶
func (s *CreateTodoReq) GetDone() OptBool
GetDone returns the value of Done.
func (*CreateTodoReq) GetTitle ¶
func (s *CreateTodoReq) GetTitle() string
GetTitle returns the value of Title.
func (*CreateTodoReq) MarshalJSON ¶
func (s *CreateTodoReq) MarshalJSON() ([]byte, error)
MarshalJSON implements stdjson.Marshaler.
func (*CreateTodoReq) SetDone ¶
func (s *CreateTodoReq) SetDone(val OptBool)
SetDone sets the value of Done.
func (*CreateTodoReq) SetTitle ¶
func (s *CreateTodoReq) SetTitle(val string)
SetTitle sets the value of Title.
func (*CreateTodoReq) UnmarshalJSON ¶
func (s *CreateTodoReq) UnmarshalJSON(data []byte) error
UnmarshalJSON implements stdjson.Unmarshaler.
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) // MarkDone implements markDone operation. // // Marks a todo item as done. // // PATCH /todos/{id}/done MarkDone(ctx context.Context, params MarkDoneParams) 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) // 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 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 MarkDoneNoContent ¶
type MarkDoneNoContent struct{}
MarkDoneNoContent is response for MarkDone operation.
type MarkDoneParams ¶
type MarkDoneParams struct {
ID int
}
MarkDoneParams is parameters of markDone operation.
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) ReadTodo ¶
func (h *OgentHandler) ReadTodo(ctx context.Context, params ReadTodoParams) (ReadTodoRes, error)
ReadTodo handles GET /todos/{id} requests.
func (*OgentHandler) UpdateTodo ¶
func (h *OgentHandler) UpdateTodo(ctx context.Context, req *UpdateTodoReq, params UpdateTodoParams) (UpdateTodoRes, error)
UpdateTodo handles PATCH /todos/{id} requests.
type OptBool ¶
OptBool is optional bool.
func NewOptBool ¶
NewOptBool returns new OptBool with value set to v.
func (OptBool) MarshalJSON ¶
MarshalJSON implements stdjson.Marshaler.
func (*OptBool) UnmarshalJSON ¶
UnmarshalJSON implements stdjson.Unmarshaler.
type OptInt ¶
OptInt is optional int.
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 metric.NewNoopMeterProvider 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 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 TodoCreate ¶
type TodoCreate struct { ID int `json:"id"` Title string `json:"title"` Done OptBool `json:"done"` }
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) GetDone ¶
func (s *TodoCreate) GetDone() OptBool
GetDone returns the value of Done.
func (*TodoCreate) GetTitle ¶
func (s *TodoCreate) GetTitle() string
GetTitle returns the value of Title.
func (*TodoCreate) MarshalJSON ¶
func (s *TodoCreate) MarshalJSON() ([]byte, error)
MarshalJSON implements stdjson.Marshaler.
func (*TodoCreate) SetDone ¶
func (s *TodoCreate) SetDone(val OptBool)
SetDone sets the value of Done.
func (*TodoCreate) SetTitle ¶
func (s *TodoCreate) SetTitle(val string)
SetTitle sets the value of Title.
func (*TodoCreate) UnmarshalJSON ¶
func (s *TodoCreate) UnmarshalJSON(data []byte) error
UnmarshalJSON implements stdjson.Unmarshaler.
type TodoList ¶
Ref: #/components/schemas/TodoList
func NewTodoList ¶
func NewTodoLists ¶
func (*TodoList) MarshalJSON ¶
MarshalJSON implements stdjson.Marshaler.
func (*TodoList) UnmarshalJSON ¶
UnmarshalJSON implements stdjson.Unmarshaler.
type TodoRead ¶
Ref: #/components/schemas/TodoRead
func NewTodoRead ¶
func NewTodoReads ¶
func (*TodoRead) MarshalJSON ¶
MarshalJSON implements stdjson.Marshaler.
func (*TodoRead) UnmarshalJSON ¶
UnmarshalJSON implements stdjson.Unmarshaler.
type TodoUpdate ¶
type TodoUpdate struct { ID int `json:"id"` Title string `json:"title"` Done OptBool `json:"done"` }
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) GetDone ¶
func (s *TodoUpdate) GetDone() OptBool
GetDone returns the value of Done.
func (*TodoUpdate) GetTitle ¶
func (s *TodoUpdate) GetTitle() string
GetTitle returns the value of Title.
func (*TodoUpdate) MarshalJSON ¶
func (s *TodoUpdate) MarshalJSON() ([]byte, error)
MarshalJSON implements stdjson.Marshaler.
func (*TodoUpdate) SetDone ¶
func (s *TodoUpdate) SetDone(val OptBool)
SetDone sets the value of Done.
func (*TodoUpdate) SetTitle ¶
func (s *TodoUpdate) SetTitle(val string)
SetTitle sets the value of Title.
func (*TodoUpdate) UnmarshalJSON ¶
func (s *TodoUpdate) UnmarshalJSON(data []byte) error
UnmarshalJSON implements stdjson.Unmarshaler.
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) MarkDone ¶
func (UnimplementedHandler) MarkDone(ctx context.Context, params MarkDoneParams) error
MarkDone implements markDone operation.
Marks a todo item as done.
PATCH /todos/{id}/done
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) 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 ¶
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) GetDone ¶
func (s *UpdateTodoReq) GetDone() OptBool
GetDone returns the value of Done.
func (*UpdateTodoReq) GetTitle ¶
func (s *UpdateTodoReq) GetTitle() OptString
GetTitle returns the value of Title.
func (*UpdateTodoReq) MarshalJSON ¶
func (s *UpdateTodoReq) MarshalJSON() ([]byte, error)
MarshalJSON implements stdjson.Marshaler.
func (*UpdateTodoReq) SetDone ¶
func (s *UpdateTodoReq) SetDone(val OptBool)
SetDone sets the value of Done.
func (*UpdateTodoReq) SetTitle ¶
func (s *UpdateTodoReq) SetTitle(val OptString)
SetTitle sets the value of Title.
func (*UpdateTodoReq) UnmarshalJSON ¶
func (s *UpdateTodoReq) UnmarshalJSON(data []byte) error
UnmarshalJSON implements stdjson.Unmarshaler.
type UpdateTodoRes ¶
type UpdateTodoRes 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_server_gen.go
- oas_unimplemented_gen.go
- oas_validators_gen.go
- ogent.go
- responses.go