techempower

package
v0.25.0 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2022 License: Apache-2.0 Imports: 34 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 CachingParams

type CachingParams struct {
	Count int64
}

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

func (c *Client) Caching(ctx context.Context, params CachingParams) (res WorldObjects, err error)

Caching invokes Caching operation.

GET /cached-worlds

func (*Client) DB

func (c *Client) DB(ctx context.Context) (res WorldObject, err error)

DB invokes DB operation.

GET /db

func (*Client) JSON

func (c *Client) JSON(ctx context.Context) (res HelloWorld, err error)

JSON invokes json operation.

GET /json

func (*Client) Queries

func (c *Client) Queries(ctx context.Context, params QueriesParams) (res WorldObjects, err error)

Queries invokes Queries operation.

GET /queries

func (*Client) Updates

func (c *Client) Updates(ctx context.Context, params UpdatesParams) (res WorldObjects, err error)

Updates invokes Updates operation.

GET /updates

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 {
	// Caching implements Caching operation.
	//
	// GET /cached-worlds
	Caching(ctx context.Context, params CachingParams) (WorldObjects, error)
	// DB implements DB operation.
	//
	// GET /db
	DB(ctx context.Context) (WorldObject, error)
	// JSON implements json operation.
	//
	// GET /json
	JSON(ctx context.Context) (HelloWorld, error)
	// Queries implements Queries operation.
	//
	// GET /queries
	Queries(ctx context.Context, params QueriesParams) (WorldObjects, error)
	// Updates implements Updates operation.
	//
	// GET /updates
	Updates(ctx context.Context, params UpdatesParams) (WorldObjects, error)
}

Handler handles operations described by OpenAPI v3 specification.

type HelloWorld

type HelloWorld struct {
	// Should be equal to 'Hello, World!'.
	Message string "json:\"message\""
}

Ref: #/components/schemas/HelloWorld

func (*HelloWorld) Decode

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

Decode decodes HelloWorld from json.

func (HelloWorld) Encode

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

Encode implements json.Marshaler.

func (HelloWorld) MarshalJSON added in v0.20.0

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

MarshalJSON implements stdjson.Marshaler.

func (*HelloWorld) SetFake added in v0.19.0

func (s *HelloWorld) SetFake()

SetFake set fake values.

func (*HelloWorld) UnmarshalJSON added in v0.20.0

func (s *HelloWorld) 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 added in v0.25.0

func WithErrorHandler(h ErrorHandler) Option

WithErrorHandler specifies error handler to use.

func WithMeterProvider added in v0.13.0

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

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 QueriesParams

type QueriesParams struct {
	Queries int64
}

type Route added in v0.8.0

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

Route is route object.

func (Route) Args added in v0.8.0

func (r Route) Args() []string

Args returns parsed arguments.

func (Route) OperationID added in v0.8.0

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

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

type UnimplementedHandler struct{}

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

func (UnimplementedHandler) Caching added in v0.18.0

Caching implements Caching operation.

GET /cached-worlds

func (UnimplementedHandler) DB added in v0.18.0

DB implements DB operation.

GET /db

func (UnimplementedHandler) JSON added in v0.18.0

JSON implements json operation.

GET /json

func (UnimplementedHandler) Queries added in v0.18.0

Queries implements Queries operation.

GET /queries

func (UnimplementedHandler) Updates added in v0.18.0

Updates implements Updates operation.

GET /updates

type UpdatesParams

type UpdatesParams struct {
	Queries int64
}

type WorldObject

type WorldObject struct {
	ID           int64 "json:\"id\""
	RandomNumber int64 "json:\"randomNumber\""
}

Ref: #/components/schemas/WorldObject

func (*WorldObject) Decode

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

Decode decodes WorldObject from json.

func (WorldObject) Encode

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

Encode implements json.Marshaler.

func (WorldObject) MarshalJSON added in v0.20.0

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

MarshalJSON implements stdjson.Marshaler.

func (*WorldObject) SetFake added in v0.19.0

func (s *WorldObject) SetFake()

SetFake set fake values.

func (*WorldObject) UnmarshalJSON added in v0.20.0

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

UnmarshalJSON implements stdjson.Unmarshaler.

type WorldObjects

type WorldObjects []WorldObject

func (*WorldObjects) Decode

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

Decode decodes WorldObjects from json.

func (WorldObjects) Encode

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

Encode encodes WorldObjects as json.

func (WorldObjects) MarshalJSON added in v0.20.0

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

MarshalJSON implements stdjson.Marshaler.

func (*WorldObjects) SetFake added in v0.19.0

func (s *WorldObjects) SetFake()

SetFake set fake values.

func (*WorldObjects) UnmarshalJSON added in v0.20.0

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

UnmarshalJSON implements stdjson.Unmarshaler.

func (WorldObjects) Validate

func (s WorldObjects) Validate() error

Jump to

Keyboard shortcuts

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