api

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Dec 28, 2021 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Overview

Code generated by ogen, DO NOT EDIT.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client implements OAS client.

func NewClient

func NewClient(serverURL string, opts ...Option) (*Client, error)

NewClient initializes new Client defined by OAS.

func (*Client) ErrorGet

func (c *Client) ErrorGet(ctx context.Context) (res ErrorStatusCode, err error)

ErrorGet invokes errorGet operation.

GET /error

func (*Client) FoobarGet

func (c *Client) FoobarGet(ctx context.Context, params FoobarGetParams) (res FoobarGetRes, err error)

FoobarGet invokes foobarGet operation.

GET /foobar

func (*Client) FoobarPost

func (c *Client) FoobarPost(ctx context.Context, request OptPet) (res FoobarPostRes, err error)

FoobarPost invokes foobarPost operation.

POST /foobar

func (*Client) FoobarPut

func (c *Client) FoobarPut(ctx context.Context) (res FoobarPutDefStatusCode, err error)

FoobarPut invokes operation.

PUT /foobar

func (*Client) GetHeader

func (c *Client) GetHeader(ctx context.Context, params GetHeaderParams) (res Hash, err error)

GetHeader invokes getHeader operation.

GET /test/header

func (*Client) PetCreate

func (c *Client) PetCreate(ctx context.Context, request OptPet) (res Pet, err error)

PetCreate invokes petCreate operation.

POST /pet

func (*Client) PetFriendsNamesByID

func (c *Client) PetFriendsNamesByID(ctx context.Context, params PetFriendsNamesByIDParams) (res []string, err error)

PetFriendsNamesByID invokes petFriendsNamesByID operation.

GET /pet/friendNames/{id}

func (*Client) PetGet

func (c *Client) PetGet(ctx context.Context, params PetGetParams) (res PetGetRes, err error)

PetGet invokes petGet operation.

GET /pet

func (*Client) PetGetAvatarByID

func (c *Client) PetGetAvatarByID(ctx context.Context, params PetGetAvatarByIDParams) (res PetGetAvatarByIDRes, err error)

PetGetAvatarByID invokes petGetAvatarByID operation.

GET /pet/avatar

func (*Client) PetGetByName

func (c *Client) PetGetByName(ctx context.Context, params PetGetByNameParams) (res Pet, err error)

PetGetByName invokes petGetByName operation.

GET /pet/{name}

func (*Client) PetNameByID

func (c *Client) PetNameByID(ctx context.Context, params PetNameByIDParams) (res string, err error)

PetNameByID invokes petNameByID operation.

GET /pet/name/{id}

func (*Client) PetUpdateNameAliasPost

func (c *Client) PetUpdateNameAliasPost(ctx context.Context, request OptPetName) (res PetUpdateNameAliasPostDefStatusCode, err error)

PetUpdateNameAliasPost invokes operation.

POST /pet/updateNameAlias

func (*Client) PetUpdateNamePost

func (c *Client) PetUpdateNamePost(ctx context.Context, request OptString) (res PetUpdateNamePostDefStatusCode, err error)

PetUpdateNamePost invokes operation.

POST /pet/updateName

func (*Client) PetUploadAvatarByID

func (c *Client) PetUploadAvatarByID(ctx context.Context, request Stream, params PetUploadAvatarByIDParams) (res PetUploadAvatarByIDRes, err error)

PetUploadAvatarByID invokes petUploadAvatarByID operation.

POST /pet/avatar

type Data

type Data struct {
	ID          ID              `json:"id"`
	Description DataDescription `json:"description"`
	Email       string          `json:"email"`
	Hostname    string          `json:"hostname"`
	Format      string          `json:"format"`
	Base64      []byte          `json:"base64"`
}

Ref: #/components/schemas/Data

func (*Data) Decode

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

Decode decodes Data from json.

func (Data) Encode

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

Encode implements json.Marshaler.

func (Data) Validate

func (s Data) Validate() error

type DataDescription

type DataDescription struct {
	Type                DataDescriptionType // switch on this field
	DescriptionDetailed DescriptionDetailed
	DescriptionSimple   DescriptionSimple
}

DataDescription represents sum type.

func NewDescriptionDetailedDataDescription

func NewDescriptionDetailedDataDescription(v DescriptionDetailed) DataDescription

NewDescriptionDetailedDataDescription returns new DataDescription from DescriptionDetailed.

func NewDescriptionSimpleDataDescription

func NewDescriptionSimpleDataDescription(v DescriptionSimple) DataDescription

NewDescriptionSimpleDataDescription returns new DataDescription from DescriptionSimple.

func (*DataDescription) Decode

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

Decode decodes DataDescription from json.

func (DataDescription) Encode

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

Encode encodes DataDescription as json.

func (DataDescription) GetDescriptionDetailed

func (s DataDescription) GetDescriptionDetailed() (v DescriptionDetailed, ok bool)

GetDescriptionDetailed returns DescriptionDetailed and true boolean if DataDescription is DescriptionDetailed.

func (DataDescription) GetDescriptionSimple

func (s DataDescription) GetDescriptionSimple() (v DescriptionSimple, ok bool)

GetDescriptionSimple returns DescriptionSimple and true boolean if DataDescription is DescriptionSimple.

func (DataDescription) IsDescriptionDetailed

func (s DataDescription) IsDescriptionDetailed() bool

IsDescriptionDetailed reports whether DataDescription is DescriptionDetailed.

func (DataDescription) IsDescriptionSimple

func (s DataDescription) IsDescriptionSimple() bool

IsDescriptionSimple reports whether DataDescription is DescriptionSimple.

func (*DataDescription) SetDescriptionDetailed

func (s *DataDescription) SetDescriptionDetailed(v DescriptionDetailed)

SetDescriptionDetailed sets DataDescription to DescriptionDetailed.

func (*DataDescription) SetDescriptionSimple

func (s *DataDescription) SetDescriptionSimple(v DescriptionSimple)

SetDescriptionSimple sets DataDescription to DescriptionSimple.

type DataDescriptionType

type DataDescriptionType string

DataDescriptionType is oneOf type of DataDescription.

const (
	DescriptionDetailedDataDescription DataDescriptionType = "DescriptionDetailed"
	DescriptionSimpleDataDescription   DataDescriptionType = "DescriptionSimple"
)

Possible values for DataDescriptionType.

type DescriptionDetailed

type DescriptionDetailed struct {
	Name  string `json:"name"`
	Count int    `json:"count"`
}

Ref: #/components/schemas/DescriptionDetailed

func (*DescriptionDetailed) Decode

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

Decode decodes DescriptionDetailed from json.

func (DescriptionDetailed) Encode

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

Encode implements json.Marshaler.

type DescriptionSimple

type DescriptionSimple struct {
	Description string `json:"description"`
}

Ref: #/components/schemas/DescriptionSimple

func (*DescriptionSimple) Decode

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

Decode decodes DescriptionSimple from json.

func (DescriptionSimple) Encode

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

Encode implements json.Marshaler.

type Error

type Error struct {
	Code    int64  `json:"code"`
	Message string `json:"message"`
}

func (*Error) Decode

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

Decode decodes Error from json.

func (Error) Encode

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

Encode implements json.Marshaler.

type ErrorStatusCode

type ErrorStatusCode struct {
	StatusCode int
	Response   Error
}

ErrorStatusCode wraps Error with StatusCode.

func (*ErrorStatusCode) Decode

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

Decode decodes ErrorStatusCode from json.

func (ErrorStatusCode) Encode

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

Encode implements json.Marshaler.

type FoobarGetParams

type FoobarGetParams struct {
	InlinedParam int64
	Skip         int32
}

type FoobarGetRes

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

type FoobarPostRes

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

type FoobarPutDef

type FoobarPutDef struct{}

FoobarPutDef is default response for FoobarPut operation.

func (*FoobarPutDef) Decode

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

Decode decodes FoobarPutDef from json.

func (FoobarPutDef) Encode

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

Encode implements json.Marshaler.

type FoobarPutDefStatusCode

type FoobarPutDefStatusCode struct {
	StatusCode int
	Response   FoobarPutDef
}

FoobarPutDefStatusCode wraps FoobarPutDef with StatusCode.

func (*FoobarPutDefStatusCode) Decode

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

Decode decodes FoobarPutDefStatusCode from json.

func (FoobarPutDefStatusCode) Encode

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

Encode implements json.Marshaler.

type GetHeaderParams

type GetHeaderParams struct {
	XAuthToken string
}

type Handler

type Handler interface {
	// ErrorGet implements errorGet operation.
	//
	// GET /error
	ErrorGet(ctx context.Context) (ErrorStatusCode, error)
	// FoobarGet implements foobarGet operation.
	//
	// GET /foobar
	FoobarGet(ctx context.Context, params FoobarGetParams) (FoobarGetRes, error)
	// FoobarPost implements foobarPost operation.
	//
	// POST /foobar
	FoobarPost(ctx context.Context, req OptPet) (FoobarPostRes, error)
	// FoobarPut implements  operation.
	//
	// PUT /foobar
	FoobarPut(ctx context.Context) (FoobarPutDefStatusCode, error)
	// GetHeader implements getHeader operation.
	//
	// GET /test/header
	GetHeader(ctx context.Context, params GetHeaderParams) (Hash, error)
	// PetCreate implements petCreate operation.
	//
	// POST /pet
	PetCreate(ctx context.Context, req OptPet) (Pet, error)
	// PetFriendsNamesByID implements petFriendsNamesByID operation.
	//
	// GET /pet/friendNames/{id}
	PetFriendsNamesByID(ctx context.Context, params PetFriendsNamesByIDParams) ([]string, error)
	// PetGet implements petGet operation.
	//
	// GET /pet
	PetGet(ctx context.Context, params PetGetParams) (PetGetRes, error)
	// PetGetAvatarByID implements petGetAvatarByID operation.
	//
	// GET /pet/avatar
	PetGetAvatarByID(ctx context.Context, params PetGetAvatarByIDParams) (PetGetAvatarByIDRes, error)
	// PetGetByName implements petGetByName operation.
	//
	// GET /pet/{name}
	PetGetByName(ctx context.Context, params PetGetByNameParams) (Pet, error)
	// PetNameByID implements petNameByID operation.
	//
	// GET /pet/name/{id}
	PetNameByID(ctx context.Context, params PetNameByIDParams) (string, error)
	// PetUpdateNameAliasPost implements  operation.
	//
	// POST /pet/updateNameAlias
	PetUpdateNameAliasPost(ctx context.Context, req OptPetName) (PetUpdateNameAliasPostDefStatusCode, error)
	// PetUpdateNamePost implements  operation.
	//
	// POST /pet/updateName
	PetUpdateNamePost(ctx context.Context, req OptString) (PetUpdateNamePostDefStatusCode, error)
	// PetUploadAvatarByID implements petUploadAvatarByID operation.
	//
	// POST /pet/avatar
	PetUploadAvatarByID(ctx context.Context, req Stream, params PetUploadAvatarByIDParams) (PetUploadAvatarByIDRes, error)
}

Handler handles operations described by OpenAPI v3 specification.

type Hash

type Hash struct {
	Raw []byte `json:"raw"`
	Hex string `json:"hex"`
}

Ref: #/components/schemas/Hash

func (*Hash) Decode

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

Decode decodes Hash from json.

func (Hash) Encode

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

Encode implements json.Marshaler.

func (Hash) Validate

func (s Hash) Validate() error

type ID

type ID struct {
	Type   IDType // switch on this field
	String string
	Int    int
}

Ref: #/components/schemas/ID ID represents sum type.

func NewIntID

func NewIntID(v int) ID

NewIntID returns new ID from int.

func NewStringID

func NewStringID(v string) ID

NewStringID returns new ID from string.

func (*ID) Decode

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

Decode decodes ID from json.

func (ID) Encode

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

Encode encodes ID as json.

func (ID) GetInt

func (s ID) GetInt() (v int, ok bool)

GetInt returns int and true boolean if ID is int.

func (ID) GetString

func (s ID) GetString() (v string, ok bool)

GetString returns string and true boolean if ID is string.

func (ID) IsInt

func (s ID) IsInt() bool

IsInt reports whether ID is int.

func (ID) IsString

func (s ID) IsString() bool

IsString reports whether ID is string.

func (*ID) SetInt

func (s *ID) SetInt(v int)

SetInt sets ID to int.

func (*ID) SetString

func (s *ID) SetString(v string)

SetString sets ID to string.

type IDType

type IDType string

IDType is oneOf type of ID.

const (
	StringID IDType = "string"
	IntID    IDType = "int"
)

Possible values for IDType.

type NilString

type NilString struct {
	Value string
	Null  bool
}

NilString is nullable string.

func NewNilString

func NewNilString(v string) NilString

NewNilString returns new NilString with value set to v.

func (*NilString) Decode

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

Decode decodes string from json.

func (NilString) Encode

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

Encode encodes string as json.

func (NilString) Get

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

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

func (NilString) IsNull

func (o NilString) IsNull() bool

IsSet returns true if value is Null.

func (NilString) Or added in v0.4.0

func (o NilString) Or(d string) string

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

func (*NilString) SetTo

func (o *NilString) SetTo(v string)

SetTo sets value to v.

type NotFound

type NotFound struct{}

Ref: #/components/responses/NotFound

func (*NotFound) Decode

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

Decode decodes NotFound from json.

func (NotFound) Encode

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

Encode implements json.Marshaler.

type OptData

type OptData struct {
	Value Data
	Set   bool
}

OptData is optional Data.

func NewOptData

func NewOptData(v Data) OptData

NewOptData returns new OptData with value set to v.

func (*OptData) Decode

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

Decode decodes Data from json.

func (OptData) Encode

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

Encode encodes Data as json.

func (OptData) Get

func (o OptData) Get() (v Data, ok bool)

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

func (OptData) IsSet

func (o OptData) IsSet() bool

IsSet returns true if OptData was set.

func (OptData) Or added in v0.4.0

func (o OptData) Or(d Data) Data

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

func (*OptData) Reset

func (o *OptData) Reset()

Reset unsets value.

func (*OptData) SetTo

func (o *OptData) SetTo(v Data)

SetTo sets value to v.

type OptDuration

type OptDuration struct {
	Value time.Duration
	Set   bool
}

OptDuration is optional time.Duration.

func NewOptDuration

func NewOptDuration(v time.Duration) OptDuration

NewOptDuration returns new OptDuration with value set to v.

func (*OptDuration) Decode

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

Decode decodes time.Duration from json.

func (OptDuration) Encode

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

Encode encodes time.Duration as json.

func (OptDuration) Get

func (o OptDuration) Get() (v time.Duration, ok bool)

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

func (OptDuration) IsSet

func (o OptDuration) IsSet() bool

IsSet returns true if OptDuration was set.

func (OptDuration) Or added in v0.4.0

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

func (*OptDuration) Reset

func (o *OptDuration) Reset()

Reset unsets value.

func (*OptDuration) SetTo

func (o *OptDuration) SetTo(v time.Duration)

SetTo sets value to v.

type OptFloat64

type OptFloat64 struct {
	Value float64
	Set   bool
}

OptFloat64 is optional float64.

func NewOptFloat64

func NewOptFloat64(v float64) OptFloat64

NewOptFloat64 returns new OptFloat64 with value set to v.

func (*OptFloat64) Decode

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

Decode decodes float64 from json.

func (OptFloat64) Encode

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

Encode encodes float64 as json.

func (OptFloat64) Get

func (o OptFloat64) Get() (v float64, ok bool)

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

func (OptFloat64) IsSet

func (o OptFloat64) IsSet() bool

IsSet returns true if OptFloat64 was set.

func (OptFloat64) Or added in v0.4.0

func (o OptFloat64) Or(d float64) float64

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

func (*OptFloat64) Reset

func (o *OptFloat64) Reset()

Reset unsets value.

func (*OptFloat64) SetTo

func (o *OptFloat64) SetTo(v float64)

SetTo sets value to v.

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) Or added in v0.4.0

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.

type OptNilString

type OptNilString struct {
	Value string
	Set   bool
	Null  bool
}

OptNilString is optional nullable string.

func NewOptNilString

func NewOptNilString(v string) OptNilString

NewOptNilString returns new OptNilString with value set to v.

func (*OptNilString) Decode

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

Decode decodes string from json.

func (OptNilString) Encode

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

Encode encodes string as json.

func (OptNilString) Get

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

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

func (OptNilString) IsNull

func (o OptNilString) IsNull() bool

IsSet returns true if value is Null.

func (OptNilString) IsSet

func (o OptNilString) IsSet() bool

IsSet returns true if OptNilString was set.

func (OptNilString) Or added in v0.4.0

func (o OptNilString) Or(d string) string

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

func (*OptNilString) Reset

func (o *OptNilString) Reset()

Reset unsets value.

func (*OptNilString) SetTo

func (o *OptNilString) SetTo(v string)

SetTo sets value to v.

type OptPet

type OptPet struct {
	Value Pet
	Set   bool
}

OptPet is optional Pet.

func NewOptPet

func NewOptPet(v Pet) OptPet

NewOptPet returns new OptPet with value set to v.

func (*OptPet) Decode

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

Decode decodes Pet from json.

func (OptPet) Encode

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

Encode encodes Pet as json.

func (OptPet) Get

func (o OptPet) Get() (v Pet, ok bool)

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

func (OptPet) IsSet

func (o OptPet) IsSet() bool

IsSet returns true if OptPet was set.

func (OptPet) Or added in v0.4.0

func (o OptPet) Or(d Pet) Pet

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

func (*OptPet) Reset

func (o *OptPet) Reset()

Reset unsets value.

func (*OptPet) SetTo

func (o *OptPet) SetTo(v Pet)

SetTo sets value to v.

type OptPetName

type OptPetName struct {
	Value PetName
	Set   bool
}

OptPetName is optional PetName.

func NewOptPetName

func NewOptPetName(v PetName) OptPetName

NewOptPetName returns new OptPetName with value set to v.

func (*OptPetName) Decode

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

Decode decodes PetName from json.

func (OptPetName) Encode

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

Encode encodes PetName as json.

func (OptPetName) Get

func (o OptPetName) Get() (v PetName, ok bool)

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

func (OptPetName) IsSet

func (o OptPetName) IsSet() bool

IsSet returns true if OptPetName was set.

func (OptPetName) Or added in v0.4.0

func (o OptPetName) Or(d PetName) PetName

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

func (*OptPetName) Reset

func (o *OptPetName) Reset()

Reset unsets value.

func (*OptPetName) SetTo

func (o *OptPetName) SetTo(v PetName)

SetTo sets value to v.

type OptPetType

type OptPetType struct {
	Value PetType
	Set   bool
}

OptPetType is optional PetType.

func NewOptPetType

func NewOptPetType(v PetType) OptPetType

NewOptPetType returns new OptPetType with value set to v.

func (*OptPetType) Decode

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

Decode decodes PetType from json.

func (OptPetType) Encode

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

Encode encodes PetType as json.

func (OptPetType) Get

func (o OptPetType) Get() (v PetType, ok bool)

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

func (OptPetType) IsSet

func (o OptPetType) IsSet() bool

IsSet returns true if OptPetType was set.

func (OptPetType) Or added in v0.4.0

func (o OptPetType) Or(d PetType) PetType

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

func (*OptPetType) Reset

func (o *OptPetType) Reset()

Reset unsets value.

func (*OptPetType) SetTo

func (o *OptPetType) SetTo(v PetType)

SetTo sets value to v.

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) Or added in v0.4.0

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.

type OptTime

type OptTime struct {
	Value time.Time
	Set   bool
}

OptTime is optional time.Time.

func NewOptTime

func NewOptTime(v time.Time) OptTime

NewOptTime returns new OptTime with value set to v.

func (*OptTime) Decode

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

Decode decodes time.Time from json.

func (OptTime) Encode

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

Encode encodes time.Time as json.

func (OptTime) Get

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

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

func (OptTime) IsSet

func (o OptTime) IsSet() bool

IsSet returns true if OptTime was set.

func (OptTime) Or added in v0.4.0

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

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

func (*OptTime) Reset

func (o *OptTime) Reset()

Reset unsets value.

func (*OptTime) SetTo

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

SetTo sets value to v.

type OptUUID

type OptUUID struct {
	Value uuid.UUID
	Set   bool
}

OptUUID is optional uuid.UUID.

func NewOptUUID

func NewOptUUID(v uuid.UUID) OptUUID

NewOptUUID returns new OptUUID with value set to v.

func (*OptUUID) Decode

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

Decode decodes uuid.UUID from json.

func (OptUUID) Encode

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

Encode encodes uuid.UUID as json.

func (OptUUID) Get

func (o OptUUID) Get() (v uuid.UUID, ok bool)

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

func (OptUUID) IsSet

func (o OptUUID) IsSet() bool

IsSet returns true if OptUUID was set.

func (OptUUID) Or added in v0.4.0

func (o OptUUID) Or(d uuid.UUID) uuid.UUID

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

func (*OptUUID) Reset

func (o *OptUUID) Reset()

Reset unsets value.

func (*OptUUID) SetTo

func (o *OptUUID) SetTo(v uuid.UUID)

SetTo sets value to v.

type Option

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

func WithClient

func WithClient(client ht.Client) Option

WithClient specifies http client to use.

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 Pet

type Pet struct {
	Primary      *Pet          `json:"primary"`
	ID           int64         `json:"id"`
	UniqueID     uuid.UUID     `json:"unique_id"`
	Name         string        `json:"name"`
	Type         OptPetType    `json:"type"`
	Kind         PetKind       `json:"kind"`
	Tag          OptUUID       `json:"tag"`
	IP           net.IP        `json:"ip"`
	IPV4         net.IP        `json:"ip_v4"`
	IPV6         net.IP        `json:"ip_v6"`
	URI          url.URL       `json:"uri"`
	Birthday     time.Time     `json:"birthday"`
	Rate         time.Duration `json:"rate"`
	Nickname     NilString     `json:"nickname"`
	NullStr      OptNilString  `json:"nullStr"`
	Friends      []Pet         `json:"friends"`
	Next         OptData       `json:"next"`
	TestInteger1 OptInt        `json:"testInteger1"`
	TestFloat1   OptFloat64    `json:"testFloat1"`
	TestArray1   [][]string    `json:"testArray1"`
	TestDate     OptTime       `json:"testDate"`
	TestDuration OptDuration   `json:"testDuration"`
	TestTime     OptTime       `json:"testTime"`
	TestDateTime OptTime       `json:"testDateTime"`
}

Ref: #/components/schemas/Pet

func (*Pet) Decode

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

Decode decodes Pet from json.

func (Pet) Encode

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

Encode implements json.Marshaler.

func (Pet) Validate

func (s Pet) Validate() error

type PetFriendsNamesByIDParams

type PetFriendsNamesByIDParams struct {
	ID int
}

type PetGetAvatarByIDOKApplicationOctetStream

type PetGetAvatarByIDOKApplicationOctetStream struct {
	Data io.Reader
}

func (PetGetAvatarByIDOKApplicationOctetStream) Read

type PetGetAvatarByIDParams

type PetGetAvatarByIDParams struct {
	PetID int64
}

type PetGetAvatarByIDRes

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

type PetGetByNameParams

type PetGetByNameParams struct {
	Name string
}

type PetGetDef

type PetGetDef struct {
	Message string `json:"message"`
}

func (*PetGetDef) Decode

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

Decode decodes PetGetDef from json.

func (PetGetDef) Encode

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

Encode implements json.Marshaler.

type PetGetDefStatusCode

type PetGetDefStatusCode struct {
	StatusCode int
	Response   PetGetDef
}

PetGetDefStatusCode wraps PetGetDef with StatusCode.

func (*PetGetDefStatusCode) Decode

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

Decode decodes PetGetDefStatusCode from json.

func (PetGetDefStatusCode) Encode

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

Encode implements json.Marshaler.

type PetGetParams

type PetGetParams struct {
	PetID  int64
	XTags  []uuid.UUID
	XScope []string
	Token  string
}

type PetGetRes

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

type PetKind

type PetKind string
const (
	PetKindBig  PetKind = "big"
	PetKindSmol PetKind = "smol"
)

func (*PetKind) Decode

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

Decode decodes PetKind from json.

func (PetKind) Encode

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

Encode encodes PetKind as json.

func (PetKind) Validate

func (s PetKind) Validate() error

type PetName

type PetName string

func (*PetName) Decode

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

Decode decodes PetName from json.

func (PetName) Encode

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

Encode encodes PetName as json.

func (PetName) Validate

func (s PetName) Validate() error

type PetNameByIDParams

type PetNameByIDParams struct {
	ID int
}

type PetType

type PetType string
const (
	PetTypeFifa PetType = "fifa"
	PetTypeFofa PetType = "fofa"
)

func (*PetType) Decode

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

Decode decodes PetType from json.

func (PetType) Encode

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

Encode encodes PetType as json.

func (PetType) Validate

func (s PetType) Validate() error

type PetUpdateNameAliasPostDef

type PetUpdateNameAliasPostDef struct{}

PetUpdateNameAliasPostDef is default response for PetUpdateNameAliasPost operation.

func (*PetUpdateNameAliasPostDef) Decode

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

Decode decodes PetUpdateNameAliasPostDef from json.

func (PetUpdateNameAliasPostDef) Encode

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

Encode implements json.Marshaler.

type PetUpdateNameAliasPostDefStatusCode

type PetUpdateNameAliasPostDefStatusCode struct {
	StatusCode int
	Response   PetUpdateNameAliasPostDef
}

PetUpdateNameAliasPostDefStatusCode wraps PetUpdateNameAliasPostDef with StatusCode.

func (*PetUpdateNameAliasPostDefStatusCode) Decode

Decode decodes PetUpdateNameAliasPostDefStatusCode from json.

func (PetUpdateNameAliasPostDefStatusCode) Encode

Encode implements json.Marshaler.

type PetUpdateNamePostDef

type PetUpdateNamePostDef struct{}

PetUpdateNamePostDef is default response for PetUpdateNamePost operation.

func (*PetUpdateNamePostDef) Decode

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

Decode decodes PetUpdateNamePostDef from json.

func (PetUpdateNamePostDef) Encode

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

Encode implements json.Marshaler.

type PetUpdateNamePostDefStatusCode

type PetUpdateNamePostDefStatusCode struct {
	StatusCode int
	Response   PetUpdateNamePostDef
}

PetUpdateNamePostDefStatusCode wraps PetUpdateNamePostDef with StatusCode.

func (*PetUpdateNamePostDefStatusCode) Decode

Decode decodes PetUpdateNamePostDefStatusCode from json.

func (PetUpdateNamePostDefStatusCode) Encode

Encode implements json.Marshaler.

type PetUploadAvatarByIDOK

type PetUploadAvatarByIDOK struct{}

PetUploadAvatarByIDOK is response for PetUploadAvatarByID operation.

func (*PetUploadAvatarByIDOK) Decode

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

Decode decodes PetUploadAvatarByIDOK from json.

func (PetUploadAvatarByIDOK) Encode

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

Encode implements json.Marshaler.

type PetUploadAvatarByIDParams

type PetUploadAvatarByIDParams struct {
	PetID int64
}

type PetUploadAvatarByIDRes

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

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 ...Option) *Server

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 Stream

type Stream struct {
	Data io.Reader
}

func (Stream) Read

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

Jump to

Keyboard shortcuts

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