api

package
v0.0.0-...-2c50256 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2024 License: Apache-2.0 Imports: 27 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) 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) CreatePetCategories

func (c *Client) CreatePetCategories(ctx context.Context, request *CreatePetCategoriesReq, params CreatePetCategoriesParams) (CreatePetCategoriesRes, error)

CreatePetCategories invokes createPetCategories operation.

Creates a new Category and attaches it to the Pet.

POST /pets/{id}/categories

func (*Client) CreatePetFriends

func (c *Client) CreatePetFriends(ctx context.Context, request *CreatePetFriendsReq, params CreatePetFriendsParams) (CreatePetFriendsRes, error)

CreatePetFriends invokes createPetFriends operation.

Creates a new Pet and attaches it to the Pet.

POST /pets/{id}/friends

func (*Client) CreatePetOwner

func (c *Client) CreatePetOwner(ctx context.Context, request *CreatePetOwnerReq, params CreatePetOwnerParams) (CreatePetOwnerRes, error)

CreatePetOwner invokes createPetOwner operation.

Creates a new User and attaches it to the Pet.

POST /pets/{id}/owner

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

func (c *Client) DeletePetOwner(ctx context.Context, params DeletePetOwnerParams) (DeletePetOwnerRes, error)

DeletePetOwner invokes deletePetOwner operation.

Delete the attached Owner of the Pet with the given ID.

DELETE /pets/{id}/owner

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

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 CreatePetCategoriesParams

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

CreatePetCategoriesParams is parameters of createPetCategories operation.

type CreatePetCategoriesReq

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

func (*CreatePetCategoriesReq) Decode

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

Decode decodes CreatePetCategoriesReq from json.

func (*CreatePetCategoriesReq) Encode

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

Encode implements json.Marshaler.

func (*CreatePetCategoriesReq) GetName

func (s *CreatePetCategoriesReq) GetName() string

GetName returns the value of Name.

func (*CreatePetCategoriesReq) GetPets

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

GetPets returns the value of Pets.

func (*CreatePetCategoriesReq) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (*CreatePetCategoriesReq) SetFake

func (s *CreatePetCategoriesReq) SetFake()

SetFake set fake values.

func (*CreatePetCategoriesReq) SetName

func (s *CreatePetCategoriesReq) SetName(val string)

SetName sets the value of Name.

func (*CreatePetCategoriesReq) SetPets

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

SetPets sets the value of Pets.

func (*CreatePetCategoriesReq) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

type CreatePetCategoriesRes

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

type CreatePetFriendsParams

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

CreatePetFriendsParams is parameters of createPetFriends operation.

type CreatePetFriendsReq

type CreatePetFriendsReq 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 (*CreatePetFriendsReq) Decode

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

Decode decodes CreatePetFriendsReq from json.

func (*CreatePetFriendsReq) Encode

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

Encode implements json.Marshaler.

func (*CreatePetFriendsReq) GetBirthday

func (s *CreatePetFriendsReq) GetBirthday() OptDateTime

GetBirthday returns the value of Birthday.

func (*CreatePetFriendsReq) GetCategories

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

GetCategories returns the value of Categories.

func (*CreatePetFriendsReq) GetFriends

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

GetFriends returns the value of Friends.

func (*CreatePetFriendsReq) GetName

func (s *CreatePetFriendsReq) GetName() string

GetName returns the value of Name.

func (*CreatePetFriendsReq) GetOwner

func (s *CreatePetFriendsReq) GetOwner() int

GetOwner returns the value of Owner.

func (*CreatePetFriendsReq) GetWeight

func (s *CreatePetFriendsReq) GetWeight() OptInt

GetWeight returns the value of Weight.

func (*CreatePetFriendsReq) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (*CreatePetFriendsReq) SetBirthday

func (s *CreatePetFriendsReq) SetBirthday(val OptDateTime)

SetBirthday sets the value of Birthday.

func (*CreatePetFriendsReq) SetCategories

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

SetCategories sets the value of Categories.

func (*CreatePetFriendsReq) SetFake

func (s *CreatePetFriendsReq) SetFake()

SetFake set fake values.

func (*CreatePetFriendsReq) SetFriends

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

SetFriends sets the value of Friends.

func (*CreatePetFriendsReq) SetName

func (s *CreatePetFriendsReq) SetName(val string)

SetName sets the value of Name.

func (*CreatePetFriendsReq) SetOwner

func (s *CreatePetFriendsReq) SetOwner(val int)

SetOwner sets the value of Owner.

func (*CreatePetFriendsReq) SetWeight

func (s *CreatePetFriendsReq) SetWeight(val OptInt)

SetWeight sets the value of Weight.

func (*CreatePetFriendsReq) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

type CreatePetFriendsRes

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

type CreatePetOwnerParams

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

CreatePetOwnerParams is parameters of createPetOwner operation.

type CreatePetOwnerReq

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

func (*CreatePetOwnerReq) Decode

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

Decode decodes CreatePetOwnerReq from json.

func (*CreatePetOwnerReq) Encode

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

Encode implements json.Marshaler.

func (*CreatePetOwnerReq) GetAge

func (s *CreatePetOwnerReq) GetAge() int

GetAge returns the value of Age.

func (*CreatePetOwnerReq) GetName

func (s *CreatePetOwnerReq) GetName() string

GetName returns the value of Name.

func (*CreatePetOwnerReq) GetPets

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

GetPets returns the value of Pets.

func (*CreatePetOwnerReq) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (*CreatePetOwnerReq) SetAge

func (s *CreatePetOwnerReq) SetAge(val int)

SetAge sets the value of Age.

func (*CreatePetOwnerReq) SetFake

func (s *CreatePetOwnerReq) SetFake()

SetFake set fake values.

func (*CreatePetOwnerReq) SetName

func (s *CreatePetOwnerReq) SetName(val string)

SetName sets the value of Name.

func (*CreatePetOwnerReq) SetPets

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

SetPets sets the value of Pets.

func (*CreatePetOwnerReq) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

type CreatePetOwnerRes

type CreatePetOwnerRes 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) SetFake

func (s *CreatePetReq) SetFake()

SetFake set fake values.

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 DeletePetNoContent

type DeletePetNoContent struct{}

DeletePetNoContent is response for DeletePet operation.

type DeletePetOwnerNoContent

type DeletePetOwnerNoContent struct{}

DeletePetOwnerNoContent is response for DeletePetOwner operation.

type DeletePetOwnerParams

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

DeletePetOwnerParams is parameters of deletePetOwner operation.

type DeletePetOwnerRes

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

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 ErrorHandler

type ErrorHandler = ogenerrors.ErrorHandler

ErrorHandler is error handler.

type Handler

type Handler interface {
	// CreatePet implements createPet operation.
	//
	// Creates a new Pet and persists it to storage.
	//
	// POST /pets
	CreatePet(ctx context.Context, req *CreatePetReq) (CreatePetRes, error)
	// CreatePetCategories implements createPetCategories operation.
	//
	// Creates a new Category and attaches it to the Pet.
	//
	// POST /pets/{id}/categories
	CreatePetCategories(ctx context.Context, req *CreatePetCategoriesReq, params CreatePetCategoriesParams) (CreatePetCategoriesRes, error)
	// CreatePetFriends implements createPetFriends operation.
	//
	// Creates a new Pet and attaches it to the Pet.
	//
	// POST /pets/{id}/friends
	CreatePetFriends(ctx context.Context, req *CreatePetFriendsReq, params CreatePetFriendsParams) (CreatePetFriendsRes, error)
	// CreatePetOwner implements createPetOwner operation.
	//
	// Creates a new User and attaches it to the Pet.
	//
	// POST /pets/{id}/owner
	CreatePetOwner(ctx context.Context, req *CreatePetOwnerReq, params CreatePetOwnerParams) (CreatePetOwnerRes, error)
	// DeletePet implements deletePet operation.
	//
	// Deletes the Pet with the requested ID.
	//
	// DELETE /pets/{id}
	DeletePet(ctx context.Context, params DeletePetParams) (DeletePetRes, error)
	// DeletePetOwner implements deletePetOwner operation.
	//
	// Delete the attached Owner of the Pet with the given ID.
	//
	// DELETE /pets/{id}/owner
	DeletePetOwner(ctx context.Context, params DeletePetOwnerParams) (DeletePetOwnerRes, 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)
	// 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)
	// 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)
}

Handler handles operations described by OpenAPI v3 specification.

type Invoker

type Invoker interface {
	// CreatePet invokes createPet operation.
	//
	// Creates a new Pet and persists it to storage.
	//
	// POST /pets
	CreatePet(ctx context.Context, request *CreatePetReq) (CreatePetRes, error)
	// CreatePetCategories invokes createPetCategories operation.
	//
	// Creates a new Category and attaches it to the Pet.
	//
	// POST /pets/{id}/categories
	CreatePetCategories(ctx context.Context, request *CreatePetCategoriesReq, params CreatePetCategoriesParams) (CreatePetCategoriesRes, error)
	// CreatePetFriends invokes createPetFriends operation.
	//
	// Creates a new Pet and attaches it to the Pet.
	//
	// POST /pets/{id}/friends
	CreatePetFriends(ctx context.Context, request *CreatePetFriendsReq, params CreatePetFriendsParams) (CreatePetFriendsRes, error)
	// CreatePetOwner invokes createPetOwner operation.
	//
	// Creates a new User and attaches it to the Pet.
	//
	// POST /pets/{id}/owner
	CreatePetOwner(ctx context.Context, request *CreatePetOwnerReq, params CreatePetOwnerParams) (CreatePetOwnerRes, error)
	// DeletePet invokes deletePet operation.
	//
	// Deletes the Pet with the requested ID.
	//
	// DELETE /pets/{id}
	DeletePet(ctx context.Context, params DeletePetParams) (DeletePetRes, error)
	// DeletePetOwner invokes deletePetOwner operation.
	//
	// Delete the attached Owner of the Pet with the given ID.
	//
	// DELETE /pets/{id}/owner
	DeletePetOwner(ctx context.Context, params DeletePetOwnerParams) (DeletePetOwnerRes, error)
	// ListPet invokes listPet operation.
	//
	// List Pets.
	//
	// GET /pets
	ListPet(ctx context.Context, params ListPetParams) (ListPetRes, error)
	// ListPetCategories invokes listPetCategories operation.
	//
	// List attached Categories.
	//
	// GET /pets/{id}/categories
	ListPetCategories(ctx context.Context, params ListPetCategoriesParams) (ListPetCategoriesRes, error)
	// ListPetFriends invokes listPetFriends operation.
	//
	// List attached Friends.
	//
	// GET /pets/{id}/friends
	ListPetFriends(ctx context.Context, params ListPetFriendsParams) (ListPetFriendsRes, error)
	// ReadPet invokes readPet operation.
	//
	// Finds the Pet with the requested ID and returns it.
	//
	// GET /pets/{id}
	ReadPet(ctx context.Context, params ReadPetParams) (ReadPetRes, error)
	// ReadPetOwner invokes 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)
	// UpdatePet invokes updatePet operation.
	//
	// Updates a Pet and persists changes to storage.
	//
	// PATCH /pets/{id}
	UpdatePet(ctx context.Context, request *UpdatePetReq, params UpdatePetParams) (UpdatePetRes, error)
}

Invoker invokes operations described by OpenAPI v3 specification.

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

SetFake set fake values.

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 OptInt32
	// Item count to render per page.
	ItemsPerPage OptInt32
}

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

func (s *ListPetFriendsOKApplicationJSON) SetFake()

SetFake set fake values.

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 OptInt32
	// Item count to render per page.
	ItemsPerPage OptInt32
}

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

func (s *ListPetOKApplicationJSON) SetFake()

SetFake set fake values.

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 OptInt32
	// Item count to render per page.
	ItemsPerPage OptInt32
}

ListPetParams is parameters of listPet operation.

type ListPetRes

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

type Middleware

type Middleware = middleware.Middleware

Middleware is middleware type.

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

func (s *OptDateTime) SetFake()

SetFake set fake values.

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

func (s *OptInt) SetFake()

SetFake set fake values.

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 OptInt32

type OptInt32 struct {
	Value int32
	Set   bool
}

OptInt32 is optional int32.

func NewOptInt32

func NewOptInt32(v int32) OptInt32

NewOptInt32 returns new OptInt32 with value set to v.

func (OptInt32) Get

func (o OptInt32) Get() (v int32, ok bool)

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

func (OptInt32) IsSet

func (o OptInt32) IsSet() bool

IsSet returns true if OptInt32 was set.

func (OptInt32) Or

func (o OptInt32) Or(d int32) int32

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

func (*OptInt32) Reset

func (o *OptInt32) Reset()

Reset unsets value.

func (*OptInt32) SetTo

func (o *OptInt32) SetTo(v int32)

SetTo sets value to v.

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 PetCategoriesCreate

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

Ref: #/components/schemas/Pet_CategoriesCreate

func (*PetCategoriesCreate) Decode

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

Decode decodes PetCategoriesCreate from json.

func (*PetCategoriesCreate) Encode

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

Encode implements json.Marshaler.

func (*PetCategoriesCreate) GetID

func (s *PetCategoriesCreate) GetID() int

GetID returns the value of ID.

func (*PetCategoriesCreate) GetName

func (s *PetCategoriesCreate) GetName() string

GetName returns the value of Name.

func (*PetCategoriesCreate) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (*PetCategoriesCreate) SetFake

func (s *PetCategoriesCreate) SetFake()

SetFake set fake values.

func (*PetCategoriesCreate) SetID

func (s *PetCategoriesCreate) SetID(val int)

SetID sets the value of ID.

func (*PetCategoriesCreate) SetName

func (s *PetCategoriesCreate) SetName(val string)

SetName sets the value of Name.

func (*PetCategoriesCreate) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

type PetCategoriesList

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

Ref: #/components/schemas/Pet_CategoriesList

func (*PetCategoriesList) Decode

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

Decode decodes PetCategoriesList from json.

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

func (s *PetCategoriesList) SetFake()

SetFake set fake values.

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 (*PetCreate) Decode

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

Decode decodes PetCreate from json.

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

func (s *PetCreate) SetFake()

SetFake set fake values.

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 (*PetCreateCategories) Decode

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

Decode decodes PetCreateCategories from json.

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

func (s *PetCreateCategories) SetFake()

SetFake set fake values.

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 (*PetCreateOwner) Decode

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

Decode decodes PetCreateOwner from json.

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

func (s *PetCreateOwner) SetFake()

SetFake set fake values.

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 PetFriendsCreate

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

Ref: #/components/schemas/Pet_FriendsCreate

func (*PetFriendsCreate) Decode

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

Decode decodes PetFriendsCreate from json.

func (*PetFriendsCreate) Encode

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

Encode implements json.Marshaler.

func (*PetFriendsCreate) GetBirthday

func (s *PetFriendsCreate) GetBirthday() OptDateTime

GetBirthday returns the value of Birthday.

func (*PetFriendsCreate) GetID

func (s *PetFriendsCreate) GetID() int

GetID returns the value of ID.

func (*PetFriendsCreate) GetName

func (s *PetFriendsCreate) GetName() string

GetName returns the value of Name.

func (*PetFriendsCreate) GetWeight

func (s *PetFriendsCreate) GetWeight() OptInt

GetWeight returns the value of Weight.

func (*PetFriendsCreate) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (*PetFriendsCreate) SetBirthday

func (s *PetFriendsCreate) SetBirthday(val OptDateTime)

SetBirthday sets the value of Birthday.

func (*PetFriendsCreate) SetFake

func (s *PetFriendsCreate) SetFake()

SetFake set fake values.

func (*PetFriendsCreate) SetID

func (s *PetFriendsCreate) SetID(val int)

SetID sets the value of ID.

func (*PetFriendsCreate) SetName

func (s *PetFriendsCreate) SetName(val string)

SetName sets the value of Name.

func (*PetFriendsCreate) SetWeight

func (s *PetFriendsCreate) SetWeight(val OptInt)

SetWeight sets the value of Weight.

func (*PetFriendsCreate) UnmarshalJSON

func (s *PetFriendsCreate) 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 (*PetFriendsList) Decode

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

Decode decodes PetFriendsList from json.

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

func (s *PetFriendsList) SetFake()

SetFake set fake values.

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 (*PetList) Decode

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

Decode decodes PetList from json.

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

func (s *PetList) SetFake()

SetFake set fake values.

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 PetOwnerCreate

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

Ref: #/components/schemas/Pet_OwnerCreate

func (*PetOwnerCreate) Decode

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

Decode decodes PetOwnerCreate from json.

func (*PetOwnerCreate) Encode

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

Encode implements json.Marshaler.

func (*PetOwnerCreate) GetAge

func (s *PetOwnerCreate) GetAge() int

GetAge returns the value of Age.

func (*PetOwnerCreate) GetID

func (s *PetOwnerCreate) GetID() int

GetID returns the value of ID.

func (*PetOwnerCreate) GetName

func (s *PetOwnerCreate) GetName() string

GetName returns the value of Name.

func (*PetOwnerCreate) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (*PetOwnerCreate) SetAge

func (s *PetOwnerCreate) SetAge(val int)

SetAge sets the value of Age.

func (*PetOwnerCreate) SetFake

func (s *PetOwnerCreate) SetFake()

SetFake set fake values.

func (*PetOwnerCreate) SetID

func (s *PetOwnerCreate) SetID(val int)

SetID sets the value of ID.

func (*PetOwnerCreate) SetName

func (s *PetOwnerCreate) SetName(val string)

SetName sets the value of Name.

func (*PetOwnerCreate) UnmarshalJSON

func (s *PetOwnerCreate) 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 (*PetOwnerRead) Decode

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

Decode decodes PetOwnerRead from json.

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

func (s *PetOwnerRead) SetFake()

SetFake set fake values.

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 (*PetRead) Decode

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

Decode decodes PetRead from json.

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

func (s *PetRead) SetFake()

SetFake set fake values.

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 (*PetUpdate) Decode

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

Decode decodes PetUpdate from json.

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

func (s *PetUpdate) SetFake()

SetFake set fake values.

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"`
}

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

func (s *R400) SetFake()

SetFake set fake values.

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"`
}

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

func (s *R404) SetFake()

SetFake set fake values.

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"`
}

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

func (s *R409) SetFake()

SetFake set fake values.

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"`
}

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

func (s *R500) SetFake()

SetFake set fake values.

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

func (Route) Summary

func (r Route) Summary() string

Summary returns OpenAPI summary.

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

CreatePetCategories implements createPetCategories operation.

Creates a new Category and attaches it to the Pet.

POST /pets/{id}/categories

func (UnimplementedHandler) CreatePetFriends

CreatePetFriends implements createPetFriends operation.

Creates a new Pet and attaches it to the Pet.

POST /pets/{id}/friends

func (UnimplementedHandler) CreatePetOwner

CreatePetOwner implements createPetOwner operation.

Creates a new User and attaches it to the Pet.

POST /pets/{id}/owner

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

DeletePetOwner implements deletePetOwner operation.

Delete the attached Owner of the Pet with the given ID.

DELETE /pets/{id}/owner

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

UpdatePet implements updatePet operation.

Updates a Pet and persists changes to storage.

PATCH /pets/{id}

type UpdatePetParams

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

UpdatePetParams is parameters of updatePet operation.

type UpdatePetReq

type UpdatePetReq 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 (*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() string

GetName returns the value of Name.

func (*UpdatePetReq) GetOwner

func (s *UpdatePetReq) GetOwner() int

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

func (s *UpdatePetReq) SetFake()

SetFake set fake values.

func (*UpdatePetReq) SetFriends

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

SetFriends sets the value of Friends.

func (*UpdatePetReq) SetName

func (s *UpdatePetReq) SetName(val string)

SetName sets the value of Name.

func (*UpdatePetReq) SetOwner

func (s *UpdatePetReq) SetOwner(val int)

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
}

Jump to

Keyboard shortcuts

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