techempower

package
v0.10.1 Latest Latest
Warning

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

Go to latest
Published: Jan 31, 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 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 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.Writer)

Encode implements json.Marshaler.

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

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

Encode implements json.Marshaler.

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

Encode encodes WorldObjects as json.

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