ogent

package
v0.0.0-...-c71f34e Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2023 License: Apache-2.0 Imports: 32 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 CategoryCreate

type CategoryCreate struct {
	ID   int    `json:"id"`
	Name string `json:"name"`
}

Ref: #/components/schemas/CategoryCreate

func NewCategoryCreate

func NewCategoryCreate(e *ent.Category) *CategoryCreate

func NewCategoryCreates

func NewCategoryCreates(es []*ent.Category) []CategoryCreate

func (*CategoryCreate) Decode

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

Decode decodes CategoryCreate from json.

func (*CategoryCreate) Elem

func (c *CategoryCreate) Elem() CategoryCreate

func (*CategoryCreate) Encode

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

Encode implements json.Marshaler.

func (*CategoryCreate) GetID

func (s *CategoryCreate) GetID() int

GetID returns the value of ID.

func (*CategoryCreate) GetName

func (s *CategoryCreate) GetName() string

GetName returns the value of Name.

func (*CategoryCreate) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (*CategoryCreate) SetID

func (s *CategoryCreate) SetID(val int)

SetID sets the value of ID.

func (*CategoryCreate) SetName

func (s *CategoryCreate) SetName(val string)

SetName sets the value of Name.

func (*CategoryCreate) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

type CategoryList

type CategoryList struct {
	ID   int    `json:"id"`
	Name string `json:"name"`
}

Ref: #/components/schemas/CategoryList

func NewCategoryList

func NewCategoryList(e *ent.Category) *CategoryList

func NewCategoryLists

func NewCategoryLists(es []*ent.Category) []CategoryList

func (*CategoryList) Decode

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

Decode decodes CategoryList from json.

func (*CategoryList) Elem

func (c *CategoryList) Elem() CategoryList

func (*CategoryList) Encode

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

Encode implements json.Marshaler.

func (*CategoryList) GetID

func (s *CategoryList) GetID() int

GetID returns the value of ID.

func (*CategoryList) GetName

func (s *CategoryList) GetName() string

GetName returns the value of Name.

func (*CategoryList) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (*CategoryList) SetID

func (s *CategoryList) SetID(val int)

SetID sets the value of ID.

func (*CategoryList) SetName

func (s *CategoryList) SetName(val string)

SetName sets the value of Name.

func (*CategoryList) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

type CategoryPetsList

type CategoryPetsList struct {
	ID       int         `json:"id"`
	Name     string      `json:"name"`
	Weight   OptInt      `json:"weight"`
	Birthday OptDateTime `json:"birthday"`
}

Ref: #/components/schemas/Category_PetsList

func NewCategoryPetsList

func NewCategoryPetsList(e *ent.Pet) *CategoryPetsList

func NewCategoryPetsLists

func NewCategoryPetsLists(es []*ent.Pet) []CategoryPetsList

func (*CategoryPetsList) Decode

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

Decode decodes CategoryPetsList from json.

func (*CategoryPetsList) Elem

func (*CategoryPetsList) Encode

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

Encode implements json.Marshaler.

func (*CategoryPetsList) GetBirthday

func (s *CategoryPetsList) GetBirthday() OptDateTime

GetBirthday returns the value of Birthday.

func (*CategoryPetsList) GetID

func (s *CategoryPetsList) GetID() int

GetID returns the value of ID.

func (*CategoryPetsList) GetName

func (s *CategoryPetsList) GetName() string

GetName returns the value of Name.

func (*CategoryPetsList) GetWeight

func (s *CategoryPetsList) GetWeight() OptInt

GetWeight returns the value of Weight.

func (*CategoryPetsList) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (*CategoryPetsList) SetBirthday

func (s *CategoryPetsList) SetBirthday(val OptDateTime)

SetBirthday sets the value of Birthday.

func (*CategoryPetsList) SetID

func (s *CategoryPetsList) SetID(val int)

SetID sets the value of ID.

func (*CategoryPetsList) SetName

func (s *CategoryPetsList) SetName(val string)

SetName sets the value of Name.

func (*CategoryPetsList) SetWeight

func (s *CategoryPetsList) SetWeight(val OptInt)

SetWeight sets the value of Weight.

func (*CategoryPetsList) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

type CategoryRead

type CategoryRead struct {
	ID   int    `json:"id"`
	Name string `json:"name"`
}

Ref: #/components/schemas/CategoryRead

func NewCategoryRead

func NewCategoryRead(e *ent.Category) *CategoryRead

func NewCategoryReads

func NewCategoryReads(es []*ent.Category) []CategoryRead

func (*CategoryRead) Decode

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

Decode decodes CategoryRead from json.

func (*CategoryRead) Elem

func (c *CategoryRead) Elem() CategoryRead

func (*CategoryRead) Encode

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

Encode implements json.Marshaler.

func (*CategoryRead) GetID

func (s *CategoryRead) GetID() int

GetID returns the value of ID.

func (*CategoryRead) GetName

func (s *CategoryRead) GetName() string

GetName returns the value of Name.

func (*CategoryRead) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (*CategoryRead) SetID

func (s *CategoryRead) SetID(val int)

SetID sets the value of ID.

func (*CategoryRead) SetName

func (s *CategoryRead) SetName(val string)

SetName sets the value of Name.

func (*CategoryRead) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

type CategoryUpdate

type CategoryUpdate struct {
	ID   int    `json:"id"`
	Name string `json:"name"`
}

Ref: #/components/schemas/CategoryUpdate

func NewCategoryUpdate

func NewCategoryUpdate(e *ent.Category) *CategoryUpdate

func NewCategoryUpdates

func NewCategoryUpdates(es []*ent.Category) []CategoryUpdate

func (*CategoryUpdate) Decode

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

Decode decodes CategoryUpdate from json.

func (*CategoryUpdate) Elem

func (c *CategoryUpdate) Elem() CategoryUpdate

func (*CategoryUpdate) Encode

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

Encode implements json.Marshaler.

func (*CategoryUpdate) GetID

func (s *CategoryUpdate) GetID() int

GetID returns the value of ID.

func (*CategoryUpdate) GetName

func (s *CategoryUpdate) GetName() string

GetName returns the value of Name.

func (*CategoryUpdate) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (*CategoryUpdate) SetID

func (s *CategoryUpdate) SetID(val int)

SetID sets the value of ID.

func (*CategoryUpdate) SetName

func (s *CategoryUpdate) SetName(val string)

SetName sets the value of Name.

func (*CategoryUpdate) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

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

func (c *Client) CreateCategory(ctx context.Context, request *CreateCategoryReq) (CreateCategoryRes, error)

CreateCategory invokes createCategory operation.

Creates a new Category and persists it to storage.

POST /categories

func (*Client) CreatePet

func (c *Client) CreatePet(ctx context.Context, request *CreatePetReq) (CreatePetRes, error)

CreatePet invokes createPet operation.

Creates a new Pet and persists it to storage.

POST /pets

func (*Client) CreateUser

func (c *Client) CreateUser(ctx context.Context, request *CreateUserReq) (CreateUserRes, error)

CreateUser invokes createUser operation.

Creates a new User and persists it to storage.

POST /users

func (*Client) DBHealth

func (c *Client) DBHealth(ctx context.Context) (DBHealthRes, error)

DBHealth invokes DBHealth operation.

Ping the database and report.

GET /db-health

func (*Client) DeleteCategory

func (c *Client) DeleteCategory(ctx context.Context, params DeleteCategoryParams) (DeleteCategoryRes, error)

DeleteCategory invokes deleteCategory operation.

Deletes the Category with the requested ID.

DELETE /categories/{id}

func (*Client) DeletePet

func (c *Client) DeletePet(ctx context.Context, params DeletePetParams) (DeletePetRes, error)

DeletePet invokes deletePet operation.

Deletes the Pet with the requested ID.

DELETE /pets/{id}

func (*Client) DeleteUser

func (c *Client) DeleteUser(ctx context.Context, params DeleteUserParams) (DeleteUserRes, error)

DeleteUser invokes deleteUser operation.

Deletes the User with the requested ID.

DELETE /users/{id}

func (*Client) ListCategory

func (c *Client) ListCategory(ctx context.Context, params ListCategoryParams) (ListCategoryRes, error)

ListCategory invokes listCategory operation.

List Categories.

GET /categories

func (*Client) ListCategoryPets

func (c *Client) ListCategoryPets(ctx context.Context, params ListCategoryPetsParams) (ListCategoryPetsRes, error)

ListCategoryPets invokes listCategoryPets operation.

List attached Pets.

GET /categories/{id}/pets

func (*Client) ListPet

func (c *Client) ListPet(ctx context.Context, params ListPetParams) (ListPetRes, error)

ListPet invokes listPet operation.

List Pets.

GET /pets

func (*Client) ListPetCategories

func (c *Client) ListPetCategories(ctx context.Context, params ListPetCategoriesParams) (ListPetCategoriesRes, error)

ListPetCategories invokes listPetCategories operation.

List attached Categories.

GET /pets/{id}/categories

func (*Client) ListPetFriends

func (c *Client) ListPetFriends(ctx context.Context, params ListPetFriendsParams) (ListPetFriendsRes, error)

ListPetFriends invokes listPetFriends operation.

List attached Friends.

GET /pets/{id}/friends

func (*Client) ListUser

func (c *Client) ListUser(ctx context.Context, params ListUserParams) (ListUserRes, error)

ListUser invokes listUser operation.

List Users.

GET /users

func (*Client) ListUserPets

func (c *Client) ListUserPets(ctx context.Context, params ListUserPetsParams) (ListUserPetsRes, error)

ListUserPets invokes listUserPets operation.

List attached Pets.

GET /users/{id}/pets

func (*Client) ReadCategory

func (c *Client) ReadCategory(ctx context.Context, params ReadCategoryParams) (ReadCategoryRes, error)

ReadCategory invokes readCategory operation.

Finds the Category with the requested ID and returns it.

GET /categories/{id}

func (*Client) ReadPet

func (c *Client) ReadPet(ctx context.Context, params ReadPetParams) (ReadPetRes, error)

ReadPet invokes readPet operation.

Finds the Pet with the requested ID and returns it.

GET /pets/{id}

func (*Client) ReadPetOwner

func (c *Client) ReadPetOwner(ctx context.Context, params ReadPetOwnerParams) (ReadPetOwnerRes, error)

ReadPetOwner invokes readPetOwner operation.

Find the attached User of the Pet with the given ID.

GET /pets/{id}/owner

func (*Client) ReadUser

func (c *Client) ReadUser(ctx context.Context, params ReadUserParams) (ReadUserRes, error)

ReadUser invokes readUser operation.

Finds the User with the requested ID and returns it.

GET /users/{id}

func (*Client) UpdateCategory

func (c *Client) UpdateCategory(ctx context.Context, request *UpdateCategoryReq, params UpdateCategoryParams) (UpdateCategoryRes, error)

UpdateCategory invokes updateCategory operation.

Updates a Category and persists changes to storage.

PATCH /categories/{id}

func (*Client) UpdatePet

func (c *Client) UpdatePet(ctx context.Context, request *UpdatePetReq, params UpdatePetParams) (UpdatePetRes, error)

UpdatePet invokes updatePet operation.

Updates a Pet and persists changes to storage.

PATCH /pets/{id}

func (*Client) UpdateUser

func (c *Client) UpdateUser(ctx context.Context, request *UpdateUserReq, params UpdateUserParams) (UpdateUserRes, error)

UpdateUser invokes updateUser operation.

Updates a User and persists changes to storage.

PATCH /users/{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 CreateCategoryReq

type CreateCategoryReq struct {
	Name string `json:"name"`
	Pets []int  `json:"pets"`
}

func (*CreateCategoryReq) Decode

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

Decode decodes CreateCategoryReq from json.

func (*CreateCategoryReq) Encode

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

Encode implements json.Marshaler.

func (*CreateCategoryReq) GetName

func (s *CreateCategoryReq) GetName() string

GetName returns the value of Name.

func (*CreateCategoryReq) GetPets

func (s *CreateCategoryReq) GetPets() []int

GetPets returns the value of Pets.

func (*CreateCategoryReq) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (*CreateCategoryReq) SetName

func (s *CreateCategoryReq) SetName(val string)

SetName sets the value of Name.

func (*CreateCategoryReq) SetPets

func (s *CreateCategoryReq) SetPets(val []int)

SetPets sets the value of Pets.

func (*CreateCategoryReq) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

type CreateCategoryRes

type CreateCategoryRes interface {
	// contains filtered or unexported methods
}

type CreatePetReq

type CreatePetReq struct {
	Name       string      `json:"name"`
	Weight     OptInt      `json:"weight"`
	Birthday   OptDateTime `json:"birthday"`
	Categories []int       `json:"categories"`
	Owner      int         `json:"owner"`
	Friends    []int       `json:"friends"`
}

func (*CreatePetReq) Decode

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

Decode decodes CreatePetReq from json.

func (*CreatePetReq) Encode

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

Encode implements json.Marshaler.

func (*CreatePetReq) GetBirthday

func (s *CreatePetReq) GetBirthday() OptDateTime

GetBirthday returns the value of Birthday.

func (*CreatePetReq) GetCategories

func (s *CreatePetReq) GetCategories() []int

GetCategories returns the value of Categories.

func (*CreatePetReq) GetFriends

func (s *CreatePetReq) GetFriends() []int

GetFriends returns the value of Friends.

func (*CreatePetReq) GetName

func (s *CreatePetReq) GetName() string

GetName returns the value of Name.

func (*CreatePetReq) GetOwner

func (s *CreatePetReq) GetOwner() int

GetOwner returns the value of Owner.

func (*CreatePetReq) GetWeight

func (s *CreatePetReq) GetWeight() OptInt

GetWeight returns the value of Weight.

func (*CreatePetReq) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (*CreatePetReq) SetBirthday

func (s *CreatePetReq) SetBirthday(val OptDateTime)

SetBirthday sets the value of Birthday.

func (*CreatePetReq) SetCategories

func (s *CreatePetReq) SetCategories(val []int)

SetCategories sets the value of Categories.

func (*CreatePetReq) SetFriends

func (s *CreatePetReq) SetFriends(val []int)

SetFriends sets the value of Friends.

func (*CreatePetReq) SetName

func (s *CreatePetReq) SetName(val string)

SetName sets the value of Name.

func (*CreatePetReq) SetOwner

func (s *CreatePetReq) SetOwner(val int)

SetOwner sets the value of Owner.

func (*CreatePetReq) SetWeight

func (s *CreatePetReq) SetWeight(val OptInt)

SetWeight sets the value of Weight.

func (*CreatePetReq) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

type CreatePetRes

type CreatePetRes interface {
	// contains filtered or unexported methods
}

type CreateUserReq

type CreateUserReq struct {
	Name string `json:"name"`
	Age  int    `json:"age"`
	Pets []int  `json:"pets"`
}

func (*CreateUserReq) Decode

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

Decode decodes CreateUserReq from json.

func (*CreateUserReq) Encode

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

Encode implements json.Marshaler.

func (*CreateUserReq) GetAge

func (s *CreateUserReq) GetAge() int

GetAge returns the value of Age.

func (*CreateUserReq) GetName

func (s *CreateUserReq) GetName() string

GetName returns the value of Name.

func (*CreateUserReq) GetPets

func (s *CreateUserReq) GetPets() []int

GetPets returns the value of Pets.

func (*CreateUserReq) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (*CreateUserReq) SetAge

func (s *CreateUserReq) SetAge(val int)

SetAge sets the value of Age.

func (*CreateUserReq) SetName

func (s *CreateUserReq) SetName(val string)

SetName sets the value of Name.

func (*CreateUserReq) SetPets

func (s *CreateUserReq) SetPets(val []int)

SetPets sets the value of Pets.

func (*CreateUserReq) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

type CreateUserRes

type CreateUserRes interface {
	// contains filtered or unexported methods
}

type DBHealthNoContent

type DBHealthNoContent struct{}

DBHealthNoContent is response for DBHealth operation.

type DBHealthRes

type DBHealthRes interface {
	// contains filtered or unexported methods
}

type DBHealthServiceUnavailable

type DBHealthServiceUnavailable struct{}

DBHealthServiceUnavailable is response for DBHealth operation.

type DeleteCategoryNoContent

type DeleteCategoryNoContent struct{}

DeleteCategoryNoContent is response for DeleteCategory operation.

type DeleteCategoryParams

type DeleteCategoryParams struct {
	// ID of the Category.
	ID int
}

DeleteCategoryParams is parameters of deleteCategory operation.

type DeleteCategoryRes

type DeleteCategoryRes interface {
	// contains filtered or unexported methods
}

type DeletePetNoContent

type DeletePetNoContent struct{}

DeletePetNoContent is response for DeletePet operation.

type DeletePetParams

type DeletePetParams struct {
	// ID of the Pet.
	ID int
}

DeletePetParams is parameters of deletePet operation.

type DeletePetRes

type DeletePetRes interface {
	// contains filtered or unexported methods
}

type DeleteUserNoContent

type DeleteUserNoContent struct{}

DeleteUserNoContent is response for DeleteUser operation.

type DeleteUserParams

type DeleteUserParams struct {
	// ID of the User.
	ID int
}

DeleteUserParams is parameters of deleteUser operation.

type DeleteUserRes

type DeleteUserRes interface {
	// contains filtered or unexported methods
}

type ErrorHandler

type ErrorHandler = ogenerrors.ErrorHandler

ErrorHandler is error handler.

type Handler

type Handler interface {
	// CreateCategory implements createCategory operation.
	//
	// Creates a new Category and persists it to storage.
	//
	// POST /categories
	CreateCategory(ctx context.Context, req *CreateCategoryReq) (CreateCategoryRes, error)
	// CreatePet implements createPet operation.
	//
	// Creates a new Pet and persists it to storage.
	//
	// POST /pets
	CreatePet(ctx context.Context, req *CreatePetReq) (CreatePetRes, error)
	// CreateUser implements createUser operation.
	//
	// Creates a new User and persists it to storage.
	//
	// POST /users
	CreateUser(ctx context.Context, req *CreateUserReq) (CreateUserRes, error)
	// DBHealth implements DBHealth operation.
	//
	// Ping the database and report.
	//
	// GET /db-health
	DBHealth(ctx context.Context) (DBHealthRes, error)
	// DeleteCategory implements deleteCategory operation.
	//
	// Deletes the Category with the requested ID.
	//
	// DELETE /categories/{id}
	DeleteCategory(ctx context.Context, params DeleteCategoryParams) (DeleteCategoryRes, error)
	// DeletePet implements deletePet operation.
	//
	// Deletes the Pet with the requested ID.
	//
	// DELETE /pets/{id}
	DeletePet(ctx context.Context, params DeletePetParams) (DeletePetRes, error)
	// DeleteUser implements deleteUser operation.
	//
	// Deletes the User with the requested ID.
	//
	// DELETE /users/{id}
	DeleteUser(ctx context.Context, params DeleteUserParams) (DeleteUserRes, error)
	// ListCategory implements listCategory operation.
	//
	// List Categories.
	//
	// GET /categories
	ListCategory(ctx context.Context, params ListCategoryParams) (ListCategoryRes, error)
	// ListCategoryPets implements listCategoryPets operation.
	//
	// List attached Pets.
	//
	// GET /categories/{id}/pets
	ListCategoryPets(ctx context.Context, params ListCategoryPetsParams) (ListCategoryPetsRes, error)
	// ListPet implements listPet operation.
	//
	// List Pets.
	//
	// GET /pets
	ListPet(ctx context.Context, params ListPetParams) (ListPetRes, error)
	// ListPetCategories implements listPetCategories operation.
	//
	// List attached Categories.
	//
	// GET /pets/{id}/categories
	ListPetCategories(ctx context.Context, params ListPetCategoriesParams) (ListPetCategoriesRes, error)
	// ListPetFriends implements listPetFriends operation.
	//
	// List attached Friends.
	//
	// GET /pets/{id}/friends
	ListPetFriends(ctx context.Context, params ListPetFriendsParams) (ListPetFriendsRes, error)
	// ListUser implements listUser operation.
	//
	// List Users.
	//
	// GET /users
	ListUser(ctx context.Context, params ListUserParams) (ListUserRes, error)
	// ListUserPets implements listUserPets operation.
	//
	// List attached Pets.
	//
	// GET /users/{id}/pets
	ListUserPets(ctx context.Context, params ListUserPetsParams) (ListUserPetsRes, error)
	// ReadCategory implements readCategory operation.
	//
	// Finds the Category with the requested ID and returns it.
	//
	// GET /categories/{id}
	ReadCategory(ctx context.Context, params ReadCategoryParams) (ReadCategoryRes, error)
	// ReadPet implements readPet operation.
	//
	// Finds the Pet with the requested ID and returns it.
	//
	// GET /pets/{id}
	ReadPet(ctx context.Context, params ReadPetParams) (ReadPetRes, error)
	// ReadPetOwner implements readPetOwner operation.
	//
	// Find the attached User of the Pet with the given ID.
	//
	// GET /pets/{id}/owner
	ReadPetOwner(ctx context.Context, params ReadPetOwnerParams) (ReadPetOwnerRes, error)
	// ReadUser implements readUser operation.
	//
	// Finds the User with the requested ID and returns it.
	//
	// GET /users/{id}
	ReadUser(ctx context.Context, params ReadUserParams) (ReadUserRes, error)
	// UpdateCategory implements updateCategory operation.
	//
	// Updates a Category and persists changes to storage.
	//
	// PATCH /categories/{id}
	UpdateCategory(ctx context.Context, req *UpdateCategoryReq, params UpdateCategoryParams) (UpdateCategoryRes, error)
	// UpdatePet implements updatePet operation.
	//
	// Updates a Pet and persists changes to storage.
	//
	// PATCH /pets/{id}
	UpdatePet(ctx context.Context, req *UpdatePetReq, params UpdatePetParams) (UpdatePetRes, error)
	// UpdateUser implements updateUser operation.
	//
	// Updates a User and persists changes to storage.
	//
	// PATCH /users/{id}
	UpdateUser(ctx context.Context, req *UpdateUserReq, params UpdateUserParams) (UpdateUserRes, error)
}

Handler handles operations described by OpenAPI v3 specification.

type ListCategoryOKApplicationJSON

type ListCategoryOKApplicationJSON []CategoryList

func (*ListCategoryOKApplicationJSON) Decode

Decode decodes ListCategoryOKApplicationJSON from json.

func (ListCategoryOKApplicationJSON) Encode

Encode encodes ListCategoryOKApplicationJSON as json.

func (ListCategoryOKApplicationJSON) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (*ListCategoryOKApplicationJSON) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

func (ListCategoryOKApplicationJSON) Validate

func (s ListCategoryOKApplicationJSON) Validate() error

type ListCategoryParams

type ListCategoryParams struct {
	// What page to render.
	Page OptInt
	// Item count to render per page.
	ItemsPerPage OptInt
}

ListCategoryParams is parameters of listCategory operation.

type ListCategoryPetsOKApplicationJSON

type ListCategoryPetsOKApplicationJSON []CategoryPetsList

func (*ListCategoryPetsOKApplicationJSON) Decode

Decode decodes ListCategoryPetsOKApplicationJSON from json.

func (ListCategoryPetsOKApplicationJSON) Encode

Encode encodes ListCategoryPetsOKApplicationJSON as json.

func (ListCategoryPetsOKApplicationJSON) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (*ListCategoryPetsOKApplicationJSON) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

func (ListCategoryPetsOKApplicationJSON) Validate

type ListCategoryPetsParams

type ListCategoryPetsParams struct {
	// ID of the Category.
	ID int
	// What page to render.
	Page OptInt
	// Item count to render per page.
	ItemsPerPage OptInt
}

ListCategoryPetsParams is parameters of listCategoryPets operation.

type ListCategoryPetsRes

type ListCategoryPetsRes interface {
	// contains filtered or unexported methods
}

type ListCategoryRes

type ListCategoryRes interface {
	// contains filtered or unexported methods
}

type ListPetCategoriesOKApplicationJSON

type ListPetCategoriesOKApplicationJSON []PetCategoriesList

func (*ListPetCategoriesOKApplicationJSON) Decode

Decode decodes ListPetCategoriesOKApplicationJSON from json.

func (ListPetCategoriesOKApplicationJSON) Encode

Encode encodes ListPetCategoriesOKApplicationJSON as json.

func (ListPetCategoriesOKApplicationJSON) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (*ListPetCategoriesOKApplicationJSON) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

func (ListPetCategoriesOKApplicationJSON) Validate

type ListPetCategoriesParams

type ListPetCategoriesParams struct {
	// ID of the Pet.
	ID int
	// What page to render.
	Page OptInt
	// Item count to render per page.
	ItemsPerPage OptInt
}

ListPetCategoriesParams is parameters of listPetCategories operation.

type ListPetCategoriesRes

type ListPetCategoriesRes interface {
	// contains filtered or unexported methods
}

type ListPetFriendsOKApplicationJSON

type ListPetFriendsOKApplicationJSON []PetFriendsList

func (*ListPetFriendsOKApplicationJSON) Decode

Decode decodes ListPetFriendsOKApplicationJSON from json.

func (ListPetFriendsOKApplicationJSON) Encode

Encode encodes ListPetFriendsOKApplicationJSON as json.

func (ListPetFriendsOKApplicationJSON) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (*ListPetFriendsOKApplicationJSON) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

func (ListPetFriendsOKApplicationJSON) Validate

type ListPetFriendsParams

type ListPetFriendsParams struct {
	// ID of the Pet.
	ID int
	// What page to render.
	Page OptInt
	// Item count to render per page.
	ItemsPerPage OptInt
}

ListPetFriendsParams is parameters of listPetFriends operation.

type ListPetFriendsRes

type ListPetFriendsRes interface {
	// contains filtered or unexported methods
}

type ListPetOKApplicationJSON

type ListPetOKApplicationJSON []PetList

func (*ListPetOKApplicationJSON) Decode

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

Decode decodes ListPetOKApplicationJSON from json.

func (ListPetOKApplicationJSON) Encode

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

Encode encodes ListPetOKApplicationJSON as json.

func (ListPetOKApplicationJSON) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (*ListPetOKApplicationJSON) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

func (ListPetOKApplicationJSON) Validate

func (s ListPetOKApplicationJSON) Validate() error

type ListPetParams

type ListPetParams struct {
	// What page to render.
	Page OptInt
	// Item count to render per page.
	ItemsPerPage OptInt
}

ListPetParams is parameters of listPet operation.

type ListPetRes

type ListPetRes interface {
	// contains filtered or unexported methods
}

type ListUserOKApplicationJSON

type ListUserOKApplicationJSON []UserList

func (*ListUserOKApplicationJSON) Decode

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

Decode decodes ListUserOKApplicationJSON from json.

func (ListUserOKApplicationJSON) Encode

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

Encode encodes ListUserOKApplicationJSON as json.

func (ListUserOKApplicationJSON) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (*ListUserOKApplicationJSON) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

func (ListUserOKApplicationJSON) Validate

func (s ListUserOKApplicationJSON) Validate() error

type ListUserParams

type ListUserParams struct {
	// What page to render.
	Page OptInt
	// Item count to render per page.
	ItemsPerPage OptInt
}

ListUserParams is parameters of listUser operation.

type ListUserPetsOKApplicationJSON

type ListUserPetsOKApplicationJSON []UserPetsList

func (*ListUserPetsOKApplicationJSON) Decode

Decode decodes ListUserPetsOKApplicationJSON from json.

func (ListUserPetsOKApplicationJSON) Encode

Encode encodes ListUserPetsOKApplicationJSON as json.

func (ListUserPetsOKApplicationJSON) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (*ListUserPetsOKApplicationJSON) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

func (ListUserPetsOKApplicationJSON) Validate

func (s ListUserPetsOKApplicationJSON) Validate() error

type ListUserPetsParams

type ListUserPetsParams struct {
	// ID of the User.
	ID int
	// What page to render.
	Page OptInt
	// Item count to render per page.
	ItemsPerPage OptInt
}

ListUserPetsParams is parameters of listUserPets operation.

type ListUserPetsRes

type ListUserPetsRes interface {
	// contains filtered or unexported methods
}

type ListUserRes

type ListUserRes 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) CreateCategory

func (h *OgentHandler) CreateCategory(ctx context.Context, req *CreateCategoryReq) (CreateCategoryRes, error)

CreateCategory handles POST /categories requests.

func (*OgentHandler) CreatePet

func (h *OgentHandler) CreatePet(ctx context.Context, req *CreatePetReq) (CreatePetRes, error)

CreatePet handles POST /pets requests.

func (*OgentHandler) CreateUser

func (h *OgentHandler) CreateUser(ctx context.Context, req *CreateUserReq) (CreateUserRes, error)

CreateUser handles POST /users requests.

func (*OgentHandler) DeleteCategory

func (h *OgentHandler) DeleteCategory(ctx context.Context, params DeleteCategoryParams) (DeleteCategoryRes, error)

DeleteCategory handles DELETE /categories/{id} requests.

func (*OgentHandler) DeletePet

func (h *OgentHandler) DeletePet(ctx context.Context, params DeletePetParams) (DeletePetRes, error)

DeletePet handles DELETE /pets/{id} requests.

func (*OgentHandler) DeleteUser

func (h *OgentHandler) DeleteUser(ctx context.Context, params DeleteUserParams) (DeleteUserRes, error)

DeleteUser handles DELETE /users/{id} requests.

func (*OgentHandler) ListCategory

func (h *OgentHandler) ListCategory(ctx context.Context, params ListCategoryParams) (ListCategoryRes, error)

ListCategory handles GET /categories requests.

func (*OgentHandler) ListCategoryPets

func (h *OgentHandler) ListCategoryPets(ctx context.Context, params ListCategoryPetsParams) (ListCategoryPetsRes, error)

ListCategoryPets handles GET /categories/{id}/pets requests.

func (*OgentHandler) ListPet

func (h *OgentHandler) ListPet(ctx context.Context, params ListPetParams) (ListPetRes, error)

ListPet handles GET /pets requests.

func (*OgentHandler) ListPetCategories

func (h *OgentHandler) ListPetCategories(ctx context.Context, params ListPetCategoriesParams) (ListPetCategoriesRes, error)

ListPetCategories handles GET /pets/{id}/categories requests.

func (*OgentHandler) ListPetFriends

func (h *OgentHandler) ListPetFriends(ctx context.Context, params ListPetFriendsParams) (ListPetFriendsRes, error)

ListPetFriends handles GET /pets/{id}/friends requests.

func (*OgentHandler) ListUser

func (h *OgentHandler) ListUser(ctx context.Context, params ListUserParams) (ListUserRes, error)

ListUser handles GET /users requests.

func (*OgentHandler) ListUserPets

func (h *OgentHandler) ListUserPets(ctx context.Context, params ListUserPetsParams) (ListUserPetsRes, error)

ListUserPets handles GET /users/{id}/pets requests.

func (*OgentHandler) ReadCategory

func (h *OgentHandler) ReadCategory(ctx context.Context, params ReadCategoryParams) (ReadCategoryRes, error)

ReadCategory handles GET /categories/{id} requests.

func (*OgentHandler) ReadPet

func (h *OgentHandler) ReadPet(ctx context.Context, params ReadPetParams) (ReadPetRes, error)

ReadPet handles GET /pets/{id} requests.

func (*OgentHandler) ReadPetOwner

func (h *OgentHandler) ReadPetOwner(ctx context.Context, params ReadPetOwnerParams) (ReadPetOwnerRes, error)

ReadPetOwner handles GET /pets/{id}/owner requests.

func (*OgentHandler) ReadUser

func (h *OgentHandler) ReadUser(ctx context.Context, params ReadUserParams) (ReadUserRes, error)

ReadUser handles GET /users/{id} requests.

func (*OgentHandler) UpdateCategory

UpdateCategory handles PATCH /categories/{id} requests.

func (*OgentHandler) UpdatePet

func (h *OgentHandler) UpdatePet(ctx context.Context, req *UpdatePetReq, params UpdatePetParams) (UpdatePetRes, error)

UpdatePet handles PATCH /pets/{id} requests.

func (*OgentHandler) UpdateUser

func (h *OgentHandler) UpdateUser(ctx context.Context, req *UpdateUserReq, params UpdateUserParams) (UpdateUserRes, error)

UpdateUser handles PATCH /users/{id} requests.

type OptDateTime

type OptDateTime struct {
	Value time.Time
	Set   bool
}

OptDateTime is optional time.Time.

func NewOptDateTime

func NewOptDateTime(v time.Time) OptDateTime

NewOptDateTime returns new OptDateTime with value set to v.

func (*OptDateTime) Decode

func (o *OptDateTime) Decode(d *jx.Decoder, format func(*jx.Decoder) (time.Time, error)) error

Decode decodes time.Time from json.

func (OptDateTime) Encode

func (o OptDateTime) Encode(e *jx.Encoder, format func(*jx.Encoder, time.Time))

Encode encodes time.Time as json.

func (OptDateTime) Get

func (o OptDateTime) Get() (v time.Time, ok bool)

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

func (OptDateTime) IsSet

func (o OptDateTime) IsSet() bool

IsSet returns true if OptDateTime was set.

func (OptDateTime) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (OptDateTime) Or

func (o OptDateTime) Or(d time.Time) time.Time

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

func (*OptDateTime) Reset

func (o *OptDateTime) Reset()

Reset unsets value.

func (*OptDateTime) SetTo

func (o *OptDateTime) SetTo(v time.Time)

SetTo sets value to v.

func (*OptDateTime) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

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 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 PetCategoriesList

type PetCategoriesList struct {
	ID   int    `json:"id"`
	Name string `json:"name"`
}

Ref: #/components/schemas/Pet_CategoriesList

func NewPetCategoriesList

func NewPetCategoriesList(e *ent.Category) *PetCategoriesList

func NewPetCategoriesLists

func NewPetCategoriesLists(es []*ent.Category) []PetCategoriesList

func (*PetCategoriesList) Decode

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

Decode decodes PetCategoriesList from json.

func (*PetCategoriesList) Elem

func (*PetCategoriesList) Encode

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

Encode implements json.Marshaler.

func (*PetCategoriesList) GetID

func (s *PetCategoriesList) GetID() int

GetID returns the value of ID.

func (*PetCategoriesList) GetName

func (s *PetCategoriesList) GetName() string

GetName returns the value of Name.

func (*PetCategoriesList) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (*PetCategoriesList) SetID

func (s *PetCategoriesList) SetID(val int)

SetID sets the value of ID.

func (*PetCategoriesList) SetName

func (s *PetCategoriesList) SetName(val string)

SetName sets the value of Name.

func (*PetCategoriesList) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

type PetCreate

type PetCreate struct {
	ID         int                   `json:"id"`
	Name       string                `json:"name"`
	Weight     OptInt                `json:"weight"`
	Birthday   OptDateTime           `json:"birthday"`
	Categories []PetCreateCategories `json:"categories"`
	Owner      PetCreateOwner        `json:"owner"`
}

Ref: #/components/schemas/PetCreate

func NewPetCreate

func NewPetCreate(e *ent.Pet) *PetCreate

func NewPetCreates

func NewPetCreates(es []*ent.Pet) []PetCreate

func (*PetCreate) Decode

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

Decode decodes PetCreate from json.

func (*PetCreate) Elem

func (pe *PetCreate) Elem() PetCreate

func (*PetCreate) Encode

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

Encode implements json.Marshaler.

func (*PetCreate) GetBirthday

func (s *PetCreate) GetBirthday() OptDateTime

GetBirthday returns the value of Birthday.

func (*PetCreate) GetCategories

func (s *PetCreate) GetCategories() []PetCreateCategories

GetCategories returns the value of Categories.

func (*PetCreate) GetID

func (s *PetCreate) GetID() int

GetID returns the value of ID.

func (*PetCreate) GetName

func (s *PetCreate) GetName() string

GetName returns the value of Name.

func (*PetCreate) GetOwner

func (s *PetCreate) GetOwner() PetCreateOwner

GetOwner returns the value of Owner.

func (*PetCreate) GetWeight

func (s *PetCreate) GetWeight() OptInt

GetWeight returns the value of Weight.

func (*PetCreate) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (*PetCreate) SetBirthday

func (s *PetCreate) SetBirthday(val OptDateTime)

SetBirthday sets the value of Birthday.

func (*PetCreate) SetCategories

func (s *PetCreate) SetCategories(val []PetCreateCategories)

SetCategories sets the value of Categories.

func (*PetCreate) SetID

func (s *PetCreate) SetID(val int)

SetID sets the value of ID.

func (*PetCreate) SetName

func (s *PetCreate) SetName(val string)

SetName sets the value of Name.

func (*PetCreate) SetOwner

func (s *PetCreate) SetOwner(val PetCreateOwner)

SetOwner sets the value of Owner.

func (*PetCreate) SetWeight

func (s *PetCreate) SetWeight(val OptInt)

SetWeight sets the value of Weight.

func (*PetCreate) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

type PetCreateCategories

type PetCreateCategories struct {
	ID   int    `json:"id"`
	Name string `json:"name"`
}

Ref: #/components/schemas/PetCreate_Categories

func NewPetCreateCategories

func NewPetCreateCategories(e *ent.Category) *PetCreateCategories

func NewPetCreateCategoriesSlice

func NewPetCreateCategoriesSlice(es []*ent.Category) []PetCreateCategories

func (*PetCreateCategories) Decode

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

Decode decodes PetCreateCategories from json.

func (*PetCreateCategories) Elem

func (*PetCreateCategories) Encode

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

Encode implements json.Marshaler.

func (*PetCreateCategories) GetID

func (s *PetCreateCategories) GetID() int

GetID returns the value of ID.

func (*PetCreateCategories) GetName

func (s *PetCreateCategories) GetName() string

GetName returns the value of Name.

func (*PetCreateCategories) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (*PetCreateCategories) SetID

func (s *PetCreateCategories) SetID(val int)

SetID sets the value of ID.

func (*PetCreateCategories) SetName

func (s *PetCreateCategories) SetName(val string)

SetName sets the value of Name.

func (*PetCreateCategories) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

type PetCreateOwner

type PetCreateOwner struct {
	ID   int    `json:"id"`
	Name string `json:"name"`
	Age  int    `json:"age"`
}

Ref: #/components/schemas/PetCreate_Owner

func NewPetCreateOwner

func NewPetCreateOwner(e *ent.User) *PetCreateOwner

func NewPetCreateOwners

func NewPetCreateOwners(es []*ent.User) []PetCreateOwner

func (*PetCreateOwner) Decode

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

Decode decodes PetCreateOwner from json.

func (*PetCreateOwner) Elem

func (u *PetCreateOwner) Elem() PetCreateOwner

func (*PetCreateOwner) Encode

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

Encode implements json.Marshaler.

func (*PetCreateOwner) GetAge

func (s *PetCreateOwner) GetAge() int

GetAge returns the value of Age.

func (*PetCreateOwner) GetID

func (s *PetCreateOwner) GetID() int

GetID returns the value of ID.

func (*PetCreateOwner) GetName

func (s *PetCreateOwner) GetName() string

GetName returns the value of Name.

func (*PetCreateOwner) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (*PetCreateOwner) SetAge

func (s *PetCreateOwner) SetAge(val int)

SetAge sets the value of Age.

func (*PetCreateOwner) SetID

func (s *PetCreateOwner) SetID(val int)

SetID sets the value of ID.

func (*PetCreateOwner) SetName

func (s *PetCreateOwner) SetName(val string)

SetName sets the value of Name.

func (*PetCreateOwner) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

type PetFriendsList

type PetFriendsList struct {
	ID       int         `json:"id"`
	Name     string      `json:"name"`
	Weight   OptInt      `json:"weight"`
	Birthday OptDateTime `json:"birthday"`
}

Ref: #/components/schemas/Pet_FriendsList

func NewPetFriendsList

func NewPetFriendsList(e *ent.Pet) *PetFriendsList

func NewPetFriendsLists

func NewPetFriendsLists(es []*ent.Pet) []PetFriendsList

func (*PetFriendsList) Decode

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

Decode decodes PetFriendsList from json.

func (*PetFriendsList) Elem

func (pe *PetFriendsList) Elem() PetFriendsList

func (*PetFriendsList) Encode

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

Encode implements json.Marshaler.

func (*PetFriendsList) GetBirthday

func (s *PetFriendsList) GetBirthday() OptDateTime

GetBirthday returns the value of Birthday.

func (*PetFriendsList) GetID

func (s *PetFriendsList) GetID() int

GetID returns the value of ID.

func (*PetFriendsList) GetName

func (s *PetFriendsList) GetName() string

GetName returns the value of Name.

func (*PetFriendsList) GetWeight

func (s *PetFriendsList) GetWeight() OptInt

GetWeight returns the value of Weight.

func (*PetFriendsList) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (*PetFriendsList) SetBirthday

func (s *PetFriendsList) SetBirthday(val OptDateTime)

SetBirthday sets the value of Birthday.

func (*PetFriendsList) SetID

func (s *PetFriendsList) SetID(val int)

SetID sets the value of ID.

func (*PetFriendsList) SetName

func (s *PetFriendsList) SetName(val string)

SetName sets the value of Name.

func (*PetFriendsList) SetWeight

func (s *PetFriendsList) SetWeight(val OptInt)

SetWeight sets the value of Weight.

func (*PetFriendsList) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

type PetList

type PetList struct {
	ID       int         `json:"id"`
	Name     string      `json:"name"`
	Weight   OptInt      `json:"weight"`
	Birthday OptDateTime `json:"birthday"`
}

Ref: #/components/schemas/PetList

func NewPetList

func NewPetList(e *ent.Pet) *PetList

func NewPetLists

func NewPetLists(es []*ent.Pet) []PetList

func (*PetList) Decode

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

Decode decodes PetList from json.

func (*PetList) Elem

func (pe *PetList) Elem() PetList

func (*PetList) Encode

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

Encode implements json.Marshaler.

func (*PetList) GetBirthday

func (s *PetList) GetBirthday() OptDateTime

GetBirthday returns the value of Birthday.

func (*PetList) GetID

func (s *PetList) GetID() int

GetID returns the value of ID.

func (*PetList) GetName

func (s *PetList) GetName() string

GetName returns the value of Name.

func (*PetList) GetWeight

func (s *PetList) GetWeight() OptInt

GetWeight returns the value of Weight.

func (*PetList) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (*PetList) SetBirthday

func (s *PetList) SetBirthday(val OptDateTime)

SetBirthday sets the value of Birthday.

func (*PetList) SetID

func (s *PetList) SetID(val int)

SetID sets the value of ID.

func (*PetList) SetName

func (s *PetList) SetName(val string)

SetName sets the value of Name.

func (*PetList) SetWeight

func (s *PetList) SetWeight(val OptInt)

SetWeight sets the value of Weight.

func (*PetList) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

type PetOwnerRead

type PetOwnerRead struct {
	ID   int    `json:"id"`
	Name string `json:"name"`
	Age  int    `json:"age"`
}

Ref: #/components/schemas/Pet_OwnerRead

func NewPetOwnerRead

func NewPetOwnerRead(e *ent.User) *PetOwnerRead

func NewPetOwnerReads

func NewPetOwnerReads(es []*ent.User) []PetOwnerRead

func (*PetOwnerRead) Decode

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

Decode decodes PetOwnerRead from json.

func (*PetOwnerRead) Elem

func (u *PetOwnerRead) Elem() PetOwnerRead

func (*PetOwnerRead) Encode

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

Encode implements json.Marshaler.

func (*PetOwnerRead) GetAge

func (s *PetOwnerRead) GetAge() int

GetAge returns the value of Age.

func (*PetOwnerRead) GetID

func (s *PetOwnerRead) GetID() int

GetID returns the value of ID.

func (*PetOwnerRead) GetName

func (s *PetOwnerRead) GetName() string

GetName returns the value of Name.

func (*PetOwnerRead) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (*PetOwnerRead) SetAge

func (s *PetOwnerRead) SetAge(val int)

SetAge sets the value of Age.

func (*PetOwnerRead) SetID

func (s *PetOwnerRead) SetID(val int)

SetID sets the value of ID.

func (*PetOwnerRead) SetName

func (s *PetOwnerRead) SetName(val string)

SetName sets the value of Name.

func (*PetOwnerRead) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

type PetRead

type PetRead struct {
	ID       int         `json:"id"`
	Name     string      `json:"name"`
	Weight   OptInt      `json:"weight"`
	Birthday OptDateTime `json:"birthday"`
}

Ref: #/components/schemas/PetRead

func NewPetRead

func NewPetRead(e *ent.Pet) *PetRead

func NewPetReads

func NewPetReads(es []*ent.Pet) []PetRead

func (*PetRead) Decode

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

Decode decodes PetRead from json.

func (*PetRead) Elem

func (pe *PetRead) Elem() PetRead

func (*PetRead) Encode

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

Encode implements json.Marshaler.

func (*PetRead) GetBirthday

func (s *PetRead) GetBirthday() OptDateTime

GetBirthday returns the value of Birthday.

func (*PetRead) GetID

func (s *PetRead) GetID() int

GetID returns the value of ID.

func (*PetRead) GetName

func (s *PetRead) GetName() string

GetName returns the value of Name.

func (*PetRead) GetWeight

func (s *PetRead) GetWeight() OptInt

GetWeight returns the value of Weight.

func (*PetRead) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (*PetRead) SetBirthday

func (s *PetRead) SetBirthday(val OptDateTime)

SetBirthday sets the value of Birthday.

func (*PetRead) SetID

func (s *PetRead) SetID(val int)

SetID sets the value of ID.

func (*PetRead) SetName

func (s *PetRead) SetName(val string)

SetName sets the value of Name.

func (*PetRead) SetWeight

func (s *PetRead) SetWeight(val OptInt)

SetWeight sets the value of Weight.

func (*PetRead) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

type PetUpdate

type PetUpdate struct {
	ID       int         `json:"id"`
	Name     string      `json:"name"`
	Weight   OptInt      `json:"weight"`
	Birthday OptDateTime `json:"birthday"`
}

Ref: #/components/schemas/PetUpdate

func NewPetUpdate

func NewPetUpdate(e *ent.Pet) *PetUpdate

func NewPetUpdates

func NewPetUpdates(es []*ent.Pet) []PetUpdate

func (*PetUpdate) Decode

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

Decode decodes PetUpdate from json.

func (*PetUpdate) Elem

func (pe *PetUpdate) Elem() PetUpdate

func (*PetUpdate) Encode

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

Encode implements json.Marshaler.

func (*PetUpdate) GetBirthday

func (s *PetUpdate) GetBirthday() OptDateTime

GetBirthday returns the value of Birthday.

func (*PetUpdate) GetID

func (s *PetUpdate) GetID() int

GetID returns the value of ID.

func (*PetUpdate) GetName

func (s *PetUpdate) GetName() string

GetName returns the value of Name.

func (*PetUpdate) GetWeight

func (s *PetUpdate) GetWeight() OptInt

GetWeight returns the value of Weight.

func (*PetUpdate) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (*PetUpdate) SetBirthday

func (s *PetUpdate) SetBirthday(val OptDateTime)

SetBirthday sets the value of Birthday.

func (*PetUpdate) SetID

func (s *PetUpdate) SetID(val int)

SetID sets the value of ID.

func (*PetUpdate) SetName

func (s *PetUpdate) SetName(val string)

SetName sets the value of Name.

func (*PetUpdate) SetWeight

func (s *PetUpdate) SetWeight(val OptInt)

SetWeight sets the value of Weight.

func (*PetUpdate) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

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 ReadCategoryParams

type ReadCategoryParams struct {
	// ID of the Category.
	ID int
}

ReadCategoryParams is parameters of readCategory operation.

type ReadCategoryRes

type ReadCategoryRes interface {
	// contains filtered or unexported methods
}

type ReadPetOwnerParams

type ReadPetOwnerParams struct {
	// ID of the Pet.
	ID int
}

ReadPetOwnerParams is parameters of readPetOwner operation.

type ReadPetOwnerRes

type ReadPetOwnerRes interface {
	// contains filtered or unexported methods
}

type ReadPetParams

type ReadPetParams struct {
	// ID of the Pet.
	ID int
}

ReadPetParams is parameters of readPet operation.

type ReadPetRes

type ReadPetRes interface {
	// contains filtered or unexported methods
}

type ReadUserParams

type ReadUserParams struct {
	// ID of the User.
	ID int
}

ReadUserParams is parameters of readUser operation.

type ReadUserRes

type ReadUserRes 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 UnimplementedHandler

type UnimplementedHandler struct{}

UnimplementedHandler is no-op Handler which returns http.ErrNotImplemented.

func (UnimplementedHandler) CreateCategory

CreateCategory implements createCategory operation.

Creates a new Category and persists it to storage.

POST /categories

func (UnimplementedHandler) CreatePet

func (UnimplementedHandler) CreatePet(ctx context.Context, req *CreatePetReq) (r CreatePetRes, _ error)

CreatePet implements createPet operation.

Creates a new Pet and persists it to storage.

POST /pets

func (UnimplementedHandler) CreateUser

CreateUser implements createUser operation.

Creates a new User and persists it to storage.

POST /users

func (UnimplementedHandler) DBHealth

func (UnimplementedHandler) DBHealth(ctx context.Context) (r DBHealthRes, _ error)

DBHealth implements DBHealth operation.

Ping the database and report.

GET /db-health

func (UnimplementedHandler) DeleteCategory

DeleteCategory implements deleteCategory operation.

Deletes the Category with the requested ID.

DELETE /categories/{id}

func (UnimplementedHandler) DeletePet

func (UnimplementedHandler) DeletePet(ctx context.Context, params DeletePetParams) (r DeletePetRes, _ error)

DeletePet implements deletePet operation.

Deletes the Pet with the requested ID.

DELETE /pets/{id}

func (UnimplementedHandler) DeleteUser

DeleteUser implements deleteUser operation.

Deletes the User with the requested ID.

DELETE /users/{id}

func (UnimplementedHandler) ListCategory

ListCategory implements listCategory operation.

List Categories.

GET /categories

func (UnimplementedHandler) ListCategoryPets

ListCategoryPets implements listCategoryPets operation.

List attached Pets.

GET /categories/{id}/pets

func (UnimplementedHandler) ListPet

func (UnimplementedHandler) ListPet(ctx context.Context, params ListPetParams) (r ListPetRes, _ error)

ListPet implements listPet operation.

List Pets.

GET /pets

func (UnimplementedHandler) ListPetCategories

ListPetCategories implements listPetCategories operation.

List attached Categories.

GET /pets/{id}/categories

func (UnimplementedHandler) ListPetFriends

ListPetFriends implements listPetFriends operation.

List attached Friends.

GET /pets/{id}/friends

func (UnimplementedHandler) ListUser

func (UnimplementedHandler) ListUser(ctx context.Context, params ListUserParams) (r ListUserRes, _ error)

ListUser implements listUser operation.

List Users.

GET /users

func (UnimplementedHandler) ListUserPets

ListUserPets implements listUserPets operation.

List attached Pets.

GET /users/{id}/pets

func (UnimplementedHandler) ReadCategory

ReadCategory implements readCategory operation.

Finds the Category with the requested ID and returns it.

GET /categories/{id}

func (UnimplementedHandler) ReadPet

func (UnimplementedHandler) ReadPet(ctx context.Context, params ReadPetParams) (r ReadPetRes, _ error)

ReadPet implements readPet operation.

Finds the Pet with the requested ID and returns it.

GET /pets/{id}

func (UnimplementedHandler) ReadPetOwner

ReadPetOwner implements readPetOwner operation.

Find the attached User of the Pet with the given ID.

GET /pets/{id}/owner

func (UnimplementedHandler) ReadUser

func (UnimplementedHandler) ReadUser(ctx context.Context, params ReadUserParams) (r ReadUserRes, _ error)

ReadUser implements readUser operation.

Finds the User with the requested ID and returns it.

GET /users/{id}

func (UnimplementedHandler) UpdateCategory

UpdateCategory implements updateCategory operation.

Updates a Category and persists changes to storage.

PATCH /categories/{id}

func (UnimplementedHandler) UpdatePet

UpdatePet implements updatePet operation.

Updates a Pet and persists changes to storage.

PATCH /pets/{id}

func (UnimplementedHandler) UpdateUser

UpdateUser implements updateUser operation.

Updates a User and persists changes to storage.

PATCH /users/{id}

type UpdateCategoryParams

type UpdateCategoryParams struct {
	// ID of the Category.
	ID int
}

UpdateCategoryParams is parameters of updateCategory operation.

type UpdateCategoryReq

type UpdateCategoryReq struct {
	Name OptString `json:"name"`
	Pets []int     `json:"pets"`
}

func (*UpdateCategoryReq) Decode

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

Decode decodes UpdateCategoryReq from json.

func (*UpdateCategoryReq) Encode

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

Encode implements json.Marshaler.

func (*UpdateCategoryReq) GetName

func (s *UpdateCategoryReq) GetName() OptString

GetName returns the value of Name.

func (*UpdateCategoryReq) GetPets

func (s *UpdateCategoryReq) GetPets() []int

GetPets returns the value of Pets.

func (*UpdateCategoryReq) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (*UpdateCategoryReq) SetName

func (s *UpdateCategoryReq) SetName(val OptString)

SetName sets the value of Name.

func (*UpdateCategoryReq) SetPets

func (s *UpdateCategoryReq) SetPets(val []int)

SetPets sets the value of Pets.

func (*UpdateCategoryReq) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

type UpdateCategoryRes

type UpdateCategoryRes interface {
	// contains filtered or unexported methods
}

type UpdatePetParams

type UpdatePetParams struct {
	// ID of the Pet.
	ID int
}

UpdatePetParams is parameters of updatePet operation.

type UpdatePetReq

type UpdatePetReq struct {
	Name       OptString   `json:"name"`
	Weight     OptInt      `json:"weight"`
	Birthday   OptDateTime `json:"birthday"`
	Categories []int       `json:"categories"`
	Owner      OptInt      `json:"owner"`
	Friends    []int       `json:"friends"`
}

func (*UpdatePetReq) Decode

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

Decode decodes UpdatePetReq from json.

func (*UpdatePetReq) Encode

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

Encode implements json.Marshaler.

func (*UpdatePetReq) GetBirthday

func (s *UpdatePetReq) GetBirthday() OptDateTime

GetBirthday returns the value of Birthday.

func (*UpdatePetReq) GetCategories

func (s *UpdatePetReq) GetCategories() []int

GetCategories returns the value of Categories.

func (*UpdatePetReq) GetFriends

func (s *UpdatePetReq) GetFriends() []int

GetFriends returns the value of Friends.

func (*UpdatePetReq) GetName

func (s *UpdatePetReq) GetName() OptString

GetName returns the value of Name.

func (*UpdatePetReq) GetOwner

func (s *UpdatePetReq) GetOwner() OptInt

GetOwner returns the value of Owner.

func (*UpdatePetReq) GetWeight

func (s *UpdatePetReq) GetWeight() OptInt

GetWeight returns the value of Weight.

func (*UpdatePetReq) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (*UpdatePetReq) SetBirthday

func (s *UpdatePetReq) SetBirthday(val OptDateTime)

SetBirthday sets the value of Birthday.

func (*UpdatePetReq) SetCategories

func (s *UpdatePetReq) SetCategories(val []int)

SetCategories sets the value of Categories.

func (*UpdatePetReq) SetFriends

func (s *UpdatePetReq) SetFriends(val []int)

SetFriends sets the value of Friends.

func (*UpdatePetReq) SetName

func (s *UpdatePetReq) SetName(val OptString)

SetName sets the value of Name.

func (*UpdatePetReq) SetOwner

func (s *UpdatePetReq) SetOwner(val OptInt)

SetOwner sets the value of Owner.

func (*UpdatePetReq) SetWeight

func (s *UpdatePetReq) SetWeight(val OptInt)

SetWeight sets the value of Weight.

func (*UpdatePetReq) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

type UpdatePetRes

type UpdatePetRes interface {
	// contains filtered or unexported methods
}

type UpdateUserParams

type UpdateUserParams struct {
	// ID of the User.
	ID int
}

UpdateUserParams is parameters of updateUser operation.

type UpdateUserReq

type UpdateUserReq struct {
	Name OptString `json:"name"`
	Age  OptInt    `json:"age"`
	Pets []int     `json:"pets"`
}

func (*UpdateUserReq) Decode

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

Decode decodes UpdateUserReq from json.

func (*UpdateUserReq) Encode

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

Encode implements json.Marshaler.

func (*UpdateUserReq) GetAge

func (s *UpdateUserReq) GetAge() OptInt

GetAge returns the value of Age.

func (*UpdateUserReq) GetName

func (s *UpdateUserReq) GetName() OptString

GetName returns the value of Name.

func (*UpdateUserReq) GetPets

func (s *UpdateUserReq) GetPets() []int

GetPets returns the value of Pets.

func (*UpdateUserReq) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (*UpdateUserReq) SetAge

func (s *UpdateUserReq) SetAge(val OptInt)

SetAge sets the value of Age.

func (*UpdateUserReq) SetName

func (s *UpdateUserReq) SetName(val OptString)

SetName sets the value of Name.

func (*UpdateUserReq) SetPets

func (s *UpdateUserReq) SetPets(val []int)

SetPets sets the value of Pets.

func (*UpdateUserReq) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

type UpdateUserRes

type UpdateUserRes interface {
	// contains filtered or unexported methods
}

type UserCreate

type UserCreate struct {
	ID   int    `json:"id"`
	Name string `json:"name"`
	Age  int    `json:"age"`
}

Ref: #/components/schemas/UserCreate

func NewUserCreate

func NewUserCreate(e *ent.User) *UserCreate

func NewUserCreates

func NewUserCreates(es []*ent.User) []UserCreate

func (*UserCreate) Decode

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

Decode decodes UserCreate from json.

func (*UserCreate) Elem

func (u *UserCreate) Elem() UserCreate

func (*UserCreate) Encode

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

Encode implements json.Marshaler.

func (*UserCreate) GetAge

func (s *UserCreate) GetAge() int

GetAge returns the value of Age.

func (*UserCreate) GetID

func (s *UserCreate) GetID() int

GetID returns the value of ID.

func (*UserCreate) GetName

func (s *UserCreate) GetName() string

GetName returns the value of Name.

func (*UserCreate) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (*UserCreate) SetAge

func (s *UserCreate) SetAge(val int)

SetAge sets the value of Age.

func (*UserCreate) SetID

func (s *UserCreate) SetID(val int)

SetID sets the value of ID.

func (*UserCreate) SetName

func (s *UserCreate) SetName(val string)

SetName sets the value of Name.

func (*UserCreate) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

type UserList

type UserList struct {
	ID   int    `json:"id"`
	Name string `json:"name"`
	Age  int    `json:"age"`
}

Ref: #/components/schemas/UserList

func NewUserList

func NewUserList(e *ent.User) *UserList

func NewUserLists

func NewUserLists(es []*ent.User) []UserList

func (*UserList) Decode

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

Decode decodes UserList from json.

func (*UserList) Elem

func (u *UserList) Elem() UserList

func (*UserList) Encode

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

Encode implements json.Marshaler.

func (*UserList) GetAge

func (s *UserList) GetAge() int

GetAge returns the value of Age.

func (*UserList) GetID

func (s *UserList) GetID() int

GetID returns the value of ID.

func (*UserList) GetName

func (s *UserList) GetName() string

GetName returns the value of Name.

func (*UserList) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (*UserList) SetAge

func (s *UserList) SetAge(val int)

SetAge sets the value of Age.

func (*UserList) SetID

func (s *UserList) SetID(val int)

SetID sets the value of ID.

func (*UserList) SetName

func (s *UserList) SetName(val string)

SetName sets the value of Name.

func (*UserList) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

type UserPetsList

type UserPetsList struct {
	ID       int         `json:"id"`
	Name     string      `json:"name"`
	Weight   OptInt      `json:"weight"`
	Birthday OptDateTime `json:"birthday"`
}

Ref: #/components/schemas/User_PetsList

func NewUserPetsList

func NewUserPetsList(e *ent.Pet) *UserPetsList

func NewUserPetsLists

func NewUserPetsLists(es []*ent.Pet) []UserPetsList

func (*UserPetsList) Decode

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

Decode decodes UserPetsList from json.

func (*UserPetsList) Elem

func (pe *UserPetsList) Elem() UserPetsList

func (*UserPetsList) Encode

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

Encode implements json.Marshaler.

func (*UserPetsList) GetBirthday

func (s *UserPetsList) GetBirthday() OptDateTime

GetBirthday returns the value of Birthday.

func (*UserPetsList) GetID

func (s *UserPetsList) GetID() int

GetID returns the value of ID.

func (*UserPetsList) GetName

func (s *UserPetsList) GetName() string

GetName returns the value of Name.

func (*UserPetsList) GetWeight

func (s *UserPetsList) GetWeight() OptInt

GetWeight returns the value of Weight.

func (*UserPetsList) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (*UserPetsList) SetBirthday

func (s *UserPetsList) SetBirthday(val OptDateTime)

SetBirthday sets the value of Birthday.

func (*UserPetsList) SetID

func (s *UserPetsList) SetID(val int)

SetID sets the value of ID.

func (*UserPetsList) SetName

func (s *UserPetsList) SetName(val string)

SetName sets the value of Name.

func (*UserPetsList) SetWeight

func (s *UserPetsList) SetWeight(val OptInt)

SetWeight sets the value of Weight.

func (*UserPetsList) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

type UserRead

type UserRead struct {
	ID   int    `json:"id"`
	Name string `json:"name"`
	Age  int    `json:"age"`
}

Ref: #/components/schemas/UserRead

func NewUserRead

func NewUserRead(e *ent.User) *UserRead

func NewUserReads

func NewUserReads(es []*ent.User) []UserRead

func (*UserRead) Decode

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

Decode decodes UserRead from json.

func (*UserRead) Elem

func (u *UserRead) Elem() UserRead

func (*UserRead) Encode

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

Encode implements json.Marshaler.

func (*UserRead) GetAge

func (s *UserRead) GetAge() int

GetAge returns the value of Age.

func (*UserRead) GetID

func (s *UserRead) GetID() int

GetID returns the value of ID.

func (*UserRead) GetName

func (s *UserRead) GetName() string

GetName returns the value of Name.

func (*UserRead) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (*UserRead) SetAge

func (s *UserRead) SetAge(val int)

SetAge sets the value of Age.

func (*UserRead) SetID

func (s *UserRead) SetID(val int)

SetID sets the value of ID.

func (*UserRead) SetName

func (s *UserRead) SetName(val string)

SetName sets the value of Name.

func (*UserRead) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

type UserUpdate

type UserUpdate struct {
	ID   int    `json:"id"`
	Name string `json:"name"`
	Age  int    `json:"age"`
}

Ref: #/components/schemas/UserUpdate

func NewUserUpdate

func NewUserUpdate(e *ent.User) *UserUpdate

func NewUserUpdates

func NewUserUpdates(es []*ent.User) []UserUpdate

func (*UserUpdate) Decode

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

Decode decodes UserUpdate from json.

func (*UserUpdate) Elem

func (u *UserUpdate) Elem() UserUpdate

func (*UserUpdate) Encode

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

Encode implements json.Marshaler.

func (*UserUpdate) GetAge

func (s *UserUpdate) GetAge() int

GetAge returns the value of Age.

func (*UserUpdate) GetID

func (s *UserUpdate) GetID() int

GetID returns the value of ID.

func (*UserUpdate) GetName

func (s *UserUpdate) GetName() string

GetName returns the value of Name.

func (*UserUpdate) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (*UserUpdate) SetAge

func (s *UserUpdate) SetAge(val int)

SetAge sets the value of Age.

func (*UserUpdate) SetID

func (s *UserUpdate) SetID(val int)

SetID sets the value of ID.

func (*UserUpdate) SetName

func (s *UserUpdate) SetName(val string)

SetName sets the value of Name.

func (*UserUpdate) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

Jump to

Keyboard shortcuts

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