api

package
v0.44.0 Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2022 License: Apache-2.0 Imports: 27 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 AllRequestBodiesApplicationJSON

type AllRequestBodiesApplicationJSON SimpleObject

func (*AllRequestBodiesApplicationJSON) Decode

Decode decodes AllRequestBodiesApplicationJSON from json.

func (AllRequestBodiesApplicationJSON) Encode

Encode encodes AllRequestBodiesApplicationJSON as json.

func (AllRequestBodiesApplicationJSON) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (*AllRequestBodiesApplicationJSON) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

type AllRequestBodiesApplicationXWwwFormUrlencoded

type AllRequestBodiesApplicationXWwwFormUrlencoded SimpleObject

func (*AllRequestBodiesApplicationXWwwFormUrlencoded) Decode

Decode decodes AllRequestBodiesApplicationXWwwFormUrlencoded from json.

func (AllRequestBodiesApplicationXWwwFormUrlencoded) Encode

Encode encodes AllRequestBodiesApplicationXWwwFormUrlencoded as json.

func (AllRequestBodiesApplicationXWwwFormUrlencoded) MarshalJSON

MarshalJSON implements stdjson.Marshaler.

func (*AllRequestBodiesApplicationXWwwFormUrlencoded) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

type AllRequestBodiesMultipartFormData

type AllRequestBodiesMultipartFormData SimpleObject

func (*AllRequestBodiesMultipartFormData) Decode

Decode decodes AllRequestBodiesMultipartFormData from json.

func (AllRequestBodiesMultipartFormData) Encode

Encode encodes AllRequestBodiesMultipartFormData as json.

func (AllRequestBodiesMultipartFormData) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (*AllRequestBodiesMultipartFormData) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

type AllRequestBodiesOK

type AllRequestBodiesOK struct {
	Data io.Reader
}

func (AllRequestBodiesOK) Read

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

type AllRequestBodiesOptionalApplicationJSON

type AllRequestBodiesOptionalApplicationJSON OptSimpleObject

func (*AllRequestBodiesOptionalApplicationJSON) Decode

Decode decodes AllRequestBodiesOptionalApplicationJSON from json.

func (AllRequestBodiesOptionalApplicationJSON) Encode

Encode encodes AllRequestBodiesOptionalApplicationJSON as json.

func (AllRequestBodiesOptionalApplicationJSON) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (*AllRequestBodiesOptionalApplicationJSON) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

type AllRequestBodiesOptionalApplicationXWwwFormUrlencoded

type AllRequestBodiesOptionalApplicationXWwwFormUrlencoded OptSimpleObject

func (*AllRequestBodiesOptionalApplicationXWwwFormUrlencoded) Decode

Decode decodes AllRequestBodiesOptionalApplicationXWwwFormUrlencoded from json.

func (AllRequestBodiesOptionalApplicationXWwwFormUrlencoded) Encode

Encode encodes AllRequestBodiesOptionalApplicationXWwwFormUrlencoded as json.

func (AllRequestBodiesOptionalApplicationXWwwFormUrlencoded) MarshalJSON

MarshalJSON implements stdjson.Marshaler.

func (*AllRequestBodiesOptionalApplicationXWwwFormUrlencoded) UnmarshalJSON

UnmarshalJSON implements stdjson.Unmarshaler.

type AllRequestBodiesOptionalMultipartFormData

type AllRequestBodiesOptionalMultipartFormData OptSimpleObject

func (*AllRequestBodiesOptionalMultipartFormData) Decode

Decode decodes AllRequestBodiesOptionalMultipartFormData from json.

func (AllRequestBodiesOptionalMultipartFormData) Encode

Encode encodes AllRequestBodiesOptionalMultipartFormData as json.

func (AllRequestBodiesOptionalMultipartFormData) MarshalJSON

MarshalJSON implements stdjson.Marshaler.

func (*AllRequestBodiesOptionalMultipartFormData) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

type AllRequestBodiesOptionalOK

type AllRequestBodiesOptionalOK struct {
	Data io.Reader
}

func (AllRequestBodiesOptionalOK) Read

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

type AllRequestBodiesOptionalReq

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

type AllRequestBodiesOptionalReqApplicationOctetStream

type AllRequestBodiesOptionalReqApplicationOctetStream struct {
	Data io.Reader
}

func (AllRequestBodiesOptionalReqApplicationOctetStream) Read

type AllRequestBodiesOptionalReqTextPlain

type AllRequestBodiesOptionalReqTextPlain struct {
	Data io.Reader
}

func (AllRequestBodiesOptionalReqTextPlain) Read

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

type AllRequestBodiesReq

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

type AllRequestBodiesReqApplicationOctetStream

type AllRequestBodiesReqApplicationOctetStream struct {
	Data io.Reader
}

func (AllRequestBodiesReqApplicationOctetStream) Read

type AllRequestBodiesReqTextPlain

type AllRequestBodiesReqTextPlain struct {
	Data io.Reader
}

func (AllRequestBodiesReqTextPlain) Read

func (s AllRequestBodiesReqTextPlain) 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) AllRequestBodies

func (c *Client) AllRequestBodies(ctx context.Context, request AllRequestBodiesReq) (res AllRequestBodiesOK, err error)

AllRequestBodies invokes allRequestBodies operation.

POST /allRequestBodies

func (*Client) AllRequestBodiesOptional

func (c *Client) AllRequestBodiesOptional(ctx context.Context, request AllRequestBodiesOptionalReq) (res AllRequestBodiesOptionalOK, err error)

AllRequestBodiesOptional invokes allRequestBodiesOptional operation.

POST /allRequestBodiesOptional

type ErrorHandler

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

ErrorHandler is error handler.

type Handler

type Handler interface {
	// AllRequestBodies implements allRequestBodies operation.
	//
	// POST /allRequestBodies
	AllRequestBodies(ctx context.Context, req AllRequestBodiesReq) (AllRequestBodiesOK, error)
	// AllRequestBodiesOptional implements allRequestBodiesOptional operation.
	//
	// POST /allRequestBodiesOptional
	AllRequestBodiesOptional(ctx context.Context, req AllRequestBodiesOptionalReq) (AllRequestBodiesOptionalOK, error)
}

Handler handles operations described by OpenAPI v3 specification.

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 OptSimpleObject

type OptSimpleObject struct {
	Value SimpleObject
	Set   bool
}

OptSimpleObject is optional SimpleObject.

func NewOptSimpleObject

func NewOptSimpleObject(v SimpleObject) OptSimpleObject

NewOptSimpleObject returns new OptSimpleObject with value set to v.

func (*OptSimpleObject) Decode

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

Decode decodes SimpleObject from json.

func (OptSimpleObject) Encode

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

Encode encodes SimpleObject as json.

func (OptSimpleObject) Get

func (o OptSimpleObject) Get() (v SimpleObject, ok bool)

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

func (OptSimpleObject) IsSet

func (o OptSimpleObject) IsSet() bool

IsSet returns true if OptSimpleObject was set.

func (OptSimpleObject) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (OptSimpleObject) Or

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

func (*OptSimpleObject) Reset

func (o *OptSimpleObject) Reset()

Reset unsets value.

func (*OptSimpleObject) SetTo

func (o *OptSimpleObject) SetTo(v SimpleObject)

SetTo sets value to v.

func (*OptSimpleObject) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

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

func WithErrorHandler(h ErrorHandler) Option

WithErrorHandler specifies error handler to use.

func WithMaxMultipartMemory

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 SimpleObject

type SimpleObject struct {
	Name string "json:\"name\""
	Age  OptInt "json:\"age\""
}

Ref: #/components/schemas/SimpleObject

func (*SimpleObject) Decode

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

Decode decodes SimpleObject from json.

func (SimpleObject) Encode

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

Encode implements json.Marshaler.

func (SimpleObject) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (*SimpleObject) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

type UnimplementedHandler

type UnimplementedHandler struct{}

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

func (UnimplementedHandler) AllRequestBodies

AllRequestBodies implements allRequestBodies operation.

POST /allRequestBodies

func (UnimplementedHandler) AllRequestBodiesOptional

AllRequestBodiesOptional implements allRequestBodiesOptional operation.

POST /allRequestBodiesOptional

Jump to

Keyboard shortcuts

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