api

package
v1.17.0 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2025 License: Apache-2.0 Imports: 27 Imported by: 0

Documentation

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

func (c *Client) CreateItems(ctx context.Context, request *CreateItemsReq) (*CreateItemsOK, error)

CreateItems invokes createItems operation.

Create deeply nested items.

POST /test/items

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 CreateItemsOK

type CreateItemsOK struct {
	Created OptInt `json:"created"`
}

func (*CreateItemsOK) Decode

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

Decode decodes CreateItemsOK from json.

func (*CreateItemsOK) Encode

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

Encode implements json.Marshaler.

func (*CreateItemsOK) GetCreated

func (s *CreateItemsOK) GetCreated() OptInt

GetCreated returns the value of Created.

func (*CreateItemsOK) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (*CreateItemsOK) SetCreated

func (s *CreateItemsOK) SetCreated(val OptInt)

SetCreated sets the value of Created.

func (*CreateItemsOK) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

type CreateItemsReq

type CreateItemsReq struct {
	Items []Level1 `json:"items"`
}

func (*CreateItemsReq) Decode

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

Decode decodes CreateItemsReq from json.

func (*CreateItemsReq) Encode

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

Encode implements json.Marshaler.

func (*CreateItemsReq) GetItems

func (s *CreateItemsReq) GetItems() []Level1

GetItems returns the value of Items.

func (*CreateItemsReq) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (*CreateItemsReq) SetItems

func (s *CreateItemsReq) SetItems(val []Level1)

SetItems sets the value of Items.

func (*CreateItemsReq) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

func (*CreateItemsReq) Validate

func (s *CreateItemsReq) Validate() error

type ErrorHandler

type ErrorHandler = ogenerrors.ErrorHandler

ErrorHandler is error handler.

type Handler

type Handler interface {
	// CreateItems implements createItems operation.
	//
	// Create deeply nested items.
	//
	// POST /test/items
	CreateItems(ctx context.Context, req *CreateItemsReq) (*CreateItemsOK, error)
}

Handler handles operations described by OpenAPI v3 specification.

type Invoker

type Invoker interface {
	// CreateItems invokes createItems operation.
	//
	// Create deeply nested items.
	//
	// POST /test/items
	CreateItems(ctx context.Context, request *CreateItemsReq) (*CreateItemsOK, error)
}

Invoker invokes operations described by OpenAPI v3 specification.

type Labeler

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

Labeler is used to allow adding custom attributes to the server request metrics.

func LabelerFromContext

func LabelerFromContext(ctx context.Context) (*Labeler, bool)

LabelerFromContext retrieves the Labeler from the provided context, if present.

If no Labeler was found in the provided context a new, empty Labeler is returned and the second return value is false. In this case it is safe to use the Labeler but any attributes added to it will not be used.

func (*Labeler) Add

func (l *Labeler) Add(attrs ...attribute.KeyValue)

Add attributes to the Labeler.

func (*Labeler) AttributeSet

func (l *Labeler) AttributeSet() attribute.Set

AttributeSet returns the attributes added to the Labeler as an attribute.Set.

type Level1

type Level1 struct {
	ID     string    `json:"id"`
	Nested OptLevel2 `json:"nested"`
}

Level 1 of 12. Ref: #/components/schemas/Level1

func (*Level1) Decode

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

Decode decodes Level1 from json.

func (*Level1) Encode

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

Encode implements json.Marshaler.

func (Level1) Equal

func (a Level1) Equal(b Level1, depth int) bool

Equal compares two Level1 instances for equality. The depth parameter prevents infinite recursion on nested objects.

func (*Level1) GetID

func (s *Level1) GetID() string

GetID returns the value of ID.

func (*Level1) GetNested

func (s *Level1) GetNested() OptLevel2

GetNested returns the value of Nested.

func (Level1) Hash

func (a Level1) Hash() uint64

Hash computes a hash value for Level1 using FNV-1a. Equal objects must produce equal hashes.

func (*Level1) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (*Level1) SetID

func (s *Level1) SetID(val string)

SetID sets the value of ID.

func (*Level1) SetNested

func (s *Level1) SetNested(val OptLevel2)

SetNested sets the value of Nested.

func (*Level1) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

type Level10

type Level10 struct {
	Nested OptLevel11 `json:"nested"`
}

Level 10 of 12. Ref: #/components/schemas/Level10

func (*Level10) Decode

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

Decode decodes Level10 from json.

func (*Level10) Encode

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

Encode implements json.Marshaler.

func (Level10) Equal

func (a Level10) Equal(b Level10, depth int) bool

Equal compares two Level10 instances for equality. The depth parameter prevents infinite recursion on nested objects.

func (*Level10) GetNested

func (s *Level10) GetNested() OptLevel11

GetNested returns the value of Nested.

func (Level10) Hash

func (a Level10) Hash() uint64

Hash computes a hash value for Level10 using FNV-1a. Equal objects must produce equal hashes.

func (*Level10) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (*Level10) SetNested

func (s *Level10) SetNested(val OptLevel11)

SetNested sets the value of Nested.

func (*Level10) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

type Level11

type Level11 struct {
	Nested OptLevel12 `json:"nested"`
}

Level 11 of 12. Ref: #/components/schemas/Level11

func (*Level11) Decode

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

Decode decodes Level11 from json.

func (*Level11) Encode

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

Encode implements json.Marshaler.

func (Level11) Equal

func (a Level11) Equal(b Level11, depth int) bool

Equal compares two Level11 instances for equality. The depth parameter prevents infinite recursion on nested objects.

func (*Level11) GetNested

func (s *Level11) GetNested() OptLevel12

GetNested returns the value of Nested.

func (Level11) Hash

func (a Level11) Hash() uint64

Hash computes a hash value for Level11 using FNV-1a. Equal objects must produce equal hashes.

func (*Level11) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (*Level11) SetNested

func (s *Level11) SetNested(val OptLevel12)

SetNested sets the value of Nested.

func (*Level11) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

type Level12

type Level12 struct {
	Value OptString `json:"value"`
}

Level 12 of 12 (deepest level). Ref: #/components/schemas/Level12

func (*Level12) Decode

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

Decode decodes Level12 from json.

func (*Level12) Encode

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

Encode implements json.Marshaler.

func (Level12) Equal

func (a Level12) Equal(b Level12, depth int) bool

Equal compares two Level12 instances for equality. The depth parameter prevents infinite recursion on nested objects.

func (*Level12) GetValue

func (s *Level12) GetValue() OptString

GetValue returns the value of Value.

func (Level12) Hash

func (a Level12) Hash() uint64

Hash computes a hash value for Level12 using FNV-1a. Equal objects must produce equal hashes.

func (*Level12) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (*Level12) SetValue

func (s *Level12) SetValue(val OptString)

SetValue sets the value of Value.

func (*Level12) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

type Level2

type Level2 struct {
	Nested OptLevel3 `json:"nested"`
}

Level 2 of 12. Ref: #/components/schemas/Level2

func (*Level2) Decode

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

Decode decodes Level2 from json.

func (*Level2) Encode

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

Encode implements json.Marshaler.

func (Level2) Equal

func (a Level2) Equal(b Level2, depth int) bool

Equal compares two Level2 instances for equality. The depth parameter prevents infinite recursion on nested objects.

func (*Level2) GetNested

func (s *Level2) GetNested() OptLevel3

GetNested returns the value of Nested.

func (Level2) Hash

func (a Level2) Hash() uint64

Hash computes a hash value for Level2 using FNV-1a. Equal objects must produce equal hashes.

func (*Level2) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (*Level2) SetNested

func (s *Level2) SetNested(val OptLevel3)

SetNested sets the value of Nested.

func (*Level2) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

type Level3

type Level3 struct {
	Nested OptLevel4 `json:"nested"`
}

Level 3 of 12. Ref: #/components/schemas/Level3

func (*Level3) Decode

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

Decode decodes Level3 from json.

func (*Level3) Encode

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

Encode implements json.Marshaler.

func (Level3) Equal

func (a Level3) Equal(b Level3, depth int) bool

Equal compares two Level3 instances for equality. The depth parameter prevents infinite recursion on nested objects.

func (*Level3) GetNested

func (s *Level3) GetNested() OptLevel4

GetNested returns the value of Nested.

func (Level3) Hash

func (a Level3) Hash() uint64

Hash computes a hash value for Level3 using FNV-1a. Equal objects must produce equal hashes.

func (*Level3) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (*Level3) SetNested

func (s *Level3) SetNested(val OptLevel4)

SetNested sets the value of Nested.

func (*Level3) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

type Level4

type Level4 struct {
	Nested OptLevel5 `json:"nested"`
}

Level 4 of 12. Ref: #/components/schemas/Level4

func (*Level4) Decode

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

Decode decodes Level4 from json.

func (*Level4) Encode

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

Encode implements json.Marshaler.

func (Level4) Equal

func (a Level4) Equal(b Level4, depth int) bool

Equal compares two Level4 instances for equality. The depth parameter prevents infinite recursion on nested objects.

func (*Level4) GetNested

func (s *Level4) GetNested() OptLevel5

GetNested returns the value of Nested.

func (Level4) Hash

func (a Level4) Hash() uint64

Hash computes a hash value for Level4 using FNV-1a. Equal objects must produce equal hashes.

func (*Level4) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (*Level4) SetNested

func (s *Level4) SetNested(val OptLevel5)

SetNested sets the value of Nested.

func (*Level4) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

type Level5

type Level5 struct {
	Nested OptLevel6 `json:"nested"`
}

Level 5 of 12. Ref: #/components/schemas/Level5

func (*Level5) Decode

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

Decode decodes Level5 from json.

func (*Level5) Encode

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

Encode implements json.Marshaler.

func (Level5) Equal

func (a Level5) Equal(b Level5, depth int) bool

Equal compares two Level5 instances for equality. The depth parameter prevents infinite recursion on nested objects.

func (*Level5) GetNested

func (s *Level5) GetNested() OptLevel6

GetNested returns the value of Nested.

func (Level5) Hash

func (a Level5) Hash() uint64

Hash computes a hash value for Level5 using FNV-1a. Equal objects must produce equal hashes.

func (*Level5) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (*Level5) SetNested

func (s *Level5) SetNested(val OptLevel6)

SetNested sets the value of Nested.

func (*Level5) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

type Level6

type Level6 struct {
	Nested OptLevel7 `json:"nested"`
}

Level 6 of 12. Ref: #/components/schemas/Level6

func (*Level6) Decode

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

Decode decodes Level6 from json.

func (*Level6) Encode

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

Encode implements json.Marshaler.

func (Level6) Equal

func (a Level6) Equal(b Level6, depth int) bool

Equal compares two Level6 instances for equality. The depth parameter prevents infinite recursion on nested objects.

func (*Level6) GetNested

func (s *Level6) GetNested() OptLevel7

GetNested returns the value of Nested.

func (Level6) Hash

func (a Level6) Hash() uint64

Hash computes a hash value for Level6 using FNV-1a. Equal objects must produce equal hashes.

func (*Level6) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (*Level6) SetNested

func (s *Level6) SetNested(val OptLevel7)

SetNested sets the value of Nested.

func (*Level6) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

type Level7

type Level7 struct {
	Nested OptLevel8 `json:"nested"`
}

Level 7 of 12. Ref: #/components/schemas/Level7

func (*Level7) Decode

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

Decode decodes Level7 from json.

func (*Level7) Encode

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

Encode implements json.Marshaler.

func (Level7) Equal

func (a Level7) Equal(b Level7, depth int) bool

Equal compares two Level7 instances for equality. The depth parameter prevents infinite recursion on nested objects.

func (*Level7) GetNested

func (s *Level7) GetNested() OptLevel8

GetNested returns the value of Nested.

func (Level7) Hash

func (a Level7) Hash() uint64

Hash computes a hash value for Level7 using FNV-1a. Equal objects must produce equal hashes.

func (*Level7) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (*Level7) SetNested

func (s *Level7) SetNested(val OptLevel8)

SetNested sets the value of Nested.

func (*Level7) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

type Level8

type Level8 struct {
	Nested OptLevel9 `json:"nested"`
}

Level 8 of 12. Ref: #/components/schemas/Level8

func (*Level8) Decode

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

Decode decodes Level8 from json.

func (*Level8) Encode

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

Encode implements json.Marshaler.

func (Level8) Equal

func (a Level8) Equal(b Level8, depth int) bool

Equal compares two Level8 instances for equality. The depth parameter prevents infinite recursion on nested objects.

func (*Level8) GetNested

func (s *Level8) GetNested() OptLevel9

GetNested returns the value of Nested.

func (Level8) Hash

func (a Level8) Hash() uint64

Hash computes a hash value for Level8 using FNV-1a. Equal objects must produce equal hashes.

func (*Level8) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (*Level8) SetNested

func (s *Level8) SetNested(val OptLevel9)

SetNested sets the value of Nested.

func (*Level8) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

type Level9

type Level9 struct {
	Nested OptLevel10 `json:"nested"`
}

Level 9 of 12. Ref: #/components/schemas/Level9

func (*Level9) Decode

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

Decode decodes Level9 from json.

func (*Level9) Encode

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

Encode implements json.Marshaler.

func (Level9) Equal

func (a Level9) Equal(b Level9, depth int) bool

Equal compares two Level9 instances for equality. The depth parameter prevents infinite recursion on nested objects.

func (*Level9) GetNested

func (s *Level9) GetNested() OptLevel10

GetNested returns the value of Nested.

func (Level9) Hash

func (a Level9) Hash() uint64

Hash computes a hash value for Level9 using FNV-1a. Equal objects must produce equal hashes.

func (*Level9) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (*Level9) SetNested

func (s *Level9) SetNested(val OptLevel10)

SetNested sets the value of Nested.

func (*Level9) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

type Middleware

type Middleware = middleware.Middleware

Middleware is middleware type.

type OperationName

type OperationName = string

OperationName is the ogen operation name

const (
	CreateItemsOperation OperationName = "CreateItems"
)

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 OptLevel10

type OptLevel10 struct {
	Value Level10
	Set   bool
}

OptLevel10 is optional Level10.

func NewOptLevel10

func NewOptLevel10(v Level10) OptLevel10

NewOptLevel10 returns new OptLevel10 with value set to v.

func (*OptLevel10) Decode

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

Decode decodes Level10 from json.

func (OptLevel10) Encode

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

Encode encodes Level10 as json.

func (OptLevel10) Get

func (o OptLevel10) Get() (v Level10, ok bool)

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

func (OptLevel10) IsSet

func (o OptLevel10) IsSet() bool

IsSet returns true if OptLevel10 was set.

func (OptLevel10) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (OptLevel10) Or

func (o OptLevel10) Or(d Level10) Level10

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

func (*OptLevel10) Reset

func (o *OptLevel10) Reset()

Reset unsets value.

func (*OptLevel10) SetTo

func (o *OptLevel10) SetTo(v Level10)

SetTo sets value to v.

func (*OptLevel10) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

type OptLevel11

type OptLevel11 struct {
	Value Level11
	Set   bool
}

OptLevel11 is optional Level11.

func NewOptLevel11

func NewOptLevel11(v Level11) OptLevel11

NewOptLevel11 returns new OptLevel11 with value set to v.

func (*OptLevel11) Decode

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

Decode decodes Level11 from json.

func (OptLevel11) Encode

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

Encode encodes Level11 as json.

func (OptLevel11) Get

func (o OptLevel11) Get() (v Level11, ok bool)

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

func (OptLevel11) IsSet

func (o OptLevel11) IsSet() bool

IsSet returns true if OptLevel11 was set.

func (OptLevel11) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (OptLevel11) Or

func (o OptLevel11) Or(d Level11) Level11

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

func (*OptLevel11) Reset

func (o *OptLevel11) Reset()

Reset unsets value.

func (*OptLevel11) SetTo

func (o *OptLevel11) SetTo(v Level11)

SetTo sets value to v.

func (*OptLevel11) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

type OptLevel12

type OptLevel12 struct {
	Value Level12
	Set   bool
}

OptLevel12 is optional Level12.

func NewOptLevel12

func NewOptLevel12(v Level12) OptLevel12

NewOptLevel12 returns new OptLevel12 with value set to v.

func (*OptLevel12) Decode

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

Decode decodes Level12 from json.

func (OptLevel12) Encode

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

Encode encodes Level12 as json.

func (OptLevel12) Get

func (o OptLevel12) Get() (v Level12, ok bool)

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

func (OptLevel12) IsSet

func (o OptLevel12) IsSet() bool

IsSet returns true if OptLevel12 was set.

func (OptLevel12) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (OptLevel12) Or

func (o OptLevel12) Or(d Level12) Level12

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

func (*OptLevel12) Reset

func (o *OptLevel12) Reset()

Reset unsets value.

func (*OptLevel12) SetTo

func (o *OptLevel12) SetTo(v Level12)

SetTo sets value to v.

func (*OptLevel12) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

type OptLevel2

type OptLevel2 struct {
	Value Level2
	Set   bool
}

OptLevel2 is optional Level2.

func NewOptLevel2

func NewOptLevel2(v Level2) OptLevel2

NewOptLevel2 returns new OptLevel2 with value set to v.

func (*OptLevel2) Decode

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

Decode decodes Level2 from json.

func (OptLevel2) Encode

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

Encode encodes Level2 as json.

func (OptLevel2) Get

func (o OptLevel2) Get() (v Level2, ok bool)

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

func (OptLevel2) IsSet

func (o OptLevel2) IsSet() bool

IsSet returns true if OptLevel2 was set.

func (OptLevel2) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (OptLevel2) Or

func (o OptLevel2) Or(d Level2) Level2

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

func (*OptLevel2) Reset

func (o *OptLevel2) Reset()

Reset unsets value.

func (*OptLevel2) SetTo

func (o *OptLevel2) SetTo(v Level2)

SetTo sets value to v.

func (*OptLevel2) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

type OptLevel3

type OptLevel3 struct {
	Value Level3
	Set   bool
}

OptLevel3 is optional Level3.

func NewOptLevel3

func NewOptLevel3(v Level3) OptLevel3

NewOptLevel3 returns new OptLevel3 with value set to v.

func (*OptLevel3) Decode

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

Decode decodes Level3 from json.

func (OptLevel3) Encode

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

Encode encodes Level3 as json.

func (OptLevel3) Get

func (o OptLevel3) Get() (v Level3, ok bool)

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

func (OptLevel3) IsSet

func (o OptLevel3) IsSet() bool

IsSet returns true if OptLevel3 was set.

func (OptLevel3) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (OptLevel3) Or

func (o OptLevel3) Or(d Level3) Level3

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

func (*OptLevel3) Reset

func (o *OptLevel3) Reset()

Reset unsets value.

func (*OptLevel3) SetTo

func (o *OptLevel3) SetTo(v Level3)

SetTo sets value to v.

func (*OptLevel3) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

type OptLevel4

type OptLevel4 struct {
	Value Level4
	Set   bool
}

OptLevel4 is optional Level4.

func NewOptLevel4

func NewOptLevel4(v Level4) OptLevel4

NewOptLevel4 returns new OptLevel4 with value set to v.

func (*OptLevel4) Decode

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

Decode decodes Level4 from json.

func (OptLevel4) Encode

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

Encode encodes Level4 as json.

func (OptLevel4) Get

func (o OptLevel4) Get() (v Level4, ok bool)

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

func (OptLevel4) IsSet

func (o OptLevel4) IsSet() bool

IsSet returns true if OptLevel4 was set.

func (OptLevel4) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (OptLevel4) Or

func (o OptLevel4) Or(d Level4) Level4

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

func (*OptLevel4) Reset

func (o *OptLevel4) Reset()

Reset unsets value.

func (*OptLevel4) SetTo

func (o *OptLevel4) SetTo(v Level4)

SetTo sets value to v.

func (*OptLevel4) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

type OptLevel5

type OptLevel5 struct {
	Value Level5
	Set   bool
}

OptLevel5 is optional Level5.

func NewOptLevel5

func NewOptLevel5(v Level5) OptLevel5

NewOptLevel5 returns new OptLevel5 with value set to v.

func (*OptLevel5) Decode

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

Decode decodes Level5 from json.

func (OptLevel5) Encode

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

Encode encodes Level5 as json.

func (OptLevel5) Get

func (o OptLevel5) Get() (v Level5, ok bool)

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

func (OptLevel5) IsSet

func (o OptLevel5) IsSet() bool

IsSet returns true if OptLevel5 was set.

func (OptLevel5) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (OptLevel5) Or

func (o OptLevel5) Or(d Level5) Level5

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

func (*OptLevel5) Reset

func (o *OptLevel5) Reset()

Reset unsets value.

func (*OptLevel5) SetTo

func (o *OptLevel5) SetTo(v Level5)

SetTo sets value to v.

func (*OptLevel5) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

type OptLevel6

type OptLevel6 struct {
	Value Level6
	Set   bool
}

OptLevel6 is optional Level6.

func NewOptLevel6

func NewOptLevel6(v Level6) OptLevel6

NewOptLevel6 returns new OptLevel6 with value set to v.

func (*OptLevel6) Decode

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

Decode decodes Level6 from json.

func (OptLevel6) Encode

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

Encode encodes Level6 as json.

func (OptLevel6) Get

func (o OptLevel6) Get() (v Level6, ok bool)

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

func (OptLevel6) IsSet

func (o OptLevel6) IsSet() bool

IsSet returns true if OptLevel6 was set.

func (OptLevel6) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (OptLevel6) Or

func (o OptLevel6) Or(d Level6) Level6

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

func (*OptLevel6) Reset

func (o *OptLevel6) Reset()

Reset unsets value.

func (*OptLevel6) SetTo

func (o *OptLevel6) SetTo(v Level6)

SetTo sets value to v.

func (*OptLevel6) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

type OptLevel7

type OptLevel7 struct {
	Value Level7
	Set   bool
}

OptLevel7 is optional Level7.

func NewOptLevel7

func NewOptLevel7(v Level7) OptLevel7

NewOptLevel7 returns new OptLevel7 with value set to v.

func (*OptLevel7) Decode

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

Decode decodes Level7 from json.

func (OptLevel7) Encode

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

Encode encodes Level7 as json.

func (OptLevel7) Get

func (o OptLevel7) Get() (v Level7, ok bool)

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

func (OptLevel7) IsSet

func (o OptLevel7) IsSet() bool

IsSet returns true if OptLevel7 was set.

func (OptLevel7) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (OptLevel7) Or

func (o OptLevel7) Or(d Level7) Level7

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

func (*OptLevel7) Reset

func (o *OptLevel7) Reset()

Reset unsets value.

func (*OptLevel7) SetTo

func (o *OptLevel7) SetTo(v Level7)

SetTo sets value to v.

func (*OptLevel7) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

type OptLevel8

type OptLevel8 struct {
	Value Level8
	Set   bool
}

OptLevel8 is optional Level8.

func NewOptLevel8

func NewOptLevel8(v Level8) OptLevel8

NewOptLevel8 returns new OptLevel8 with value set to v.

func (*OptLevel8) Decode

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

Decode decodes Level8 from json.

func (OptLevel8) Encode

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

Encode encodes Level8 as json.

func (OptLevel8) Get

func (o OptLevel8) Get() (v Level8, ok bool)

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

func (OptLevel8) IsSet

func (o OptLevel8) IsSet() bool

IsSet returns true if OptLevel8 was set.

func (OptLevel8) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (OptLevel8) Or

func (o OptLevel8) Or(d Level8) Level8

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

func (*OptLevel8) Reset

func (o *OptLevel8) Reset()

Reset unsets value.

func (*OptLevel8) SetTo

func (o *OptLevel8) SetTo(v Level8)

SetTo sets value to v.

func (*OptLevel8) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

type OptLevel9

type OptLevel9 struct {
	Value Level9
	Set   bool
}

OptLevel9 is optional Level9.

func NewOptLevel9

func NewOptLevel9(v Level9) OptLevel9

NewOptLevel9 returns new OptLevel9 with value set to v.

func (*OptLevel9) Decode

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

Decode decodes Level9 from json.

func (OptLevel9) Encode

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

Encode encodes Level9 as json.

func (OptLevel9) Get

func (o OptLevel9) Get() (v Level9, ok bool)

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

func (OptLevel9) IsSet

func (o OptLevel9) IsSet() bool

IsSet returns true if OptLevel9 was set.

func (OptLevel9) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (OptLevel9) Or

func (o OptLevel9) Or(d Level9) Level9

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

func (*OptLevel9) Reset

func (o *OptLevel9) Reset()

Reset unsets value.

func (*OptLevel9) SetTo

func (o *OptLevel9) SetTo(v Level9)

SetTo sets value to v.

func (*OptLevel9) UnmarshalJSON

func (s *OptLevel9) 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 WithAttributes

func WithAttributes(attributes ...attribute.KeyValue) Option

WithAttributes specifies default otel attributes.

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

func (UnimplementedHandler) CreateItems(ctx context.Context, req *CreateItemsReq) (r *CreateItemsOK, _ error)

CreateItems implements createItems operation.

Create deeply nested items.

POST /test/items

Jump to

Keyboard shortcuts

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