api

package
v0.22.0 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2022 License: Apache-2.0 Imports: 32 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) 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

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

Handler handles operations described by OpenAPI v3 specification.

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

func (s *NilInt) SetFake()

SetFake set fake values.

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

func (s *NilString) SetFake()

SetFake set fake values.

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

Jump to

Keyboard shortcuts

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