api

package
v0.45.0 Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2022 License: Apache-2.0 Imports: 24 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 AnyContentTypeBinaryStringSchemaDefaultDef

type AnyContentTypeBinaryStringSchemaDefaultDef struct {
	Data io.Reader
}

func (AnyContentTypeBinaryStringSchemaDefaultDef) Read

type AnyContentTypeBinaryStringSchemaDefaultDefStatusCode

type AnyContentTypeBinaryStringSchemaDefaultDefStatusCode struct {
	StatusCode int
	Response   AnyContentTypeBinaryStringSchemaDefaultDef
}

AnyContentTypeBinaryStringSchemaDefaultDefStatusCode wraps AnyContentTypeBinaryStringSchemaDefaultDef with StatusCode.

type AnyContentTypeBinaryStringSchemaOK

type AnyContentTypeBinaryStringSchemaOK struct {
	Data io.Reader
}

func (AnyContentTypeBinaryStringSchemaOK) Read

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

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

func (c *Client) AnyContentTypeBinaryStringSchema(ctx context.Context) (res AnyContentTypeBinaryStringSchemaOK, err error)

AnyContentTypeBinaryStringSchema invokes anyContentTypeBinaryStringSchema operation.

GET /anyContentTypeBinaryStringSchema

func (*Client) AnyContentTypeBinaryStringSchemaDefault

func (c *Client) AnyContentTypeBinaryStringSchemaDefault(ctx context.Context) (res AnyContentTypeBinaryStringSchemaDefaultDefStatusCode, err error)

AnyContentTypeBinaryStringSchemaDefault invokes anyContentTypeBinaryStringSchemaDefault operation.

GET /anyContentTypeBinaryStringSchemaDefault

func (*Client) Combined added in v0.44.0

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

Combined invokes combined operation.

GET /combined

func (*Client) Headers200 added in v0.34.0

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

Headers200 invokes headers200 operation.

GET /headers200

func (*Client) HeadersCombined added in v0.34.0

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

HeadersCombined invokes headersCombined operation.

GET /headersCombined

func (*Client) HeadersDefault added in v0.34.0

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

HeadersDefault invokes headersDefault operation.

GET /headersDefault

func (*Client) HeadersPattern added in v0.44.0

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

HeadersPattern invokes headersPattern operation.

GET /headersPattern

func (*Client) IntersectPatternCode added in v0.44.0

func (c *Client) IntersectPatternCode(ctx context.Context, params IntersectPatternCodeParams) (res IntersectPatternCodeRes, err 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) (res MultipleGenericResponsesRes, err error)

MultipleGenericResponses invokes multipleGenericResponses operation.

GET /multipleGenericResponses

func (*Client) OctetStreamBinaryStringSchema

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

OctetStreamBinaryStringSchema invokes octetStreamBinaryStringSchema operation.

GET /octetStreamBinaryStringSchema

func (*Client) OctetStreamEmptySchema

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

OctetStreamEmptySchema invokes octetStreamEmptySchema operation.

GET /octetStreamEmptySchema

func (*Client) TextPlainBinaryStringSchema added in v0.42.0

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

TextPlainBinaryStringSchema invokes textPlainBinaryStringSchema operation.

GET /textPlainBinaryStringSchema

type Combined2XXStatusCode added in v0.44.0

type Combined2XXStatusCode struct {
	StatusCode int
	Response   int
}

Combined2XXStatusCode wraps int with StatusCode.

type Combined5XXStatusCode added in v0.44.0

type Combined5XXStatusCode struct {
	StatusCode int
	Response   bool
}

Combined5XXStatusCode wraps bool with StatusCode.

type CombinedDefStatusCode added in v0.44.0

type CombinedDefStatusCode struct {
	StatusCode int
	Response   []string
}

CombinedDefStatusCode wraps []string with StatusCode.

func (CombinedDefStatusCode) Validate added in v0.44.0

func (s CombinedDefStatusCode) Validate() error

type CombinedOK added in v0.44.0

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

func (*CombinedOK) Decode added in v0.44.0

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

Decode decodes CombinedOK from json.

func (CombinedOK) Encode added in v0.44.0

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

Encode implements json.Marshaler.

func (CombinedOK) MarshalJSON added in v0.44.0

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

MarshalJSON implements stdjson.Marshaler.

func (*CombinedOK) UnmarshalJSON added in v0.44.0

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

UnmarshalJSON implements stdjson.Unmarshaler.

type CombinedParams added in v0.44.0

type CombinedParams struct {
	Type CombinedType
}

type CombinedRes added in v0.44.0

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

type CombinedType added in v0.44.0

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

func (CombinedType) Validate added in v0.44.0

func (s CombinedType) Validate() error

type ErrorHandler added in v0.25.0

type ErrorHandler func(ctx context.Context, w http.ResponseWriter, r *http.Request, err error)

ErrorHandler is error handler.

type Handler

type Handler interface {
	// AnyContentTypeBinaryStringSchema implements anyContentTypeBinaryStringSchema operation.
	//
	// GET /anyContentTypeBinaryStringSchema
	AnyContentTypeBinaryStringSchema(ctx context.Context) (AnyContentTypeBinaryStringSchemaOK, error)
	// AnyContentTypeBinaryStringSchemaDefault implements anyContentTypeBinaryStringSchemaDefault operation.
	//
	// GET /anyContentTypeBinaryStringSchemaDefault
	AnyContentTypeBinaryStringSchemaDefault(ctx context.Context) (AnyContentTypeBinaryStringSchemaDefaultDefStatusCode, 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)
	// 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)
	// TextPlainBinaryStringSchema implements textPlainBinaryStringSchema operation.
	//
	// GET /textPlainBinaryStringSchema
	TextPlainBinaryStringSchema(ctx context.Context) (TextPlainBinaryStringSchemaOK, error)
}

Handler handles operations described by OpenAPI v3 specification.

type Headers200OK added in v0.34.0

type Headers200OK struct {
	TestHeader string
}

Headers200OK is response for Headers200 operation.

type HeadersCombined4XX added in v0.44.0

type HeadersCombined4XX struct {
	TestHeader string
	StatusCode int
}

HeadersCombined4XX is 4XX pattern response for HeadersCombined operation.

type HeadersCombinedDef added in v0.34.0

type HeadersCombinedDef struct {
	TestHeader string
	StatusCode int
}

HeadersCombinedDef is default response for HeadersCombined operation.

type HeadersCombinedOK added in v0.34.0

type HeadersCombinedOK struct {
	TestHeader string
}

HeadersCombinedOK is response for HeadersCombined operation.

type HeadersCombinedParams added in v0.34.0

type HeadersCombinedParams struct {
	Type HeadersCombinedType
}

type HeadersCombinedRes added in v0.34.0

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

type HeadersCombinedType added in v0.44.0

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

func (HeadersCombinedType) Validate added in v0.44.0

func (s HeadersCombinedType) Validate() error

type HeadersDefaultDef added in v0.34.0

type HeadersDefaultDef struct {
	TestHeader string
	StatusCode int
}

HeadersDefaultDef is default response for HeadersDefault operation.

type HeadersPattern4XX added in v0.44.0

type HeadersPattern4XX struct {
	TestHeader string
	StatusCode int
}

HeadersPattern4XX is 4XX pattern response for HeadersPattern operation.

type IntersectPatternCode2XXStatusCode added in v0.44.0

type IntersectPatternCode2XXStatusCode struct {
	StatusCode int
	Response   int
}

IntersectPatternCode2XXStatusCode wraps int with StatusCode.

type IntersectPatternCodeOKApplicationJSON added in v0.44.0

type IntersectPatternCodeOKApplicationJSON string

func (*IntersectPatternCodeOKApplicationJSON) Decode added in v0.44.0

Decode decodes IntersectPatternCodeOKApplicationJSON from json.

func (IntersectPatternCodeOKApplicationJSON) Encode added in v0.44.0

Encode encodes IntersectPatternCodeOKApplicationJSON as json.

func (IntersectPatternCodeOKApplicationJSON) MarshalJSON added in v0.44.0

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

MarshalJSON implements stdjson.Marshaler.

func (*IntersectPatternCodeOKApplicationJSON) UnmarshalJSON added in v0.44.0

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

UnmarshalJSON implements stdjson.Unmarshaler.

type IntersectPatternCodeParams added in v0.44.0

type IntersectPatternCodeParams struct {
	Code int
}

type IntersectPatternCodeRes added in v0.44.0

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

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 added in v0.20.0

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) UnmarshalJSON added in v0.20.0

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 added in v0.20.0

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) UnmarshalJSON added in v0.20.0

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)

type OctetStreamEmptySchemaOK

type OctetStreamEmptySchemaOK struct {
	Data io.Reader
}

func (OctetStreamEmptySchemaOK) Read

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

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 WithErrorHandler added in v0.25.0

func WithErrorHandler(h ErrorHandler) Option

WithErrorHandler specifies error handler to use.

func WithMaxMultipartMemory added in v0.34.0

func WithMaxMultipartMemory(max int64) Option

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 WithMeterProvider

func WithMeterProvider(provider metric.MeterProvider) Option

WithMeterProvider specifies a meter provider to use for creating a meter.

If none is specified, the metric.NewNoopMeterProvider is used.

func WithNotFound

func WithNotFound(notFound http.HandlerFunc) Option

WithNotFound specifies Not Found handler 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 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) OperationID

func (r Route) OperationID() string

OperationID returns OpenAPI operationId.

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

func (*Server) FindRoute

func (s *Server) FindRoute(method, path string) (r Route, _ bool)

FindRoute finds Route for given method and path.

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 TextPlainBinaryStringSchemaOK added in v0.42.0

type TextPlainBinaryStringSchemaOK struct {
	Data io.Reader
}

func (TextPlainBinaryStringSchemaOK) Read added in v0.42.0

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

type UnimplementedHandler

type UnimplementedHandler struct{}

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

func (UnimplementedHandler) AnyContentTypeBinaryStringSchema

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

AnyContentTypeBinaryStringSchema implements anyContentTypeBinaryStringSchema operation.

GET /anyContentTypeBinaryStringSchema

func (UnimplementedHandler) AnyContentTypeBinaryStringSchemaDefault

func (UnimplementedHandler) AnyContentTypeBinaryStringSchemaDefault(ctx context.Context) (r AnyContentTypeBinaryStringSchemaDefaultDefStatusCode, _ error)

AnyContentTypeBinaryStringSchemaDefault implements anyContentTypeBinaryStringSchemaDefault operation.

GET /anyContentTypeBinaryStringSchemaDefault

func (UnimplementedHandler) Combined added in v0.44.0

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

Combined implements combined operation.

GET /combined

func (UnimplementedHandler) Headers200 added in v0.34.0

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

Headers200 implements headers200 operation.

GET /headers200

func (UnimplementedHandler) HeadersCombined added in v0.34.0

HeadersCombined implements headersCombined operation.

GET /headersCombined

func (UnimplementedHandler) HeadersDefault added in v0.34.0

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

HeadersDefault implements headersDefault operation.

GET /headersDefault

func (UnimplementedHandler) HeadersPattern added in v0.44.0

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

HeadersPattern implements headersPattern operation.

GET /headersPattern

func (UnimplementedHandler) IntersectPatternCode added in v0.44.0

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) TextPlainBinaryStringSchema added in v0.42.0

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

TextPlainBinaryStringSchema implements textPlainBinaryStringSchema operation.

GET /textPlainBinaryStringSchema

Jump to

Keyboard shortcuts

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