api

package
v0.0.0-...-5415eb5 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2024 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

func WithServerURL

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

WithServerURL sets context key to override server URL.

Types

type AnyContentTypeBinaryStringSchemaDefaultDef

type AnyContentTypeBinaryStringSchemaDefaultDef struct {
	Data io.Reader
}

func (AnyContentTypeBinaryStringSchemaDefaultDef) Read

Read reads data from the Data reader.

Kept to satisfy the io.Reader interface.

type AnyContentTypeBinaryStringSchemaDefaultDefStatusCodeWithHeaders

type AnyContentTypeBinaryStringSchemaDefaultDefStatusCodeWithHeaders struct {
	StatusCode  int
	ContentType string
	Response    AnyContentTypeBinaryStringSchemaDefaultDef
}

AnyContentTypeBinaryStringSchemaDefaultDefStatusCodeWithHeaders wraps AnyContentTypeBinaryStringSchemaDefaultDef with status code and response headers.

func (*AnyContentTypeBinaryStringSchemaDefaultDefStatusCodeWithHeaders) GetContentType

GetContentType returns the value of ContentType.

func (*AnyContentTypeBinaryStringSchemaDefaultDefStatusCodeWithHeaders) GetResponse

GetResponse returns the value of Response.

func (*AnyContentTypeBinaryStringSchemaDefaultDefStatusCodeWithHeaders) GetStatusCode

GetStatusCode returns the value of StatusCode.

func (*AnyContentTypeBinaryStringSchemaDefaultDefStatusCodeWithHeaders) SetContentType

SetContentType sets the value of ContentType.

func (*AnyContentTypeBinaryStringSchemaDefaultDefStatusCodeWithHeaders) SetResponse

SetResponse sets the value of Response.

func (*AnyContentTypeBinaryStringSchemaDefaultDefStatusCodeWithHeaders) SetStatusCode

SetStatusCode sets the value of StatusCode.

type AnyContentTypeBinaryStringSchemaOK

type AnyContentTypeBinaryStringSchemaOK struct {
	Data io.Reader
}

func (AnyContentTypeBinaryStringSchemaOK) Read

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

Read reads data from the Data reader.

Kept to satisfy the io.Reader interface.

type AnyContentTypeBinaryStringSchemaOKHeaders

type AnyContentTypeBinaryStringSchemaOKHeaders struct {
	ContentType string
	Response    AnyContentTypeBinaryStringSchemaOK
}

AnyContentTypeBinaryStringSchemaOKHeaders wraps AnyContentTypeBinaryStringSchemaOK with response headers.

func (*AnyContentTypeBinaryStringSchemaOKHeaders) GetContentType

GetContentType returns the value of ContentType.

func (*AnyContentTypeBinaryStringSchemaOKHeaders) GetResponse

GetResponse returns the value of Response.

func (*AnyContentTypeBinaryStringSchemaOKHeaders) SetContentType

func (s *AnyContentTypeBinaryStringSchemaOKHeaders) SetContentType(val string)

SetContentType sets the value of ContentType.

func (*AnyContentTypeBinaryStringSchemaOKHeaders) SetResponse

SetResponse sets the value of Response.

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

func (c *Client) AnyContentTypeBinaryStringSchema(ctx context.Context) (*AnyContentTypeBinaryStringSchemaOKHeaders, error)

AnyContentTypeBinaryStringSchema invokes anyContentTypeBinaryStringSchema operation.

GET /anyContentTypeBinaryStringSchema

func (*Client) AnyContentTypeBinaryStringSchemaDefault

func (c *Client) AnyContentTypeBinaryStringSchemaDefault(ctx context.Context) (*AnyContentTypeBinaryStringSchemaDefaultDefStatusCodeWithHeaders, error)

AnyContentTypeBinaryStringSchemaDefault invokes anyContentTypeBinaryStringSchemaDefault operation.

GET /anyContentTypeBinaryStringSchemaDefault

func (*Client) Combined

func (c *Client) Combined(ctx context.Context, params CombinedParams) (CombinedRes, error)

Combined invokes combined operation.

GET /combined

func (*Client) Headers200

func (c *Client) Headers200(ctx context.Context) (*Headers200OK, error)

Headers200 invokes headers200 operation.

GET /headers200

func (*Client) HeadersCombined

func (c *Client) HeadersCombined(ctx context.Context, params HeadersCombinedParams) (HeadersCombinedRes, error)

HeadersCombined invokes headersCombined operation.

GET /headersCombined

func (*Client) HeadersDefault

func (c *Client) HeadersDefault(ctx context.Context) (*HeadersDefaultDef, error)

HeadersDefault invokes headersDefault operation.

GET /headersDefault

func (*Client) HeadersJSON

func (c *Client) HeadersJSON(ctx context.Context) (*HeadersJSONOK, error)

HeadersJSON invokes headersJSON operation.

GET /headersJSON

func (*Client) HeadersPattern

func (c *Client) HeadersPattern(ctx context.Context) (*HeadersPattern4XX, error)

HeadersPattern invokes headersPattern operation.

GET /headersPattern

func (*Client) IntersectPatternCode

func (c *Client) IntersectPatternCode(ctx context.Context, params IntersectPatternCodeParams) (IntersectPatternCodeRes, error)

IntersectPatternCode invokes intersectPatternCode operation.

If a response is defined using an explicit code, the explicit code definition takes precedence over the range definition for that code.

GET /intersectPatternCode

func (*Client) MultipleGenericResponses

func (c *Client) MultipleGenericResponses(ctx context.Context) (MultipleGenericResponsesRes, error)

MultipleGenericResponses invokes multipleGenericResponses operation.

GET /multipleGenericResponses

func (*Client) OctetStreamBinaryStringSchema

func (c *Client) OctetStreamBinaryStringSchema(ctx context.Context) (OctetStreamBinaryStringSchemaOK, error)

OctetStreamBinaryStringSchema invokes octetStreamBinaryStringSchema operation.

GET /octetStreamBinaryStringSchema

func (*Client) OctetStreamEmptySchema

func (c *Client) OctetStreamEmptySchema(ctx context.Context) (OctetStreamEmptySchemaOK, error)

OctetStreamEmptySchema invokes octetStreamEmptySchema operation.

GET /octetStreamEmptySchema

func (*Client) OptionalHeaders

func (c *Client) OptionalHeaders(ctx context.Context) (*OptionalHeadersOK, error)

OptionalHeaders invokes optionalHeaders operation.

Https://github.com/jghiloni/ogen/issues/822.

GET /optionalHeaders

func (*Client) StreamJSON

func (c *Client) StreamJSON(ctx context.Context, params StreamJSONParams) (StreamJSONRes, error)

StreamJSON invokes streamJSON operation.

POST /streamJSON

func (*Client) TextPlainBinaryStringSchema

func (c *Client) TextPlainBinaryStringSchema(ctx context.Context) (TextPlainBinaryStringSchemaOK, error)

TextPlainBinaryStringSchema invokes textPlainBinaryStringSchema operation.

GET /textPlainBinaryStringSchema

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 Combined2XXStatusCode

type Combined2XXStatusCode struct {
	StatusCode int
	Response   int
}

Combined2XXStatusCode wraps int with StatusCode.

func (*Combined2XXStatusCode) GetResponse

func (s *Combined2XXStatusCode) GetResponse() int

GetResponse returns the value of Response.

func (*Combined2XXStatusCode) GetStatusCode

func (s *Combined2XXStatusCode) GetStatusCode() int

GetStatusCode returns the value of StatusCode.

func (*Combined2XXStatusCode) SetResponse

func (s *Combined2XXStatusCode) SetResponse(val int)

SetResponse sets the value of Response.

func (*Combined2XXStatusCode) SetStatusCode

func (s *Combined2XXStatusCode) SetStatusCode(val int)

SetStatusCode sets the value of StatusCode.

type Combined5XXStatusCode

type Combined5XXStatusCode struct {
	StatusCode int
	Response   bool
}

Combined5XXStatusCode wraps bool with StatusCode.

func (*Combined5XXStatusCode) GetResponse

func (s *Combined5XXStatusCode) GetResponse() bool

GetResponse returns the value of Response.

func (*Combined5XXStatusCode) GetStatusCode

func (s *Combined5XXStatusCode) GetStatusCode() int

GetStatusCode returns the value of StatusCode.

func (*Combined5XXStatusCode) SetResponse

func (s *Combined5XXStatusCode) SetResponse(val bool)

SetResponse sets the value of Response.

func (*Combined5XXStatusCode) SetStatusCode

func (s *Combined5XXStatusCode) SetStatusCode(val int)

SetStatusCode sets the value of StatusCode.

type CombinedDefStatusCode

type CombinedDefStatusCode struct {
	StatusCode int
	Response   []string
}

CombinedDefStatusCode wraps []string with StatusCode.

func (*CombinedDefStatusCode) GetResponse

func (s *CombinedDefStatusCode) GetResponse() []string

GetResponse returns the value of Response.

func (*CombinedDefStatusCode) GetStatusCode

func (s *CombinedDefStatusCode) GetStatusCode() int

GetStatusCode returns the value of StatusCode.

func (*CombinedDefStatusCode) SetResponse

func (s *CombinedDefStatusCode) SetResponse(val []string)

SetResponse sets the value of Response.

func (*CombinedDefStatusCode) SetStatusCode

func (s *CombinedDefStatusCode) SetStatusCode(val int)

SetStatusCode sets the value of StatusCode.

func (*CombinedDefStatusCode) Validate

func (s *CombinedDefStatusCode) Validate() error

type CombinedOK

type CombinedOK struct {
	Ok string `json:"ok"`
}

func (*CombinedOK) Decode

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

Decode decodes CombinedOK from json.

func (*CombinedOK) Encode

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

Encode implements json.Marshaler.

func (*CombinedOK) GetOk

func (s *CombinedOK) GetOk() string

GetOk returns the value of Ok.

func (*CombinedOK) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (*CombinedOK) SetOk

func (s *CombinedOK) SetOk(val string)

SetOk sets the value of Ok.

func (*CombinedOK) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

type CombinedParams

type CombinedParams struct {
	Type CombinedType
}

CombinedParams is parameters of combined operation.

type CombinedRes

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

type CombinedType

type CombinedType string
const (
	CombinedType200     CombinedType = "200"
	CombinedType2XX     CombinedType = "2XX"
	CombinedType5XX     CombinedType = "5XX"
	CombinedTypeDefault CombinedType = "default"
)

func (CombinedType) AllValues

func (CombinedType) AllValues() []CombinedType

AllValues returns all CombinedType values.

func (CombinedType) MarshalText

func (s CombinedType) MarshalText() ([]byte, error)

MarshalText implements encoding.TextMarshaler.

func (*CombinedType) UnmarshalText

func (s *CombinedType) UnmarshalText(data []byte) error

UnmarshalText implements encoding.TextUnmarshaler.

func (CombinedType) Validate

func (s CombinedType) Validate() error

type Error

type Error struct {
	Error string `json:"error"`
}

Ref: #/components/schemas/Error

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.

func (*Error) GetError

func (s *Error) GetError() string

GetError returns the value of Error.

func (*Error) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (*Error) SetError

func (s *Error) SetError(val string)

SetError sets the value of Error.

func (*Error) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

type ErrorHandler

type ErrorHandler = ogenerrors.ErrorHandler

ErrorHandler is error handler.

type Handler

type Handler interface {
	// AnyContentTypeBinaryStringSchema implements anyContentTypeBinaryStringSchema operation.
	//
	// GET /anyContentTypeBinaryStringSchema
	AnyContentTypeBinaryStringSchema(ctx context.Context) (*AnyContentTypeBinaryStringSchemaOKHeaders, error)
	// AnyContentTypeBinaryStringSchemaDefault implements anyContentTypeBinaryStringSchemaDefault operation.
	//
	// GET /anyContentTypeBinaryStringSchemaDefault
	AnyContentTypeBinaryStringSchemaDefault(ctx context.Context) (*AnyContentTypeBinaryStringSchemaDefaultDefStatusCodeWithHeaders, error)
	// Combined implements combined operation.
	//
	// GET /combined
	Combined(ctx context.Context, params CombinedParams) (CombinedRes, error)
	// Headers200 implements headers200 operation.
	//
	// GET /headers200
	Headers200(ctx context.Context) (*Headers200OK, error)
	// HeadersCombined implements headersCombined operation.
	//
	// GET /headersCombined
	HeadersCombined(ctx context.Context, params HeadersCombinedParams) (HeadersCombinedRes, error)
	// HeadersDefault implements headersDefault operation.
	//
	// GET /headersDefault
	HeadersDefault(ctx context.Context) (*HeadersDefaultDef, error)
	// HeadersJSON implements headersJSON operation.
	//
	// GET /headersJSON
	HeadersJSON(ctx context.Context) (*HeadersJSONOK, error)
	// HeadersPattern implements headersPattern operation.
	//
	// GET /headersPattern
	HeadersPattern(ctx context.Context) (*HeadersPattern4XX, error)
	// IntersectPatternCode implements intersectPatternCode operation.
	//
	// If a response is defined using an explicit code, the explicit code definition takes precedence
	// over the range definition for that code.
	//
	// GET /intersectPatternCode
	IntersectPatternCode(ctx context.Context, params IntersectPatternCodeParams) (IntersectPatternCodeRes, error)
	// MultipleGenericResponses implements multipleGenericResponses operation.
	//
	// GET /multipleGenericResponses
	MultipleGenericResponses(ctx context.Context) (MultipleGenericResponsesRes, error)
	// OctetStreamBinaryStringSchema implements octetStreamBinaryStringSchema operation.
	//
	// GET /octetStreamBinaryStringSchema
	OctetStreamBinaryStringSchema(ctx context.Context) (OctetStreamBinaryStringSchemaOK, error)
	// OctetStreamEmptySchema implements octetStreamEmptySchema operation.
	//
	// GET /octetStreamEmptySchema
	OctetStreamEmptySchema(ctx context.Context) (OctetStreamEmptySchemaOK, error)
	// OptionalHeaders implements optionalHeaders operation.
	//
	// Https://github.com/jghiloni/ogen/issues/822.
	//
	// GET /optionalHeaders
	OptionalHeaders(ctx context.Context) (*OptionalHeadersOK, error)
	// StreamJSON implements streamJSON operation.
	//
	// POST /streamJSON
	StreamJSON(ctx context.Context, params StreamJSONParams) (StreamJSONRes, error)
	// TextPlainBinaryStringSchema implements textPlainBinaryStringSchema operation.
	//
	// GET /textPlainBinaryStringSchema
	TextPlainBinaryStringSchema(ctx context.Context) (TextPlainBinaryStringSchemaOK, error)
}

Handler handles operations described by OpenAPI v3 specification.

type Headers200OK

type Headers200OK struct {
	XTestHeader string
}

Headers200OK is response for Headers200 operation.

func (*Headers200OK) GetXTestHeader

func (s *Headers200OK) GetXTestHeader() string

GetXTestHeader returns the value of XTestHeader.

func (*Headers200OK) SetXTestHeader

func (s *Headers200OK) SetXTestHeader(val string)

SetXTestHeader sets the value of XTestHeader.

type HeadersCombined4XX

type HeadersCombined4XX struct {
	XTestHeader string
	StatusCode  int
}

HeadersCombined4XX is 4XX pattern response for HeadersCombined operation.

func (*HeadersCombined4XX) GetStatusCode

func (s *HeadersCombined4XX) GetStatusCode() int

GetStatusCode returns the value of StatusCode.

func (*HeadersCombined4XX) GetXTestHeader

func (s *HeadersCombined4XX) GetXTestHeader() string

GetXTestHeader returns the value of XTestHeader.

func (*HeadersCombined4XX) SetStatusCode

func (s *HeadersCombined4XX) SetStatusCode(val int)

SetStatusCode sets the value of StatusCode.

func (*HeadersCombined4XX) SetXTestHeader

func (s *HeadersCombined4XX) SetXTestHeader(val string)

SetXTestHeader sets the value of XTestHeader.

type HeadersCombinedDef

type HeadersCombinedDef struct {
	XTestHeader string
	StatusCode  int
}

HeadersCombinedDef is default response for HeadersCombined operation.

func (*HeadersCombinedDef) GetStatusCode

func (s *HeadersCombinedDef) GetStatusCode() int

GetStatusCode returns the value of StatusCode.

func (*HeadersCombinedDef) GetXTestHeader

func (s *HeadersCombinedDef) GetXTestHeader() string

GetXTestHeader returns the value of XTestHeader.

func (*HeadersCombinedDef) SetStatusCode

func (s *HeadersCombinedDef) SetStatusCode(val int)

SetStatusCode sets the value of StatusCode.

func (*HeadersCombinedDef) SetXTestHeader

func (s *HeadersCombinedDef) SetXTestHeader(val string)

SetXTestHeader sets the value of XTestHeader.

type HeadersCombinedOK

type HeadersCombinedOK struct {
	XTestHeader string
}

HeadersCombinedOK is response for HeadersCombined operation.

func (*HeadersCombinedOK) GetXTestHeader

func (s *HeadersCombinedOK) GetXTestHeader() string

GetXTestHeader returns the value of XTestHeader.

func (*HeadersCombinedOK) SetXTestHeader

func (s *HeadersCombinedOK) SetXTestHeader(val string)

SetXTestHeader sets the value of XTestHeader.

type HeadersCombinedParams

type HeadersCombinedParams struct {
	Type HeadersCombinedType
}

HeadersCombinedParams is parameters of headersCombined operation.

type HeadersCombinedRes

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

type HeadersCombinedType

type HeadersCombinedType string
const (
	HeadersCombinedType200     HeadersCombinedType = "200"
	HeadersCombinedTypeDefault HeadersCombinedType = "default"
	HeadersCombinedType4XX     HeadersCombinedType = "4XX"
)

func (HeadersCombinedType) AllValues

AllValues returns all HeadersCombinedType values.

func (HeadersCombinedType) MarshalText

func (s HeadersCombinedType) MarshalText() ([]byte, error)

MarshalText implements encoding.TextMarshaler.

func (*HeadersCombinedType) UnmarshalText

func (s *HeadersCombinedType) UnmarshalText(data []byte) error

UnmarshalText implements encoding.TextUnmarshaler.

func (HeadersCombinedType) Validate

func (s HeadersCombinedType) Validate() error

type HeadersDefaultDef

type HeadersDefaultDef struct {
	XTestHeader string
	StatusCode  int
}

HeadersDefaultDef is default response for HeadersDefault operation.

func (*HeadersDefaultDef) GetStatusCode

func (s *HeadersDefaultDef) GetStatusCode() int

GetStatusCode returns the value of StatusCode.

func (*HeadersDefaultDef) GetXTestHeader

func (s *HeadersDefaultDef) GetXTestHeader() string

GetXTestHeader returns the value of XTestHeader.

func (*HeadersDefaultDef) SetStatusCode

func (s *HeadersDefaultDef) SetStatusCode(val int)

SetStatusCode sets the value of StatusCode.

func (*HeadersDefaultDef) SetXTestHeader

func (s *HeadersDefaultDef) SetXTestHeader(val string)

SetXTestHeader sets the value of XTestHeader.

type HeadersJSONOK

type HeadersJSONOK struct {
	XJSONCustomHeader jx.Raw
	XJSONHeader       User
}

HeadersJSONOK is response for HeadersJSON operation.

func (*HeadersJSONOK) GetXJSONCustomHeader

func (s *HeadersJSONOK) GetXJSONCustomHeader() jx.Raw

GetXJSONCustomHeader returns the value of XJSONCustomHeader.

func (*HeadersJSONOK) GetXJSONHeader

func (s *HeadersJSONOK) GetXJSONHeader() User

GetXJSONHeader returns the value of XJSONHeader.

func (*HeadersJSONOK) SetXJSONCustomHeader

func (s *HeadersJSONOK) SetXJSONCustomHeader(val jx.Raw)

SetXJSONCustomHeader sets the value of XJSONCustomHeader.

func (*HeadersJSONOK) SetXJSONHeader

func (s *HeadersJSONOK) SetXJSONHeader(val User)

SetXJSONHeader sets the value of XJSONHeader.

func (*HeadersJSONOK) Validate

func (s *HeadersJSONOK) Validate() error

type HeadersPattern4XX

type HeadersPattern4XX struct {
	XTestHeader string
	StatusCode  int
}

HeadersPattern4XX is 4XX pattern response for HeadersPattern operation.

func (*HeadersPattern4XX) GetStatusCode

func (s *HeadersPattern4XX) GetStatusCode() int

GetStatusCode returns the value of StatusCode.

func (*HeadersPattern4XX) GetXTestHeader

func (s *HeadersPattern4XX) GetXTestHeader() string

GetXTestHeader returns the value of XTestHeader.

func (*HeadersPattern4XX) SetStatusCode

func (s *HeadersPattern4XX) SetStatusCode(val int)

SetStatusCode sets the value of StatusCode.

func (*HeadersPattern4XX) SetXTestHeader

func (s *HeadersPattern4XX) SetXTestHeader(val string)

SetXTestHeader sets the value of XTestHeader.

type IntersectPatternCode2XXStatusCode

type IntersectPatternCode2XXStatusCode struct {
	StatusCode int
	Response   int
}

IntersectPatternCode2XXStatusCode wraps int with StatusCode.

func (*IntersectPatternCode2XXStatusCode) GetResponse

func (s *IntersectPatternCode2XXStatusCode) GetResponse() int

GetResponse returns the value of Response.

func (*IntersectPatternCode2XXStatusCode) GetStatusCode

func (s *IntersectPatternCode2XXStatusCode) GetStatusCode() int

GetStatusCode returns the value of StatusCode.

func (*IntersectPatternCode2XXStatusCode) SetResponse

func (s *IntersectPatternCode2XXStatusCode) SetResponse(val int)

SetResponse sets the value of Response.

func (*IntersectPatternCode2XXStatusCode) SetStatusCode

func (s *IntersectPatternCode2XXStatusCode) SetStatusCode(val int)

SetStatusCode sets the value of StatusCode.

type IntersectPatternCodeOKApplicationJSON

type IntersectPatternCodeOKApplicationJSON string

func (*IntersectPatternCodeOKApplicationJSON) Decode

Decode decodes IntersectPatternCodeOKApplicationJSON from json.

func (IntersectPatternCodeOKApplicationJSON) Encode

Encode encodes IntersectPatternCodeOKApplicationJSON as json.

func (IntersectPatternCodeOKApplicationJSON) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (*IntersectPatternCodeOKApplicationJSON) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

type IntersectPatternCodeParams

type IntersectPatternCodeParams struct {
	Code int
}

IntersectPatternCodeParams is parameters of intersectPatternCode operation.

type IntersectPatternCodeRes

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

type Invoker

type Invoker interface {
	// AnyContentTypeBinaryStringSchema invokes anyContentTypeBinaryStringSchema operation.
	//
	// GET /anyContentTypeBinaryStringSchema
	AnyContentTypeBinaryStringSchema(ctx context.Context) (*AnyContentTypeBinaryStringSchemaOKHeaders, error)
	// AnyContentTypeBinaryStringSchemaDefault invokes anyContentTypeBinaryStringSchemaDefault operation.
	//
	// GET /anyContentTypeBinaryStringSchemaDefault
	AnyContentTypeBinaryStringSchemaDefault(ctx context.Context) (*AnyContentTypeBinaryStringSchemaDefaultDefStatusCodeWithHeaders, error)
	// Combined invokes combined operation.
	//
	// GET /combined
	Combined(ctx context.Context, params CombinedParams) (CombinedRes, error)
	// Headers200 invokes headers200 operation.
	//
	// GET /headers200
	Headers200(ctx context.Context) (*Headers200OK, error)
	// HeadersCombined invokes headersCombined operation.
	//
	// GET /headersCombined
	HeadersCombined(ctx context.Context, params HeadersCombinedParams) (HeadersCombinedRes, error)
	// HeadersDefault invokes headersDefault operation.
	//
	// GET /headersDefault
	HeadersDefault(ctx context.Context) (*HeadersDefaultDef, error)
	// HeadersJSON invokes headersJSON operation.
	//
	// GET /headersJSON
	HeadersJSON(ctx context.Context) (*HeadersJSONOK, error)
	// HeadersPattern invokes headersPattern operation.
	//
	// GET /headersPattern
	HeadersPattern(ctx context.Context) (*HeadersPattern4XX, error)
	// IntersectPatternCode invokes intersectPatternCode operation.
	//
	// If a response is defined using an explicit code, the explicit code definition takes precedence
	// over the range definition for that code.
	//
	// GET /intersectPatternCode
	IntersectPatternCode(ctx context.Context, params IntersectPatternCodeParams) (IntersectPatternCodeRes, error)
	// MultipleGenericResponses invokes multipleGenericResponses operation.
	//
	// GET /multipleGenericResponses
	MultipleGenericResponses(ctx context.Context) (MultipleGenericResponsesRes, error)
	// OctetStreamBinaryStringSchema invokes octetStreamBinaryStringSchema operation.
	//
	// GET /octetStreamBinaryStringSchema
	OctetStreamBinaryStringSchema(ctx context.Context) (OctetStreamBinaryStringSchemaOK, error)
	// OctetStreamEmptySchema invokes octetStreamEmptySchema operation.
	//
	// GET /octetStreamEmptySchema
	OctetStreamEmptySchema(ctx context.Context) (OctetStreamEmptySchemaOK, error)
	// OptionalHeaders invokes optionalHeaders operation.
	//
	// Https://github.com/jghiloni/ogen/issues/822.
	//
	// GET /optionalHeaders
	OptionalHeaders(ctx context.Context) (*OptionalHeadersOK, error)
	// StreamJSON invokes streamJSON operation.
	//
	// POST /streamJSON
	StreamJSON(ctx context.Context, params StreamJSONParams) (StreamJSONRes, error)
	// TextPlainBinaryStringSchema invokes textPlainBinaryStringSchema operation.
	//
	// GET /textPlainBinaryStringSchema
	TextPlainBinaryStringSchema(ctx context.Context) (TextPlainBinaryStringSchemaOK, 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 Middleware

type Middleware = middleware.Middleware

Middleware is middleware type.

type MultipleGenericResponsesRes

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

type NilInt

type NilInt struct {
	Value int
	Null  bool
}

NilInt is nullable int.

func NewNilInt

func NewNilInt(v int) NilInt

NewNilInt returns new NilInt with value set to v.

func (*NilInt) Decode

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

Decode decodes int from json.

func (NilInt) Encode

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

Encode encodes int as json.

func (NilInt) Get

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

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

func (NilInt) IsNull

func (o NilInt) IsNull() bool

IsSet returns true if value is Null.

func (NilInt) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (NilInt) Or

func (o NilInt) Or(d int) int

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

func (*NilInt) SetTo

func (o *NilInt) SetTo(v int)

SetTo sets value to v.

func (*NilInt) SetToNull

func (o *NilInt) SetToNull()

SetNull sets value to null.

func (*NilInt) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

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

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

MarshalJSON implements stdjson.Marshaler.

func (NilString) Or

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.

func (*NilString) SetToNull

func (o *NilString) SetToNull()

SetNull sets value to null.

func (*NilString) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

type OctetStreamBinaryStringSchemaOK

type OctetStreamBinaryStringSchemaOK struct {
	Data io.Reader
}

func (OctetStreamBinaryStringSchemaOK) Read

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

Read reads data from the Data reader.

Kept to satisfy the io.Reader interface.

type OctetStreamEmptySchemaOK

type OctetStreamEmptySchemaOK struct {
	Data io.Reader
}

func (OctetStreamEmptySchemaOK) Read

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

Read reads data from the Data reader.

Kept to satisfy the io.Reader interface.

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

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

type OptionalHeadersOK struct {
	XOptional OptString
	XRequired string
}

OptionalHeadersOK is response for OptionalHeaders operation.

func (*OptionalHeadersOK) GetXOptional

func (s *OptionalHeadersOK) GetXOptional() OptString

GetXOptional returns the value of XOptional.

func (*OptionalHeadersOK) GetXRequired

func (s *OptionalHeadersOK) GetXRequired() string

GetXRequired returns the value of XRequired.

func (*OptionalHeadersOK) SetXOptional

func (s *OptionalHeadersOK) SetXOptional(val OptString)

SetXOptional sets the value of XOptional.

func (*OptionalHeadersOK) SetXRequired

func (s *OptionalHeadersOK) SetXRequired(val string)

SetXRequired sets the value of XRequired.

type QueryData

type QueryData []float64

func (*QueryData) Decode

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

Decode decodes QueryData from json.

func (QueryData) Encode

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

Encode encodes QueryData as json.

func (QueryData) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (*QueryData) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

func (QueryData) Validate

func (s QueryData) Validate() error

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 StreamJSONParams

type StreamJSONParams struct {
	Count int
}

StreamJSONParams is parameters of streamJSON operation.

type StreamJSONRes

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

type TextPlainBinaryStringSchemaOK

type TextPlainBinaryStringSchemaOK struct {
	Data io.Reader
}

func (TextPlainBinaryStringSchemaOK) Read

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

Read reads data from the Data reader.

Kept to satisfy the io.Reader interface.

type UnimplementedHandler

type UnimplementedHandler struct{}

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

func (UnimplementedHandler) AnyContentTypeBinaryStringSchema

func (UnimplementedHandler) AnyContentTypeBinaryStringSchema(ctx context.Context) (r *AnyContentTypeBinaryStringSchemaOKHeaders, _ error)

AnyContentTypeBinaryStringSchema implements anyContentTypeBinaryStringSchema operation.

GET /anyContentTypeBinaryStringSchema

func (UnimplementedHandler) AnyContentTypeBinaryStringSchemaDefault

AnyContentTypeBinaryStringSchemaDefault implements anyContentTypeBinaryStringSchemaDefault operation.

GET /anyContentTypeBinaryStringSchemaDefault

func (UnimplementedHandler) Combined

func (UnimplementedHandler) Combined(ctx context.Context, params CombinedParams) (r CombinedRes, _ error)

Combined implements combined operation.

GET /combined

func (UnimplementedHandler) Headers200

func (UnimplementedHandler) Headers200(ctx context.Context) (r *Headers200OK, _ error)

Headers200 implements headers200 operation.

GET /headers200

func (UnimplementedHandler) HeadersCombined

HeadersCombined implements headersCombined operation.

GET /headersCombined

func (UnimplementedHandler) HeadersDefault

func (UnimplementedHandler) HeadersDefault(ctx context.Context) (r *HeadersDefaultDef, _ error)

HeadersDefault implements headersDefault operation.

GET /headersDefault

func (UnimplementedHandler) HeadersJSON

func (UnimplementedHandler) HeadersJSON(ctx context.Context) (r *HeadersJSONOK, _ error)

HeadersJSON implements headersJSON operation.

GET /headersJSON

func (UnimplementedHandler) HeadersPattern

func (UnimplementedHandler) HeadersPattern(ctx context.Context) (r *HeadersPattern4XX, _ error)

HeadersPattern implements headersPattern operation.

GET /headersPattern

func (UnimplementedHandler) IntersectPatternCode

IntersectPatternCode implements intersectPatternCode operation.

If a response is defined using an explicit code, the explicit code definition takes precedence over the range definition for that code.

GET /intersectPatternCode

func (UnimplementedHandler) MultipleGenericResponses

func (UnimplementedHandler) MultipleGenericResponses(ctx context.Context) (r MultipleGenericResponsesRes, _ error)

MultipleGenericResponses implements multipleGenericResponses operation.

GET /multipleGenericResponses

func (UnimplementedHandler) OctetStreamBinaryStringSchema

func (UnimplementedHandler) OctetStreamBinaryStringSchema(ctx context.Context) (r OctetStreamBinaryStringSchemaOK, _ error)

OctetStreamBinaryStringSchema implements octetStreamBinaryStringSchema operation.

GET /octetStreamBinaryStringSchema

func (UnimplementedHandler) OctetStreamEmptySchema

func (UnimplementedHandler) OctetStreamEmptySchema(ctx context.Context) (r OctetStreamEmptySchemaOK, _ error)

OctetStreamEmptySchema implements octetStreamEmptySchema operation.

GET /octetStreamEmptySchema

func (UnimplementedHandler) OptionalHeaders

func (UnimplementedHandler) OptionalHeaders(ctx context.Context) (r *OptionalHeadersOK, _ error)

OptionalHeaders implements optionalHeaders operation.

Https://github.com/jghiloni/ogen/issues/822.

GET /optionalHeaders

func (UnimplementedHandler) StreamJSON

StreamJSON implements streamJSON operation.

POST /streamJSON

func (UnimplementedHandler) TextPlainBinaryStringSchema

func (UnimplementedHandler) TextPlainBinaryStringSchema(ctx context.Context) (r TextPlainBinaryStringSchemaOK, _ error)

TextPlainBinaryStringSchema implements textPlainBinaryStringSchema operation.

GET /textPlainBinaryStringSchema

type User

type User struct {
	ID       int      `json:"id"`
	Username string   `json:"username"`
	Role     UserRole `json:"role"`
	Friends  []User   `json:"friends"`
}

Ref: #/components/schemas/User

func (*User) Decode

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

Decode decodes User from json.

func (*User) Encode

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

Encode implements json.Marshaler.

func (*User) GetFriends

func (s *User) GetFriends() []User

GetFriends returns the value of Friends.

func (*User) GetID

func (s *User) GetID() int

GetID returns the value of ID.

func (*User) GetRole

func (s *User) GetRole() UserRole

GetRole returns the value of Role.

func (*User) GetUsername

func (s *User) GetUsername() string

GetUsername returns the value of Username.

func (*User) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (*User) SetFriends

func (s *User) SetFriends(val []User)

SetFriends sets the value of Friends.

func (*User) SetID

func (s *User) SetID(val int)

SetID sets the value of ID.

func (*User) SetRole

func (s *User) SetRole(val UserRole)

SetRole sets the value of Role.

func (*User) SetUsername

func (s *User) SetUsername(val string)

SetUsername sets the value of Username.

func (*User) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

func (*User) Validate

func (s *User) Validate() error

type UserRole

type UserRole string
const (
	UserRoleAdmin UserRole = "admin"
	UserRoleUser  UserRole = "user"
	UserRoleBot   UserRole = "bot"
)

func (UserRole) AllValues

func (UserRole) AllValues() []UserRole

AllValues returns all UserRole values.

func (*UserRole) Decode

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

Decode decodes UserRole from json.

func (UserRole) Encode

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

Encode encodes UserRole as json.

func (UserRole) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (UserRole) MarshalText

func (s UserRole) MarshalText() ([]byte, error)

MarshalText implements encoding.TextMarshaler.

func (*UserRole) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

func (*UserRole) UnmarshalText

func (s *UserRole) UnmarshalText(data []byte) error

UnmarshalText implements encoding.TextUnmarshaler.

func (UserRole) Validate

func (s UserRole) Validate() error

Jump to

Keyboard shortcuts

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