Documentation
¶
Overview ¶
Code generated by ogen, DO NOT EDIT.
Index ¶
- func WithServerURL(ctx context.Context, u *url.URL) context.Context
- type Client
- func (c *Client) GetServer(ctx context.Context, params GetServerParams) (GetServerRes, error)
- func (c *Client) ListMultiplayerSummaries(ctx context.Context, params ListMultiplayerSummariesParams) ([]MultiplayerSummary, error)
- func (c *Client) ListServerStatistics(ctx context.Context, params ListServerStatisticsParams) (ListServerStatisticsRes, error)
- func (c *Client) ListServerSummaries(ctx context.Context, params ListServerSummariesParams) (ListServerSummariesRes, error)
- type ClientOption
- type DetailedServer
- func (s *DetailedServer) Decode(d *jx.Decoder) error
- func (s *DetailedServer) Encode(e *jx.Encoder)
- func (s *DetailedServer) GetCollectedAt() OptDateTime
- func (s *DetailedServer) GetGamemode() OptString
- func (s *DetailedServer) GetLanguage() OptString
- func (s *DetailedServer) GetName() string
- func (s *DetailedServer) GetPlayersCount() OptInt64
- func (s *DetailedServer) GetURL() OptString
- func (s *DetailedServer) MarshalJSON() ([]byte, error)
- func (s *DetailedServer) SetCollectedAt(val OptDateTime)
- func (s *DetailedServer) SetGamemode(val OptString)
- func (s *DetailedServer) SetLanguage(val OptString)
- func (s *DetailedServer) SetName(val string)
- func (s *DetailedServer) SetPlayersCount(val OptInt64)
- func (s *DetailedServer) SetURL(val OptString)
- func (s *DetailedServer) UnmarshalJSON(data []byte) error
- type ErrorHandler
- type GetServerNotFound
- type GetServerParams
- type GetServerRes
- type Handler
- type Invoker
- type Labeler
- type ListMultiplayerSummariesParams
- type ListServerStatisticsNotFound
- type ListServerStatisticsOKApplicationJSON
- func (s *ListServerStatisticsOKApplicationJSON) Decode(d *jx.Decoder) error
- func (s ListServerStatisticsOKApplicationJSON) Encode(e *jx.Encoder)
- func (s ListServerStatisticsOKApplicationJSON) MarshalJSON() ([]byte, error)
- func (s *ListServerStatisticsOKApplicationJSON) UnmarshalJSON(data []byte) error
- func (s ListServerStatisticsOKApplicationJSON) Validate() error
- type ListServerStatisticsParams
- type ListServerStatisticsPrecision
- type ListServerStatisticsRes
- type ListServerSummariesNotFound
- type ListServerSummariesOKApplicationJSON
- func (s *ListServerSummariesOKApplicationJSON) Decode(d *jx.Decoder) error
- func (s ListServerSummariesOKApplicationJSON) Encode(e *jx.Encoder)
- func (s ListServerSummariesOKApplicationJSON) MarshalJSON() ([]byte, error)
- func (s *ListServerSummariesOKApplicationJSON) UnmarshalJSON(data []byte) error
- func (s ListServerSummariesOKApplicationJSON) Validate() error
- type ListServerSummariesParams
- type ListServerSummariesRes
- type Middleware
- type MultiplayerSummary
- func (s *MultiplayerSummary) Decode(d *jx.Decoder) error
- func (s *MultiplayerSummary) Encode(e *jx.Encoder)
- func (s *MultiplayerSummary) GetName() string
- func (s *MultiplayerSummary) GetPlayersCount() int64
- func (s *MultiplayerSummary) MarshalJSON() ([]byte, error)
- func (s *MultiplayerSummary) SetName(val string)
- func (s *MultiplayerSummary) SetPlayersCount(val int64)
- func (s *MultiplayerSummary) UnmarshalJSON(data []byte) error
- type OperationName
- type OptBool
- type OptDateTime
- func (o *OptDateTime) Decode(d *jx.Decoder, format func(*jx.Decoder) (time.Time, error)) error
- func (o OptDateTime) Encode(e *jx.Encoder, format func(*jx.Encoder, time.Time))
- func (o OptDateTime) Get() (v time.Time, ok bool)
- func (o OptDateTime) IsSet() bool
- func (s OptDateTime) MarshalJSON() ([]byte, error)
- func (o OptDateTime) Or(d time.Time) time.Time
- func (o *OptDateTime) Reset()
- func (o *OptDateTime) SetTo(v time.Time)
- func (s *OptDateTime) UnmarshalJSON(data []byte) error
- type OptInt32
- type OptInt64
- func (o *OptInt64) Decode(d *jx.Decoder) error
- func (o OptInt64) Encode(e *jx.Encoder)
- func (o OptInt64) Get() (v int64, ok bool)
- func (o OptInt64) IsSet() bool
- func (s OptInt64) MarshalJSON() ([]byte, error)
- func (o OptInt64) Or(d int64) int64
- func (o *OptInt64) Reset()
- func (o *OptInt64) SetTo(v int64)
- func (s *OptInt64) UnmarshalJSON(data []byte) error
- type OptListServerStatisticsPrecision
- func (o OptListServerStatisticsPrecision) Get() (v ListServerStatisticsPrecision, ok bool)
- func (o OptListServerStatisticsPrecision) IsSet() bool
- func (o OptListServerStatisticsPrecision) Or(d ListServerStatisticsPrecision) ListServerStatisticsPrecision
- func (o *OptListServerStatisticsPrecision) Reset()
- func (o *OptListServerStatisticsPrecision) SetTo(v ListServerStatisticsPrecision)
- type OptString
- func (o *OptString) Decode(d *jx.Decoder) error
- func (o OptString) Encode(e *jx.Encoder)
- func (o OptString) Get() (v string, ok bool)
- func (o OptString) IsSet() bool
- func (s OptString) MarshalJSON() ([]byte, error)
- func (o OptString) Or(d string) string
- func (o *OptString) Reset()
- func (o *OptString) SetTo(v string)
- func (s *OptString) UnmarshalJSON(data []byte) error
- type Option
- type Route
- type Server
- type ServerOption
- func WithErrorHandler(h ErrorHandler) ServerOption
- func WithMaxMultipartMemory(max int64) ServerOption
- func WithMethodNotAllowed(methodNotAllowed func(w http.ResponseWriter, r *http.Request, allowed string)) ServerOption
- func WithMiddleware(m ...Middleware) ServerOption
- func WithNotFound(notFound http.HandlerFunc) ServerOption
- func WithPathPrefix(prefix string) ServerOption
- type ServerStatisticPoint
- func (s *ServerStatisticPoint) Decode(d *jx.Decoder) error
- func (s *ServerStatisticPoint) Encode(e *jx.Encoder)
- func (s *ServerStatisticPoint) GetCollectedAt() time.Time
- func (s *ServerStatisticPoint) GetPlayersCount() int32
- func (s *ServerStatisticPoint) MarshalJSON() ([]byte, error)
- func (s *ServerStatisticPoint) SetCollectedAt(val time.Time)
- func (s *ServerStatisticPoint) SetPlayersCount(val int32)
- func (s *ServerStatisticPoint) UnmarshalJSON(data []byte) error
- type ServerSummary
- func (s *ServerSummary) Decode(d *jx.Decoder) error
- func (s *ServerSummary) Encode(e *jx.Encoder)
- func (s *ServerSummary) GetHost() string
- func (s *ServerSummary) GetName() string
- func (s *ServerSummary) GetPlayersCount() int32
- func (s *ServerSummary) MarshalJSON() ([]byte, error)
- func (s *ServerSummary) SetHost(val string)
- func (s *ServerSummary) SetName(val string)
- func (s *ServerSummary) SetPlayersCount(val int32)
- func (s *ServerSummary) UnmarshalJSON(data []byte) error
- type UnimplementedHandler
- func (UnimplementedHandler) GetServer(ctx context.Context, params GetServerParams) (r GetServerRes, _ error)
- func (UnimplementedHandler) ListMultiplayerSummaries(ctx context.Context, params ListMultiplayerSummariesParams) (r []MultiplayerSummary, _ error)
- func (UnimplementedHandler) ListServerStatistics(ctx context.Context, params ListServerStatisticsParams) (r ListServerStatisticsRes, _ error)
- func (UnimplementedHandler) ListServerSummaries(ctx context.Context, params ListServerSummariesParams) (r ListServerSummariesRes, _ error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client implements OAS client.
func NewClient ¶
func NewClient(serverURL string, opts ...ClientOption) (*Client, error)
NewClient initializes new Client defined by OAS.
func (*Client) GetServer ¶
func (c *Client) GetServer(ctx context.Context, params GetServerParams) (GetServerRes, error)
GetServer invokes getServer operation.
Get a server by its host.
GET /multiplayer/{multiplayerName}/server/{serverHost}
func (*Client) ListMultiplayerSummaries ¶
func (c *Client) ListMultiplayerSummaries(ctx context.Context, params ListMultiplayerSummariesParams) ([]MultiplayerSummary, error)
ListMultiplayerSummaries invokes listMultiplayerSummaries operation.
List player-count summaries for every multiplayer platform.
GET /multiplayers/summaries
func (*Client) ListServerStatistics ¶
func (c *Client) ListServerStatistics(ctx context.Context, params ListServerStatisticsParams) (ListServerStatisticsRes, error)
ListServerStatistics invokes listServerStatistics operation.
Get historical player-count statistics for a server.
GET /multiplayer/{multiplayerName}/server/{serverHost}/statistics
func (*Client) ListServerSummaries ¶
func (c *Client) ListServerSummaries(ctx context.Context, params ListServerSummariesParams) (ListServerSummariesRes, error)
ListServerSummaries invokes listServerSummaries operation.
List servers for a multiplayer platform.
GET /multiplayer/{multiplayerName}/servers
type ClientOption ¶
type ClientOption interface {
// contains filtered or unexported methods
}
ClientOption is client config option.
func WithClient ¶
func WithClient(client ht.Client) ClientOption
WithClient specifies http client to use.
type DetailedServer ¶
type DetailedServer struct {
// Display name of the server.
Name string `json:"name"`
// Public URL advertised by the server, if any.
URL OptString `json:"url"`
// Game mode reported by the server.
Gamemode OptString `json:"gamemode"`
// Primary language reported by the server.
Language OptString `json:"language"`
// Number of players currently connected to the server.
PlayersCount OptInt64 `json:"playersCount"`
// Time at which this snapshot was collected.
CollectedAt OptDateTime `json:"collectedAt"`
}
Detailed information about a single server. Ref: #/components/schemas/DetailedServer
func (*DetailedServer) Decode ¶
func (s *DetailedServer) Decode(d *jx.Decoder) error
Decode decodes DetailedServer from json.
func (*DetailedServer) Encode ¶
func (s *DetailedServer) Encode(e *jx.Encoder)
Encode implements json.Marshaler.
func (*DetailedServer) GetCollectedAt ¶
func (s *DetailedServer) GetCollectedAt() OptDateTime
GetCollectedAt returns the value of CollectedAt.
func (*DetailedServer) GetGamemode ¶
func (s *DetailedServer) GetGamemode() OptString
GetGamemode returns the value of Gamemode.
func (*DetailedServer) GetLanguage ¶
func (s *DetailedServer) GetLanguage() OptString
GetLanguage returns the value of Language.
func (*DetailedServer) GetName ¶
func (s *DetailedServer) GetName() string
GetName returns the value of Name.
func (*DetailedServer) GetPlayersCount ¶
func (s *DetailedServer) GetPlayersCount() OptInt64
GetPlayersCount returns the value of PlayersCount.
func (*DetailedServer) GetURL ¶
func (s *DetailedServer) GetURL() OptString
GetURL returns the value of URL.
func (*DetailedServer) MarshalJSON ¶
func (s *DetailedServer) MarshalJSON() ([]byte, error)
MarshalJSON implements stdjson.Marshaler.
func (*DetailedServer) SetCollectedAt ¶
func (s *DetailedServer) SetCollectedAt(val OptDateTime)
SetCollectedAt sets the value of CollectedAt.
func (*DetailedServer) SetGamemode ¶
func (s *DetailedServer) SetGamemode(val OptString)
SetGamemode sets the value of Gamemode.
func (*DetailedServer) SetLanguage ¶
func (s *DetailedServer) SetLanguage(val OptString)
SetLanguage sets the value of Language.
func (*DetailedServer) SetName ¶
func (s *DetailedServer) SetName(val string)
SetName sets the value of Name.
func (*DetailedServer) SetPlayersCount ¶
func (s *DetailedServer) SetPlayersCount(val OptInt64)
SetPlayersCount sets the value of PlayersCount.
func (*DetailedServer) SetURL ¶
func (s *DetailedServer) SetURL(val OptString)
SetURL sets the value of URL.
func (*DetailedServer) UnmarshalJSON ¶
func (s *DetailedServer) UnmarshalJSON(data []byte) error
UnmarshalJSON implements stdjson.Unmarshaler.
type GetServerNotFound ¶
type GetServerNotFound struct{}
GetServerNotFound is response for GetServer operation.
type GetServerParams ¶
type GetServerParams struct {
// Identifier of the multiplayer platform (for example, `ragemp` or `magestic`).
MultiplayerName string
// Host of the server in `address:port` format.
ServerHost string
}
GetServerParams is parameters of getServer operation.
type GetServerRes ¶
type GetServerRes interface {
// contains filtered or unexported methods
}
type Handler ¶
type Handler interface {
// GetServer implements getServer operation.
//
// Get a server by its host.
//
// GET /multiplayer/{multiplayerName}/server/{serverHost}
GetServer(ctx context.Context, params GetServerParams) (GetServerRes, error)
// ListMultiplayerSummaries implements listMultiplayerSummaries operation.
//
// List player-count summaries for every multiplayer platform.
//
// GET /multiplayers/summaries
ListMultiplayerSummaries(ctx context.Context, params ListMultiplayerSummariesParams) ([]MultiplayerSummary, error)
// ListServerStatistics implements listServerStatistics operation.
//
// Get historical player-count statistics for a server.
//
// GET /multiplayer/{multiplayerName}/server/{serverHost}/statistics
ListServerStatistics(ctx context.Context, params ListServerStatisticsParams) (ListServerStatisticsRes, error)
// ListServerSummaries implements listServerSummaries operation.
//
// List servers for a multiplayer platform.
//
// GET /multiplayer/{multiplayerName}/servers
ListServerSummaries(ctx context.Context, params ListServerSummariesParams) (ListServerSummariesRes, error)
}
Handler handles operations described by OpenAPI v3 specification.
type Invoker ¶
type Invoker interface {
// GetServer invokes getServer operation.
//
// Get a server by its host.
//
// GET /multiplayer/{multiplayerName}/server/{serverHost}
GetServer(ctx context.Context, params GetServerParams) (GetServerRes, error)
// ListMultiplayerSummaries invokes listMultiplayerSummaries operation.
//
// List player-count summaries for every multiplayer platform.
//
// GET /multiplayers/summaries
ListMultiplayerSummaries(ctx context.Context, params ListMultiplayerSummariesParams) ([]MultiplayerSummary, error)
// ListServerStatistics invokes listServerStatistics operation.
//
// Get historical player-count statistics for a server.
//
// GET /multiplayer/{multiplayerName}/server/{serverHost}/statistics
ListServerStatistics(ctx context.Context, params ListServerStatisticsParams) (ListServerStatisticsRes, error)
// ListServerSummaries invokes listServerSummaries operation.
//
// List servers for a multiplayer platform.
//
// GET /multiplayer/{multiplayerName}/servers
ListServerSummaries(ctx context.Context, params ListServerSummariesParams) (ListServerSummariesRes, error)
}
Invoker invokes operations described by OpenAPI v3 specification.
type Labeler ¶
type Labeler struct {
// contains filtered or unexported fields
}
Labeler is used to allow adding custom attributes to the server request metrics.
func LabelerFromContext ¶
LabelerFromContext retrieves the Labeler from the provided context, if present.
If no Labeler was found in the provided context a new, empty Labeler is returned and the second return value is false. In this case it is safe to use the Labeler but any attributes added to it will not be used.
func (*Labeler) AttributeSet ¶
AttributeSet returns the attributes added to the Labeler as an attribute.Set.
type ListMultiplayerSummariesParams ¶
type ListMultiplayerSummariesParams struct {
// If true, sort platforms by current player count in ascending order. Defaults to descending.
PlayersOrderAsc OptBool `json:",omitempty,omitzero"`
}
ListMultiplayerSummariesParams is parameters of listMultiplayerSummaries operation.
type ListServerStatisticsNotFound ¶
type ListServerStatisticsNotFound struct{}
ListServerStatisticsNotFound is response for ListServerStatistics operation.
type ListServerStatisticsOKApplicationJSON ¶
type ListServerStatisticsOKApplicationJSON []ServerStatisticPoint
func (*ListServerStatisticsOKApplicationJSON) Decode ¶
func (s *ListServerStatisticsOKApplicationJSON) Decode(d *jx.Decoder) error
Decode decodes ListServerStatisticsOKApplicationJSON from json.
func (ListServerStatisticsOKApplicationJSON) Encode ¶
func (s ListServerStatisticsOKApplicationJSON) Encode(e *jx.Encoder)
Encode encodes ListServerStatisticsOKApplicationJSON as json.
func (ListServerStatisticsOKApplicationJSON) MarshalJSON ¶
func (s ListServerStatisticsOKApplicationJSON) MarshalJSON() ([]byte, error)
MarshalJSON implements stdjson.Marshaler.
func (*ListServerStatisticsOKApplicationJSON) UnmarshalJSON ¶
func (s *ListServerStatisticsOKApplicationJSON) UnmarshalJSON(data []byte) error
UnmarshalJSON implements stdjson.Unmarshaler.
func (ListServerStatisticsOKApplicationJSON) Validate ¶
func (s ListServerStatisticsOKApplicationJSON) Validate() error
type ListServerStatisticsParams ¶
type ListServerStatisticsParams struct {
// Identifier of the multiplayer platform (for example, `ragemp` or `magestic`).
MultiplayerName string
// Host of the server in `address:port` format.
ServerHost string
// Inclusive start of the time range to query.
From time.Time
// Inclusive end of the time range to query.
To time.Time
// Granularity at which data points are aggregated.
Precision OptListServerStatisticsPrecision `json:",omitempty,omitzero"`
}
ListServerStatisticsParams is parameters of listServerStatistics operation.
type ListServerStatisticsPrecision ¶
type ListServerStatisticsPrecision string
const ( ListServerStatisticsPrecisionPerHour ListServerStatisticsPrecision = "perHour" ListServerStatisticsPrecisionPerDay ListServerStatisticsPrecision = "perDay" )
func (ListServerStatisticsPrecision) AllValues ¶
func (ListServerStatisticsPrecision) AllValues() []ListServerStatisticsPrecision
AllValues returns all ListServerStatisticsPrecision values.
func (ListServerStatisticsPrecision) MarshalText ¶
func (s ListServerStatisticsPrecision) MarshalText() ([]byte, error)
MarshalText implements encoding.TextMarshaler.
func (*ListServerStatisticsPrecision) UnmarshalText ¶
func (s *ListServerStatisticsPrecision) UnmarshalText(data []byte) error
UnmarshalText implements encoding.TextUnmarshaler.
func (ListServerStatisticsPrecision) Validate ¶
func (s ListServerStatisticsPrecision) Validate() error
type ListServerStatisticsRes ¶
type ListServerStatisticsRes interface {
// contains filtered or unexported methods
}
type ListServerSummariesNotFound ¶
type ListServerSummariesNotFound struct{}
ListServerSummariesNotFound is response for ListServerSummaries operation.
type ListServerSummariesOKApplicationJSON ¶
type ListServerSummariesOKApplicationJSON []ServerSummary
func (*ListServerSummariesOKApplicationJSON) Decode ¶
func (s *ListServerSummariesOKApplicationJSON) Decode(d *jx.Decoder) error
Decode decodes ListServerSummariesOKApplicationJSON from json.
func (ListServerSummariesOKApplicationJSON) Encode ¶
func (s ListServerSummariesOKApplicationJSON) Encode(e *jx.Encoder)
Encode encodes ListServerSummariesOKApplicationJSON as json.
func (ListServerSummariesOKApplicationJSON) MarshalJSON ¶
func (s ListServerSummariesOKApplicationJSON) MarshalJSON() ([]byte, error)
MarshalJSON implements stdjson.Marshaler.
func (*ListServerSummariesOKApplicationJSON) UnmarshalJSON ¶
func (s *ListServerSummariesOKApplicationJSON) UnmarshalJSON(data []byte) error
UnmarshalJSON implements stdjson.Unmarshaler.
func (ListServerSummariesOKApplicationJSON) Validate ¶
func (s ListServerSummariesOKApplicationJSON) Validate() error
type ListServerSummariesParams ¶
type ListServerSummariesParams struct {
// Identifier of the multiplayer platform (for example, `ragemp` or `magestic`).
MultiplayerName string
// If true, sort servers by current player count in ascending order. Defaults to descending.
PlayersOrderAsc OptBool `json:",omitempty,omitzero"`
// Maximum number of servers to return. Used together with `offset` for pagination.
Limit OptInt32 `json:",omitempty,omitzero"`
// Number of servers to skip from the start of the result set. Used together with `limit` for
// pagination.
Offset OptInt32 `json:",omitempty,omitzero"`
// If true, include servers that are currently offline in the response. Defaults to false.
IncludeOffline OptBool `json:",omitempty,omitzero"`
}
ListServerSummariesParams is parameters of listServerSummaries operation.
type ListServerSummariesRes ¶
type ListServerSummariesRes interface {
// contains filtered or unexported methods
}
type MultiplayerSummary ¶
type MultiplayerSummary struct {
// Identifier of the multiplayer platform.
Name string `json:"name"`
// Total number of players currently connected across all servers on the platform.
PlayersCount int64 `json:"playersCount"`
}
Aggregate player activity for a single multiplayer platform. Ref: #/components/schemas/MultiplayerSummary
func (*MultiplayerSummary) Decode ¶
func (s *MultiplayerSummary) Decode(d *jx.Decoder) error
Decode decodes MultiplayerSummary from json.
func (*MultiplayerSummary) Encode ¶
func (s *MultiplayerSummary) Encode(e *jx.Encoder)
Encode implements json.Marshaler.
func (*MultiplayerSummary) GetName ¶
func (s *MultiplayerSummary) GetName() string
GetName returns the value of Name.
func (*MultiplayerSummary) GetPlayersCount ¶
func (s *MultiplayerSummary) GetPlayersCount() int64
GetPlayersCount returns the value of PlayersCount.
func (*MultiplayerSummary) MarshalJSON ¶
func (s *MultiplayerSummary) MarshalJSON() ([]byte, error)
MarshalJSON implements stdjson.Marshaler.
func (*MultiplayerSummary) SetName ¶
func (s *MultiplayerSummary) SetName(val string)
SetName sets the value of Name.
func (*MultiplayerSummary) SetPlayersCount ¶
func (s *MultiplayerSummary) SetPlayersCount(val int64)
SetPlayersCount sets the value of PlayersCount.
func (*MultiplayerSummary) UnmarshalJSON ¶
func (s *MultiplayerSummary) UnmarshalJSON(data []byte) error
UnmarshalJSON implements stdjson.Unmarshaler.
type OperationName ¶
type OperationName = string
OperationName is the ogen operation name
const ( GetServerOperation OperationName = "GetServer" ListMultiplayerSummariesOperation OperationName = "ListMultiplayerSummaries" ListServerStatisticsOperation OperationName = "ListServerStatistics" ListServerSummariesOperation OperationName = "ListServerSummaries" )
type OptBool ¶
OptBool is optional bool.
func NewOptBool ¶
NewOptBool returns new OptBool with value set to v.
type OptDateTime ¶
OptDateTime is optional time.Time.
func NewOptDateTime ¶
func NewOptDateTime(v time.Time) OptDateTime
NewOptDateTime returns new OptDateTime with value set to v.
func (OptDateTime) Get ¶
func (o OptDateTime) Get() (v time.Time, ok bool)
Get returns value and boolean that denotes whether value was set.
func (OptDateTime) IsSet ¶
func (o OptDateTime) IsSet() bool
IsSet returns true if OptDateTime was set.
func (OptDateTime) MarshalJSON ¶
func (s OptDateTime) MarshalJSON() ([]byte, error)
MarshalJSON implements stdjson.Marshaler.
func (OptDateTime) Or ¶
func (o OptDateTime) Or(d time.Time) time.Time
Or returns value if set, or given parameter if does not.
func (*OptDateTime) UnmarshalJSON ¶
func (s *OptDateTime) UnmarshalJSON(data []byte) error
UnmarshalJSON implements stdjson.Unmarshaler.
type OptInt32 ¶
OptInt32 is optional int32.
func NewOptInt32 ¶
NewOptInt32 returns new OptInt32 with value set to v.
type OptInt64 ¶
OptInt64 is optional int64.
func NewOptInt64 ¶
NewOptInt64 returns new OptInt64 with value set to v.
func (OptInt64) MarshalJSON ¶
MarshalJSON implements stdjson.Marshaler.
func (*OptInt64) UnmarshalJSON ¶
UnmarshalJSON implements stdjson.Unmarshaler.
type OptListServerStatisticsPrecision ¶
type OptListServerStatisticsPrecision struct {
Value ListServerStatisticsPrecision
Set bool
}
OptListServerStatisticsPrecision is optional ListServerStatisticsPrecision.
func NewOptListServerStatisticsPrecision ¶
func NewOptListServerStatisticsPrecision(v ListServerStatisticsPrecision) OptListServerStatisticsPrecision
NewOptListServerStatisticsPrecision returns new OptListServerStatisticsPrecision with value set to v.
func (OptListServerStatisticsPrecision) Get ¶
func (o OptListServerStatisticsPrecision) Get() (v ListServerStatisticsPrecision, ok bool)
Get returns value and boolean that denotes whether value was set.
func (OptListServerStatisticsPrecision) IsSet ¶
func (o OptListServerStatisticsPrecision) IsSet() bool
IsSet returns true if OptListServerStatisticsPrecision was set.
func (OptListServerStatisticsPrecision) Or ¶
func (o OptListServerStatisticsPrecision) Or(d ListServerStatisticsPrecision) ListServerStatisticsPrecision
Or returns value if set, or given parameter if does not.
func (*OptListServerStatisticsPrecision) Reset ¶
func (o *OptListServerStatisticsPrecision) Reset()
Reset unsets value.
func (*OptListServerStatisticsPrecision) SetTo ¶
func (o *OptListServerStatisticsPrecision) SetTo(v ListServerStatisticsPrecision)
SetTo sets value to v.
type OptString ¶
OptString is optional string.
func NewOptString ¶
NewOptString returns new OptString with value set to v.
func (OptString) MarshalJSON ¶
MarshalJSON implements stdjson.Marshaler.
func (*OptString) UnmarshalJSON ¶
UnmarshalJSON implements stdjson.Unmarshaler.
type Option ¶
type Option interface {
ServerOption
ClientOption
}
Option is config option.
func WithAttributes ¶
WithAttributes specifies default otel attributes.
func WithMeterProvider ¶
func WithMeterProvider(provider metric.MeterProvider) Option
WithMeterProvider specifies a meter provider to use for creating a meter.
If none is specified, the otel.GetMeterProvider() is used.
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) OperationGroup ¶ added in v0.1.0
OperationGroup returns the x-ogen-operation-group value.
func (Route) OperationID ¶
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 ...ServerOption) (*Server, error)
NewServer creates new Server.
type ServerOption ¶
type ServerOption interface {
// contains filtered or unexported methods
}
ServerOption is server config option.
func WithErrorHandler ¶
func WithErrorHandler(h ErrorHandler) ServerOption
WithErrorHandler specifies error handler to use.
func WithMaxMultipartMemory ¶
func WithMaxMultipartMemory(max int64) ServerOption
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 WithMethodNotAllowed ¶
func WithMethodNotAllowed(methodNotAllowed func(w http.ResponseWriter, r *http.Request, allowed string)) ServerOption
WithMethodNotAllowed specifies Method Not Allowed handler to use.
func WithMiddleware ¶
func WithMiddleware(m ...Middleware) ServerOption
WithMiddleware specifies middlewares to use.
func WithNotFound ¶
func WithNotFound(notFound http.HandlerFunc) ServerOption
WithNotFound specifies Not Found handler to use.
func WithPathPrefix ¶
func WithPathPrefix(prefix string) ServerOption
WithPathPrefix specifies server path prefix.
type ServerStatisticPoint ¶
type ServerStatisticPoint struct {
// Time at which this measurement was collected.
CollectedAt time.Time `json:"collectedAt"`
// Number of players connected to the server at `collectedAt`.
PlayersCount int32 `json:"playersCount"`
}
A single data point in a server's historical player-count series. Ref: #/components/schemas/ServerStatisticPoint
func (*ServerStatisticPoint) Decode ¶
func (s *ServerStatisticPoint) Decode(d *jx.Decoder) error
Decode decodes ServerStatisticPoint from json.
func (*ServerStatisticPoint) Encode ¶
func (s *ServerStatisticPoint) Encode(e *jx.Encoder)
Encode implements json.Marshaler.
func (*ServerStatisticPoint) GetCollectedAt ¶
func (s *ServerStatisticPoint) GetCollectedAt() time.Time
GetCollectedAt returns the value of CollectedAt.
func (*ServerStatisticPoint) GetPlayersCount ¶
func (s *ServerStatisticPoint) GetPlayersCount() int32
GetPlayersCount returns the value of PlayersCount.
func (*ServerStatisticPoint) MarshalJSON ¶
func (s *ServerStatisticPoint) MarshalJSON() ([]byte, error)
MarshalJSON implements stdjson.Marshaler.
func (*ServerStatisticPoint) SetCollectedAt ¶
func (s *ServerStatisticPoint) SetCollectedAt(val time.Time)
SetCollectedAt sets the value of CollectedAt.
func (*ServerStatisticPoint) SetPlayersCount ¶
func (s *ServerStatisticPoint) SetPlayersCount(val int32)
SetPlayersCount sets the value of PlayersCount.
func (*ServerStatisticPoint) UnmarshalJSON ¶
func (s *ServerStatisticPoint) UnmarshalJSON(data []byte) error
UnmarshalJSON implements stdjson.Unmarshaler.
type ServerSummary ¶
type ServerSummary struct {
// Host of the server in `address:port` format.
Host string `json:"host"`
// Display name of the server.
Name string `json:"name"`
// Number of players currently connected to the server.
PlayersCount int32 `json:"playersCount"`
}
Lightweight representation of a server, suitable for list views. Ref: #/components/schemas/ServerSummary
func (*ServerSummary) Decode ¶
func (s *ServerSummary) Decode(d *jx.Decoder) error
Decode decodes ServerSummary from json.
func (*ServerSummary) Encode ¶
func (s *ServerSummary) Encode(e *jx.Encoder)
Encode implements json.Marshaler.
func (*ServerSummary) GetHost ¶
func (s *ServerSummary) GetHost() string
GetHost returns the value of Host.
func (*ServerSummary) GetName ¶
func (s *ServerSummary) GetName() string
GetName returns the value of Name.
func (*ServerSummary) GetPlayersCount ¶
func (s *ServerSummary) GetPlayersCount() int32
GetPlayersCount returns the value of PlayersCount.
func (*ServerSummary) MarshalJSON ¶
func (s *ServerSummary) MarshalJSON() ([]byte, error)
MarshalJSON implements stdjson.Marshaler.
func (*ServerSummary) SetHost ¶
func (s *ServerSummary) SetHost(val string)
SetHost sets the value of Host.
func (*ServerSummary) SetName ¶
func (s *ServerSummary) SetName(val string)
SetName sets the value of Name.
func (*ServerSummary) SetPlayersCount ¶
func (s *ServerSummary) SetPlayersCount(val int32)
SetPlayersCount sets the value of PlayersCount.
func (*ServerSummary) UnmarshalJSON ¶
func (s *ServerSummary) UnmarshalJSON(data []byte) error
UnmarshalJSON implements stdjson.Unmarshaler.
type UnimplementedHandler ¶
type UnimplementedHandler struct{}
UnimplementedHandler is no-op Handler which returns http.ErrNotImplemented.
func (UnimplementedHandler) GetServer ¶
func (UnimplementedHandler) GetServer(ctx context.Context, params GetServerParams) (r GetServerRes, _ error)
GetServer implements getServer operation.
Get a server by its host.
GET /multiplayer/{multiplayerName}/server/{serverHost}
func (UnimplementedHandler) ListMultiplayerSummaries ¶
func (UnimplementedHandler) ListMultiplayerSummaries(ctx context.Context, params ListMultiplayerSummariesParams) (r []MultiplayerSummary, _ error)
ListMultiplayerSummaries implements listMultiplayerSummaries operation.
List player-count summaries for every multiplayer platform.
GET /multiplayers/summaries
func (UnimplementedHandler) ListServerStatistics ¶
func (UnimplementedHandler) ListServerStatistics(ctx context.Context, params ListServerStatisticsParams) (r ListServerStatisticsRes, _ error)
ListServerStatistics implements listServerStatistics operation.
Get historical player-count statistics for a server.
GET /multiplayer/{multiplayerName}/server/{serverHost}/statistics
func (UnimplementedHandler) ListServerSummaries ¶
func (UnimplementedHandler) ListServerSummaries(ctx context.Context, params ListServerSummariesParams) (r ListServerSummariesRes, _ error)
ListServerSummaries implements listServerSummaries operation.
List servers for a multiplayer platform.
GET /multiplayer/{multiplayerName}/servers
Source Files
¶
- oas_cfg_gen.go
- oas_client_gen.go
- oas_handlers_gen.go
- oas_interfaces_gen.go
- oas_json_gen.go
- oas_labeler_gen.go
- oas_middleware_gen.go
- oas_operations_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_server_gen.go
- oas_unimplemented_gen.go
- oas_validators_gen.go