Documentation ¶
Overview ¶
Code generated by ogen, DO NOT EDIT.
Index ¶
- type CachingParams
- type Client
- func (c *Client) Caching(ctx context.Context, params CachingParams) (res WorldObjects, err error)
- func (c *Client) DB(ctx context.Context) (res WorldObject, err error)
- func (c *Client) JSON(ctx context.Context) (res HelloWorld, err error)
- func (c *Client) Queries(ctx context.Context, params QueriesParams) (res WorldObjects, err error)
- func (c *Client) Updates(ctx context.Context, params UpdatesParams) (res WorldObjects, err error)
- type ErrorHandler
- type Handler
- type HelloWorld
- type Middleware
- type Option
- func WithClient(client ht.Client) Option
- func WithErrorHandler(h ErrorHandler) Option
- func WithMaxMultipartMemory(max int64) Option
- func WithMeterProvider(provider metric.MeterProvider) Option
- func WithMethodNotAllowed(methodNotAllowed func(w http.ResponseWriter, r *http.Request, allowed string)) Option
- func WithMiddleware(m ...Middleware) Option
- func WithNotFound(notFound http.HandlerFunc) Option
- func WithTracerProvider(provider trace.TracerProvider) Option
- type QueriesParams
- type Route
- type Server
- type UnimplementedHandler
- func (UnimplementedHandler) Caching(ctx context.Context, params CachingParams) (r WorldObjects, _ error)
- func (UnimplementedHandler) DB(ctx context.Context) (r WorldObject, _ error)
- func (UnimplementedHandler) JSON(ctx context.Context) (r HelloWorld, _ error)
- func (UnimplementedHandler) Queries(ctx context.Context, params QueriesParams) (r WorldObjects, _ error)
- func (UnimplementedHandler) Updates(ctx context.Context, params UpdatesParams) (r WorldObjects, _ error)
- type UpdatesParams
- type WorldObject
- type WorldObjects
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 (*Client) Caching ¶
func (c *Client) Caching(ctx context.Context, params CachingParams) (res WorldObjects, err error)
Caching invokes Caching operation.
Test #7. The Caching test exercises the preferred in-memory or separate-process caching technology for the platform or framework. For implementation simplicity, the requirements are very similar to the multiple database-query test Test #3, but use a separate database table. The requirements are quite generous, affording each framework fairly broad freedom to meet the requirements in the manner that best represents the canonical non-distributed caching approach for the framework. (Note: a distributed caching test type could be added later.).
GET /cached-worlds
func (*Client) DB ¶
func (c *Client) DB(ctx context.Context) (res WorldObject, err error)
DB invokes DB operation.
Test #2. The Single Database Query test exercises the framework's object-relational mapper (ORM), random number generator, database driver, and database connection pool.
GET /db
func (*Client) JSON ¶
func (c *Client) JSON(ctx context.Context) (res HelloWorld, err error)
JSON invokes json operation.
Test #1. The JSON Serialization test exercises the framework fundamentals including keep-alive support, request routing, request header parsing, object instantiation, JSON serialization, response header generation, and request count throughput.
GET /json
func (*Client) Queries ¶
func (c *Client) Queries(ctx context.Context, params QueriesParams) (res WorldObjects, err error)
Queries invokes Queries operation.
Test #3. The Multiple Database Queries test is a variation of Test #2 and also uses the World table. Multiple rows are fetched to more dramatically punish the database driver and connection pool. At the highest queries-per-request tested (20), this test demonstrates all frameworks' convergence toward zero requests-per-second as database activity increases.
GET /queries
func (*Client) Updates ¶
func (c *Client) Updates(ctx context.Context, params UpdatesParams) (res WorldObjects, err error)
Updates invokes Updates operation.
Test #5. The Database Updates test is a variation of Test #3 that exercises the ORM's persistence of objects and the database driver's performance at running UPDATE statements or similar. The spirit of this test is to exercise a variable number of read-then-write style database operations.
GET /updates
type ErrorHandler ¶ added in v0.25.0
type ErrorHandler = ogenerrors.ErrorHandler
ErrorHandler is error handler.
type Handler ¶
type Handler interface { // Caching implements Caching operation. // // Test #7. The Caching test exercises the preferred in-memory or separate-process caching technology // for the platform or framework. For implementation simplicity, the requirements are very similar to // the multiple database-query test Test #3, but use a separate database table. The requirements are // quite generous, affording each framework fairly broad freedom to meet the requirements in the // manner that best represents the canonical non-distributed caching approach for the framework. // (Note: a distributed caching test type could be added later.). // // GET /cached-worlds Caching(ctx context.Context, params CachingParams) (WorldObjects, error) // DB implements DB operation. // // Test #2. The Single Database Query test exercises the framework's object-relational mapper (ORM), // random number generator, database driver, and database connection pool. // // GET /db DB(ctx context.Context) (WorldObject, error) // JSON implements json operation. // // Test #1. The JSON Serialization test exercises the framework fundamentals including keep-alive // support, request routing, request header parsing, object instantiation, JSON serialization, // response header generation, and request count throughput. // // GET /json JSON(ctx context.Context) (HelloWorld, error) // Queries implements Queries operation. // // Test #3. The Multiple Database Queries test is a variation of Test #2 and also uses the World // table. Multiple rows are fetched to more dramatically punish the database driver and connection // pool. At the highest queries-per-request tested (20), this test demonstrates all frameworks' // convergence toward zero requests-per-second as database activity increases. // // GET /queries Queries(ctx context.Context, params QueriesParams) (WorldObjects, error) // Updates implements Updates operation. // // Test #5. The Database Updates test is a variation of Test #3 that exercises the ORM's persistence // of objects and the database driver's performance at running UPDATE statements or similar. The // spirit of this test is to exercise a variable number of read-then-write style database operations. // // 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 Middleware ¶ added in v0.49.0
type Middleware = middleware.Middleware
Middleware is middleware type.
type Option ¶
type Option interface {
// contains filtered or unexported methods
}
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
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 ¶ 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 WithMethodNotAllowed ¶ added in v0.46.0
func WithMethodNotAllowed(methodNotAllowed func(w http.ResponseWriter, r *http.Request, allowed string)) Option
WithMethodNotAllowed specifies Method Not Allowed handler to use.
func WithMiddleware ¶ added in v0.49.0
func WithMiddleware(m ...Middleware) Option
WithMiddleware specifies middlewares to use.
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) Name ¶ added in v0.46.0
Name returns ogen operation name.
It is guaranteed to be unique and not empty.
func (Route) OperationID ¶ added in v0.8.0
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.
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
func (UnimplementedHandler) Caching(ctx context.Context, params CachingParams) (r WorldObjects, _ error)
Caching implements Caching operation.
Test #7. The Caching test exercises the preferred in-memory or separate-process caching technology for the platform or framework. For implementation simplicity, the requirements are very similar to the multiple database-query test Test #3, but use a separate database table. The requirements are quite generous, affording each framework fairly broad freedom to meet the requirements in the manner that best represents the canonical non-distributed caching approach for the framework. (Note: a distributed caching test type could be added later.).
GET /cached-worlds
func (UnimplementedHandler) DB ¶ added in v0.18.0
func (UnimplementedHandler) DB(ctx context.Context) (r WorldObject, _ error)
DB implements DB operation.
Test #2. The Single Database Query test exercises the framework's object-relational mapper (ORM), random number generator, database driver, and database connection pool.
GET /db
func (UnimplementedHandler) JSON ¶ added in v0.18.0
func (UnimplementedHandler) JSON(ctx context.Context) (r HelloWorld, _ error)
JSON implements json operation.
Test #1. The JSON Serialization test exercises the framework fundamentals including keep-alive support, request routing, request header parsing, object instantiation, JSON serialization, response header generation, and request count throughput.
GET /json
func (UnimplementedHandler) Queries ¶ added in v0.18.0
func (UnimplementedHandler) Queries(ctx context.Context, params QueriesParams) (r WorldObjects, _ error)
Queries implements Queries operation.
Test #3. The Multiple Database Queries test is a variation of Test #2 and also uses the World table. Multiple rows are fetched to more dramatically punish the database driver and connection pool. At the highest queries-per-request tested (20), this test demonstrates all frameworks' convergence toward zero requests-per-second as database activity increases.
GET /queries
func (UnimplementedHandler) Updates ¶ added in v0.18.0
func (UnimplementedHandler) Updates(ctx context.Context, params UpdatesParams) (r WorldObjects, _ error)
Updates implements Updates operation.
Test #5. The Database Updates test is a variation of Test #3 that exercises the ORM's persistence of objects and the database driver's performance at running UPDATE statements or similar. The spirit of this test is to exercise a variable number of read-then-write style database operations.
GET /updates
type UpdatesParams ¶
type UpdatesParams struct {
Queries int64
}
type WorldObject ¶
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
Source Files ¶
- oas_cfg_gen.go
- oas_client_gen.go
- oas_defaults_gen.go
- oas_faker_gen.go
- oas_handlers_gen.go
- oas_interfaces_gen.go
- oas_json_gen.go
- oas_middleware_gen.go
- oas_parameters_gen.go
- oas_request_decoders_gen.go
- oas_request_encoders_gen.go
- oas_response_decoders_gen.go
- oas_response_encoders_gen.go
- oas_router_gen.go
- oas_schemas_gen.go
- oas_security_gen.go
- oas_server_gen.go
- oas_unimplemented_gen.go
- oas_validators_gen.go