ogent

package
v0.0.0-...-1938339 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 14, 2023 License: MIT Imports: 30 Imported by: 0

Documentation

Overview

Code generated by ogen, DO NOT EDIT.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithServerURL

func WithServerURL(ctx context.Context, u *url.URL) context.Context

WithServerURL sets context key to override server URL.

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

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 ErrorHandler

type ErrorHandler = ogenerrors.ErrorHandler

ErrorHandler is error handler.

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

Decode decodes ListTodoChildrenOKApplicationJSON from json.

func (ListTodoChildrenOKApplicationJSON) Encode

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

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 Middleware

type Middleware = middleware.Middleware

Middleware is middleware type.

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

type OptInt struct {
	Value int
	Set   bool
}

OptInt is optional int.

func NewOptInt

func NewOptInt(v int) OptInt

NewOptInt returns new OptInt with value set to v.

func (*OptInt) Decode

func (o *OptInt) Decode(d *jx.Decoder) error

Decode decodes int from json.

func (OptInt) Encode

func (o OptInt) Encode(e *jx.Encoder)

Encode encodes int as json.

func (OptInt) Get

func (o OptInt) Get() (v int, ok bool)

Get returns value and boolean that denotes whether value was set.

func (OptInt) IsSet

func (o OptInt) IsSet() bool

IsSet returns true if OptInt was set.

func (OptInt) MarshalJSON

func (s OptInt) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (OptInt) Or

func (o OptInt) Or(d int) int

Or returns value if set, or given parameter if does not.

func (*OptInt) Reset

func (o *OptInt) Reset()

Reset unsets value.

func (*OptInt) SetTo

func (o *OptInt) SetTo(v int)

SetTo sets value to v.

func (*OptInt) UnmarshalJSON

func (s *OptInt) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type OptString

type OptString struct {
	Value string
	Set   bool
}

OptString is optional string.

func NewOptString

func NewOptString(v string) OptString

NewOptString returns new OptString with value set to v.

func (*OptString) Decode

func (o *OptString) Decode(d *jx.Decoder) error

Decode decodes string from json.

func (OptString) Encode

func (o OptString) Encode(e *jx.Encoder)

Encode encodes string as json.

func (OptString) Get

func (o OptString) Get() (v string, ok bool)

Get returns value and boolean that denotes whether value was set.

func (OptString) IsSet

func (o OptString) IsSet() bool

IsSet returns true if OptString was set.

func (OptString) MarshalJSON

func (s OptString) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (OptString) Or

func (o OptString) Or(d string) string

Or returns value if set, or given parameter if does not.

func (*OptString) Reset

func (o *OptString) Reset()

Reset unsets value.

func (*OptString) SetTo

func (o *OptString) SetTo(v string)

SetTo sets value to v.

func (*OptString) UnmarshalJSON

func (s *OptString) UnmarshalJSON(data []byte) error

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

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

Or returns value if set, or given parameter if does not.

func (*OptUpdateTodoReqStatus) Reset

func (o *OptUpdateTodoReqStatus) Reset()

Reset unsets value.

func (*OptUpdateTodoReqStatus) SetTo

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) Decode

func (s *R400) Decode(d *jx.Decoder) error

Decode decodes R400 from json.

func (*R400) Encode

func (s *R400) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*R400) GetCode

func (s *R400) GetCode() int

GetCode returns the value of Code.

func (*R400) GetErrors

func (s *R400) GetErrors() jx.Raw

GetErrors returns the value of Errors.

func (*R400) GetStatus

func (s *R400) GetStatus() string

GetStatus returns the value of Status.

func (*R400) MarshalJSON

func (s *R400) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*R400) SetCode

func (s *R400) SetCode(val int)

SetCode sets the value of Code.

func (*R400) SetErrors

func (s *R400) SetErrors(val jx.Raw)

SetErrors sets the value of Errors.

func (*R400) SetStatus

func (s *R400) SetStatus(val string)

SetStatus sets the value of Status.

func (*R400) UnmarshalJSON

func (s *R400) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type R404

type R404 struct {
	Code   int    `json:"code"`
	Status string `json:"status"`
	Errors jx.Raw `json:"errors"`
}

func (*R404) Decode

func (s *R404) Decode(d *jx.Decoder) error

Decode decodes R404 from json.

func (*R404) Encode

func (s *R404) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*R404) GetCode

func (s *R404) GetCode() int

GetCode returns the value of Code.

func (*R404) GetErrors

func (s *R404) GetErrors() jx.Raw

GetErrors returns the value of Errors.

func (*R404) GetStatus

func (s *R404) GetStatus() string

GetStatus returns the value of Status.

func (*R404) MarshalJSON

func (s *R404) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*R404) SetCode

func (s *R404) SetCode(val int)

SetCode sets the value of Code.

func (*R404) SetErrors

func (s *R404) SetErrors(val jx.Raw)

SetErrors sets the value of Errors.

func (*R404) SetStatus

func (s *R404) SetStatus(val string)

SetStatus sets the value of Status.

func (*R404) UnmarshalJSON

func (s *R404) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type R409

type R409 struct {
	Code   int    `json:"code"`
	Status string `json:"status"`
	Errors jx.Raw `json:"errors"`
}

func (*R409) Decode

func (s *R409) Decode(d *jx.Decoder) error

Decode decodes R409 from json.

func (*R409) Encode

func (s *R409) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*R409) GetCode

func (s *R409) GetCode() int

GetCode returns the value of Code.

func (*R409) GetErrors

func (s *R409) GetErrors() jx.Raw

GetErrors returns the value of Errors.

func (*R409) GetStatus

func (s *R409) GetStatus() string

GetStatus returns the value of Status.

func (*R409) MarshalJSON

func (s *R409) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*R409) SetCode

func (s *R409) SetCode(val int)

SetCode sets the value of Code.

func (*R409) SetErrors

func (s *R409) SetErrors(val jx.Raw)

SetErrors sets the value of Errors.

func (*R409) SetStatus

func (s *R409) SetStatus(val string)

SetStatus sets the value of Status.

func (*R409) UnmarshalJSON

func (s *R409) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type R500

type R500 struct {
	Code   int    `json:"code"`
	Status string `json:"status"`
	Errors jx.Raw `json:"errors"`
}

func (*R500) Decode

func (s *R500) Decode(d *jx.Decoder) error

Decode decodes R500 from json.

func (*R500) Encode

func (s *R500) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*R500) GetCode

func (s *R500) GetCode() int

GetCode returns the value of Code.

func (*R500) GetErrors

func (s *R500) GetErrors() jx.Raw

GetErrors returns the value of Errors.

func (*R500) GetStatus

func (s *R500) GetStatus() string

GetStatus returns the value of Status.

func (*R500) MarshalJSON

func (s *R500) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*R500) SetCode

func (s *R500) SetCode(val int)

SetCode sets the value of Code.

func (*R500) SetErrors

func (s *R500) SetErrors(val jx.Raw)

SetErrors sets the value of Errors.

func (*R500) SetStatus

func (s *R500) SetStatus(val string)

SetStatus sets the value of Status.

func (*R500) UnmarshalJSON

func (s *R500) UnmarshalJSON(data []byte) error

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) Args

func (r Route) Args() []string

Args returns parsed arguments.

func (Route) Name

func (r Route) Name() string

Name returns ogen operation name.

It is guaranteed to be unique and not empty.

func (Route) OperationID

func (r Route) OperationID() string

OperationID returns OpenAPI operationId.

func (Route) PathPattern

func (r Route) PathPattern() string

PathPattern returns OpenAPI path.

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.

func (*Server) FindPath

func (s *Server) FindPath(method string, u *url.URL) (r Route, _ bool)

FindPath finds Route for given method and URL.

func (*Server) FindRoute

func (s *Server) FindRoute(method, path string) (Route, bool)

FindRoute finds Route for given method and path.

Note: this method does not unescape path or handle reserved characters in path properly. Use FindPath instead.

func (*Server) ServeHTTP

func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request)

ServeHTTP serves http request as defined by OpenAPI v3 specification, calling handler that matches the path or returning not found error.

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 ServerStatusOK struct {
	Data io.Reader
}

func (ServerStatusOK) Read

func (s ServerStatusOK) Read(p []byte) (n int, err error)

Read reads data from the Data reader.

Kept to satisfy the io.Reader interface.

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 (*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

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

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) GetID

func (s *TodoCreate) GetID() int

GetID returns the value of ID.

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) SetID

func (s *TodoCreate) SetID(val int)

SetID sets the value of ID.

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 NewTodoList(e *ent.Todo) *TodoList

func NewTodoLists

func NewTodoLists(es []*ent.Todo) []TodoList

func (*TodoList) Decode

func (s *TodoList) Decode(d *jx.Decoder) error

Decode decodes TodoList from json.

func (*TodoList) Elem

func (t *TodoList) Elem() TodoList

func (*TodoList) Encode

func (s *TodoList) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*TodoList) GetCreatedAt

func (s *TodoList) GetCreatedAt() time.Time

GetCreatedAt returns the value of CreatedAt.

func (*TodoList) GetID

func (s *TodoList) GetID() int

GetID returns the value of ID.

func (*TodoList) GetPriority

func (s *TodoList) GetPriority() int

GetPriority returns the value of Priority.

func (*TodoList) GetStatus

func (s *TodoList) GetStatus() TodoListStatus

GetStatus returns the value of Status.

func (*TodoList) GetText

func (s *TodoList) GetText() string

GetText returns the value of Text.

func (*TodoList) MarshalJSON

func (s *TodoList) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*TodoList) SetCreatedAt

func (s *TodoList) SetCreatedAt(val time.Time)

SetCreatedAt sets the value of CreatedAt.

func (*TodoList) SetID

func (s *TodoList) SetID(val int)

SetID sets the value of ID.

func (*TodoList) SetPriority

func (s *TodoList) SetPriority(val int)

SetPriority sets the value of Priority.

func (*TodoList) SetStatus

func (s *TodoList) SetStatus(val TodoListStatus)

SetStatus sets the value of Status.

func (*TodoList) SetText

func (s *TodoList) SetText(val string)

SetText sets the value of Text.

func (*TodoList) UnmarshalJSON

func (s *TodoList) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

func (*TodoList) Validate

func (s *TodoList) Validate() error

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) GetID

func (s *TodoParentRead) GetID() int

GetID returns the value of ID.

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) SetID

func (s *TodoParentRead) SetID(val int)

SetID sets the value of ID.

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

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 NewTodoRead(e *ent.Todo) *TodoRead

func NewTodoReads

func NewTodoReads(es []*ent.Todo) []TodoRead

func (*TodoRead) Decode

func (s *TodoRead) Decode(d *jx.Decoder) error

Decode decodes TodoRead from json.

func (*TodoRead) Elem

func (t *TodoRead) Elem() TodoRead

func (*TodoRead) Encode

func (s *TodoRead) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*TodoRead) GetCreatedAt

func (s *TodoRead) GetCreatedAt() time.Time

GetCreatedAt returns the value of CreatedAt.

func (*TodoRead) GetID

func (s *TodoRead) GetID() int

GetID returns the value of ID.

func (*TodoRead) GetPriority

func (s *TodoRead) GetPriority() int

GetPriority returns the value of Priority.

func (*TodoRead) GetStatus

func (s *TodoRead) GetStatus() TodoReadStatus

GetStatus returns the value of Status.

func (*TodoRead) GetText

func (s *TodoRead) GetText() string

GetText returns the value of Text.

func (*TodoRead) MarshalJSON

func (s *TodoRead) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*TodoRead) SetCreatedAt

func (s *TodoRead) SetCreatedAt(val time.Time)

SetCreatedAt sets the value of CreatedAt.

func (*TodoRead) SetID

func (s *TodoRead) SetID(val int)

SetID sets the value of ID.

func (*TodoRead) SetPriority

func (s *TodoRead) SetPriority(val int)

SetPriority sets the value of Priority.

func (*TodoRead) SetStatus

func (s *TodoRead) SetStatus(val TodoReadStatus)

SetStatus sets the value of Status.

func (*TodoRead) SetText

func (s *TodoRead) SetText(val string)

SetText sets the value of Text.

func (*TodoRead) UnmarshalJSON

func (s *TodoRead) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

func (*TodoRead) Validate

func (s *TodoRead) Validate() error

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) GetID

func (s *TodoUpdate) GetID() int

GetID returns the value of ID.

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) SetID

func (s *TodoUpdate) SetID(val int)

SetID sets the value of ID.

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

CreateTodo implements createTodo operation.

Creates a new Todo and persists it to storage.

POST /todos

func (UnimplementedHandler) DeleteTodo

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

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

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

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

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
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL