Documentation ¶
Index ¶
- Constants
- Variables
- func WriteError(resp http.ResponseWriter, err error)
- type GCGRequest
- type GCGResponse
- type GameHistoryRequest
- func (*GameHistoryRequest) Descriptor() ([]byte, []int)deprecated
- func (x *GameHistoryRequest) GetGameId() string
- func (*GameHistoryRequest) ProtoMessage()
- func (x *GameHistoryRequest) ProtoReflect() protoreflect.Message
- func (x *GameHistoryRequest) Reset()
- func (x *GameHistoryRequest) String() string
- type GameHistoryResponse
- func (*GameHistoryResponse) Descriptor() ([]byte, []int)deprecated
- func (x *GameHistoryResponse) GetHistory() *macondo.GameHistory
- func (*GameHistoryResponse) ProtoMessage()
- func (x *GameHistoryResponse) ProtoReflect() protoreflect.Message
- func (x *GameHistoryResponse) Reset()
- func (x *GameHistoryResponse) String() string
- type GameInfoRequest
- type GameMetadataService
- type HTTPClient
- type RecentGamesRequest
- func (*RecentGamesRequest) Descriptor() ([]byte, []int)deprecated
- func (x *RecentGamesRequest) GetNumGames() int32
- func (x *RecentGamesRequest) GetOffset() int32
- func (x *RecentGamesRequest) GetUsername() string
- func (*RecentGamesRequest) ProtoMessage()
- func (x *RecentGamesRequest) ProtoReflect() protoreflect.Message
- func (x *RecentGamesRequest) Reset()
- func (x *RecentGamesRequest) String() string
- type RematchStreakRequest
- func (*RematchStreakRequest) Descriptor() ([]byte, []int)deprecated
- func (x *RematchStreakRequest) GetOriginalRequestId() string
- func (*RematchStreakRequest) ProtoMessage()
- func (x *RematchStreakRequest) ProtoReflect() protoreflect.Message
- func (x *RematchStreakRequest) Reset()
- func (x *RematchStreakRequest) String() string
- type StreakInfoResponse
- func (*StreakInfoResponse) Descriptor() ([]byte, []int)deprecated
- func (x *StreakInfoResponse) GetPlayersInfo() []*StreakInfoResponse_PlayerInfo
- func (x *StreakInfoResponse) GetStreak() []*StreakInfoResponse_SingleGameInfo
- func (*StreakInfoResponse) ProtoMessage()
- func (x *StreakInfoResponse) ProtoReflect() protoreflect.Message
- func (x *StreakInfoResponse) Reset()
- func (x *StreakInfoResponse) String() string
- type StreakInfoResponse_PlayerInfo
- func (*StreakInfoResponse_PlayerInfo) Descriptor() ([]byte, []int)deprecated
- func (x *StreakInfoResponse_PlayerInfo) GetNickname() string
- func (x *StreakInfoResponse_PlayerInfo) GetUuid() string
- func (*StreakInfoResponse_PlayerInfo) ProtoMessage()
- func (x *StreakInfoResponse_PlayerInfo) ProtoReflect() protoreflect.Message
- func (x *StreakInfoResponse_PlayerInfo) Reset()
- func (x *StreakInfoResponse_PlayerInfo) String() string
- type StreakInfoResponse_SingleGameInfo
- func (*StreakInfoResponse_SingleGameInfo) Descriptor() ([]byte, []int)deprecated
- func (x *StreakInfoResponse_SingleGameInfo) GetGameId() string
- func (x *StreakInfoResponse_SingleGameInfo) GetWinner() int32
- func (*StreakInfoResponse_SingleGameInfo) ProtoMessage()
- func (x *StreakInfoResponse_SingleGameInfo) ProtoReflect() protoreflect.Message
- func (x *StreakInfoResponse_SingleGameInfo) Reset()
- func (x *StreakInfoResponse_SingleGameInfo) String() string
- type TwirpServer
Constants ¶
const GameMetadataServicePathPrefix = "/twirp/game_service.GameMetadataService/"
GameMetadataServicePathPrefix is a convenience constant that may identify URL paths. Should be used with caution, it only matches routes generated by Twirp Go clients, with the default "/twirp" prefix and default CamelCase service and method names. More info: https://twitchtv.github.io/twirp/docs/routing.html
Variables ¶
var File_api_proto_game_service_game_service_proto protoreflect.FileDescriptor
Functions ¶
func WriteError ¶
func WriteError(resp http.ResponseWriter, err error)
WriteError writes an HTTP response with a valid Twirp error format (code, msg, meta). Useful outside of the Twirp server (e.g. http middleware), but does not trigger hooks. If err is not a twirp.Error, it will get wrapped with twirp.InternalErrorWith(err)
Types ¶
type GCGRequest ¶
type GCGRequest struct { GameId string `protobuf:"bytes,1,opt,name=game_id,json=gameId,proto3" json:"game_id,omitempty"` // contains filtered or unexported fields }
func (*GCGRequest) Descriptor
deprecated
func (*GCGRequest) Descriptor() ([]byte, []int)
Deprecated: Use GCGRequest.ProtoReflect.Descriptor instead.
func (*GCGRequest) GetGameId ¶
func (x *GCGRequest) GetGameId() string
func (*GCGRequest) ProtoMessage ¶
func (*GCGRequest) ProtoMessage()
func (*GCGRequest) ProtoReflect ¶
func (x *GCGRequest) ProtoReflect() protoreflect.Message
func (*GCGRequest) Reset ¶
func (x *GCGRequest) Reset()
func (*GCGRequest) String ¶
func (x *GCGRequest) String() string
type GCGResponse ¶
type GCGResponse struct { Gcg string `protobuf:"bytes,1,opt,name=gcg,proto3" json:"gcg,omitempty"` // contains filtered or unexported fields }
func (*GCGResponse) Descriptor
deprecated
func (*GCGResponse) Descriptor() ([]byte, []int)
Deprecated: Use GCGResponse.ProtoReflect.Descriptor instead.
func (*GCGResponse) GetGcg ¶
func (x *GCGResponse) GetGcg() string
func (*GCGResponse) ProtoMessage ¶
func (*GCGResponse) ProtoMessage()
func (*GCGResponse) ProtoReflect ¶
func (x *GCGResponse) ProtoReflect() protoreflect.Message
func (*GCGResponse) Reset ¶
func (x *GCGResponse) Reset()
func (*GCGResponse) String ¶
func (x *GCGResponse) String() string
type GameHistoryRequest ¶ added in v0.1.3
type GameHistoryRequest struct { GameId string `protobuf:"bytes,1,opt,name=game_id,json=gameId,proto3" json:"game_id,omitempty"` // contains filtered or unexported fields }
func (*GameHistoryRequest) Descriptor
deprecated
added in
v0.1.3
func (*GameHistoryRequest) Descriptor() ([]byte, []int)
Deprecated: Use GameHistoryRequest.ProtoReflect.Descriptor instead.
func (*GameHistoryRequest) GetGameId ¶ added in v0.1.3
func (x *GameHistoryRequest) GetGameId() string
func (*GameHistoryRequest) ProtoMessage ¶ added in v0.1.3
func (*GameHistoryRequest) ProtoMessage()
func (*GameHistoryRequest) ProtoReflect ¶ added in v0.1.3
func (x *GameHistoryRequest) ProtoReflect() protoreflect.Message
func (*GameHistoryRequest) Reset ¶ added in v0.1.3
func (x *GameHistoryRequest) Reset()
func (*GameHistoryRequest) String ¶ added in v0.1.3
func (x *GameHistoryRequest) String() string
type GameHistoryResponse ¶ added in v0.1.3
type GameHistoryResponse struct { History *macondo.GameHistory `protobuf:"bytes,1,opt,name=history,proto3" json:"history,omitempty"` // contains filtered or unexported fields }
func (*GameHistoryResponse) Descriptor
deprecated
added in
v0.1.3
func (*GameHistoryResponse) Descriptor() ([]byte, []int)
Deprecated: Use GameHistoryResponse.ProtoReflect.Descriptor instead.
func (*GameHistoryResponse) GetHistory ¶ added in v0.1.3
func (x *GameHistoryResponse) GetHistory() *macondo.GameHistory
func (*GameHistoryResponse) ProtoMessage ¶ added in v0.1.3
func (*GameHistoryResponse) ProtoMessage()
func (*GameHistoryResponse) ProtoReflect ¶ added in v0.1.3
func (x *GameHistoryResponse) ProtoReflect() protoreflect.Message
func (*GameHistoryResponse) Reset ¶ added in v0.1.3
func (x *GameHistoryResponse) Reset()
func (*GameHistoryResponse) String ¶ added in v0.1.3
func (x *GameHistoryResponse) String() string
type GameInfoRequest ¶
type GameInfoRequest struct { GameId string `protobuf:"bytes,1,opt,name=game_id,json=gameId,proto3" json:"game_id,omitempty"` // contains filtered or unexported fields }
Meta information about a game, including its players.
func (*GameInfoRequest) Descriptor
deprecated
func (*GameInfoRequest) Descriptor() ([]byte, []int)
Deprecated: Use GameInfoRequest.ProtoReflect.Descriptor instead.
func (*GameInfoRequest) GetGameId ¶
func (x *GameInfoRequest) GetGameId() string
func (*GameInfoRequest) ProtoMessage ¶
func (*GameInfoRequest) ProtoMessage()
func (*GameInfoRequest) ProtoReflect ¶
func (x *GameInfoRequest) ProtoReflect() protoreflect.Message
func (*GameInfoRequest) Reset ¶
func (x *GameInfoRequest) Reset()
func (*GameInfoRequest) String ¶
func (x *GameInfoRequest) String() string
type GameMetadataService ¶
type GameMetadataService interface { GetMetadata(context.Context, *GameInfoRequest) (*ipc.GameInfoResponse, error) GetGCG(context.Context, *GCGRequest) (*GCGResponse, error) GetGameHistory(context.Context, *GameHistoryRequest) (*GameHistoryResponse, error) GetRecentGames(context.Context, *RecentGamesRequest) (*ipc.GameInfoResponses, error) GetRematchStreak(context.Context, *RematchStreakRequest) (*StreakInfoResponse, error) }
func NewGameMetadataServiceJSONClient ¶
func NewGameMetadataServiceJSONClient(baseURL string, client HTTPClient, opts ...twirp.ClientOption) GameMetadataService
NewGameMetadataServiceJSONClient creates a JSON client that implements the GameMetadataService interface. It communicates using JSON and can be configured with a custom HTTPClient.
func NewGameMetadataServiceProtobufClient ¶
func NewGameMetadataServiceProtobufClient(baseURL string, client HTTPClient, opts ...twirp.ClientOption) GameMetadataService
NewGameMetadataServiceProtobufClient creates a Protobuf client that implements the GameMetadataService interface. It communicates using Protobuf and can be configured with a custom HTTPClient.
type HTTPClient ¶
HTTPClient is the interface used by generated clients to send HTTP requests. It is fulfilled by *(net/http).Client, which is sufficient for most users. Users can provide their own implementation for special retry policies.
HTTPClient implementations should not follow redirects. Redirects are automatically disabled if *(net/http).Client is passed to client constructors. See the withoutRedirects function in this file for more details.
type RecentGamesRequest ¶ added in v0.1.2
type RecentGamesRequest struct { Username string `protobuf:"bytes,1,opt,name=username,proto3" json:"username,omitempty"` NumGames int32 `protobuf:"varint,2,opt,name=num_games,json=numGames,proto3" json:"num_games,omitempty"` Offset int32 `protobuf:"varint,3,opt,name=offset,proto3" json:"offset,omitempty"` // contains filtered or unexported fields }
func (*RecentGamesRequest) Descriptor
deprecated
added in
v0.1.2
func (*RecentGamesRequest) Descriptor() ([]byte, []int)
Deprecated: Use RecentGamesRequest.ProtoReflect.Descriptor instead.
func (*RecentGamesRequest) GetNumGames ¶ added in v0.1.2
func (x *RecentGamesRequest) GetNumGames() int32
func (*RecentGamesRequest) GetOffset ¶ added in v0.1.2
func (x *RecentGamesRequest) GetOffset() int32
func (*RecentGamesRequest) GetUsername ¶ added in v0.1.2
func (x *RecentGamesRequest) GetUsername() string
func (*RecentGamesRequest) ProtoMessage ¶ added in v0.1.2
func (*RecentGamesRequest) ProtoMessage()
func (*RecentGamesRequest) ProtoReflect ¶ added in v0.1.2
func (x *RecentGamesRequest) ProtoReflect() protoreflect.Message
func (*RecentGamesRequest) Reset ¶ added in v0.1.2
func (x *RecentGamesRequest) Reset()
func (*RecentGamesRequest) String ¶ added in v0.1.2
func (x *RecentGamesRequest) String() string
type RematchStreakRequest ¶ added in v0.1.2
type RematchStreakRequest struct { OriginalRequestId string `protobuf:"bytes,1,opt,name=original_request_id,json=originalRequestId,proto3" json:"original_request_id,omitempty"` // contains filtered or unexported fields }
func (*RematchStreakRequest) Descriptor
deprecated
added in
v0.1.2
func (*RematchStreakRequest) Descriptor() ([]byte, []int)
Deprecated: Use RematchStreakRequest.ProtoReflect.Descriptor instead.
func (*RematchStreakRequest) GetOriginalRequestId ¶ added in v0.1.2
func (x *RematchStreakRequest) GetOriginalRequestId() string
func (*RematchStreakRequest) ProtoMessage ¶ added in v0.1.2
func (*RematchStreakRequest) ProtoMessage()
func (*RematchStreakRequest) ProtoReflect ¶ added in v0.1.2
func (x *RematchStreakRequest) ProtoReflect() protoreflect.Message
func (*RematchStreakRequest) Reset ¶ added in v0.1.2
func (x *RematchStreakRequest) Reset()
func (*RematchStreakRequest) String ¶ added in v0.1.2
func (x *RematchStreakRequest) String() string
type StreakInfoResponse ¶ added in v0.1.3
type StreakInfoResponse struct { Streak []*StreakInfoResponse_SingleGameInfo `protobuf:"bytes,1,rep,name=streak,proto3" json:"streak,omitempty"` PlayersInfo []*StreakInfoResponse_PlayerInfo `protobuf:"bytes,3,rep,name=playersInfo,proto3" json:"playersInfo,omitempty"` // contains filtered or unexported fields }
func (*StreakInfoResponse) Descriptor
deprecated
added in
v0.1.3
func (*StreakInfoResponse) Descriptor() ([]byte, []int)
Deprecated: Use StreakInfoResponse.ProtoReflect.Descriptor instead.
func (*StreakInfoResponse) GetPlayersInfo ¶ added in v0.1.3
func (x *StreakInfoResponse) GetPlayersInfo() []*StreakInfoResponse_PlayerInfo
func (*StreakInfoResponse) GetStreak ¶ added in v0.1.3
func (x *StreakInfoResponse) GetStreak() []*StreakInfoResponse_SingleGameInfo
func (*StreakInfoResponse) ProtoMessage ¶ added in v0.1.3
func (*StreakInfoResponse) ProtoMessage()
func (*StreakInfoResponse) ProtoReflect ¶ added in v0.1.3
func (x *StreakInfoResponse) ProtoReflect() protoreflect.Message
func (*StreakInfoResponse) Reset ¶ added in v0.1.3
func (x *StreakInfoResponse) Reset()
func (*StreakInfoResponse) String ¶ added in v0.1.3
func (x *StreakInfoResponse) String() string
type StreakInfoResponse_PlayerInfo ¶ added in v0.1.3
type StreakInfoResponse_PlayerInfo struct { Nickname string `protobuf:"bytes,1,opt,name=nickname,proto3" json:"nickname,omitempty"` Uuid string `protobuf:"bytes,2,opt,name=uuid,proto3" json:"uuid,omitempty"` // player uuid needed for censoring // contains filtered or unexported fields }
func (*StreakInfoResponse_PlayerInfo) Descriptor
deprecated
added in
v0.1.3
func (*StreakInfoResponse_PlayerInfo) Descriptor() ([]byte, []int)
Deprecated: Use StreakInfoResponse_PlayerInfo.ProtoReflect.Descriptor instead.
func (*StreakInfoResponse_PlayerInfo) GetNickname ¶ added in v0.1.3
func (x *StreakInfoResponse_PlayerInfo) GetNickname() string
func (*StreakInfoResponse_PlayerInfo) GetUuid ¶ added in v0.1.3
func (x *StreakInfoResponse_PlayerInfo) GetUuid() string
func (*StreakInfoResponse_PlayerInfo) ProtoMessage ¶ added in v0.1.3
func (*StreakInfoResponse_PlayerInfo) ProtoMessage()
func (*StreakInfoResponse_PlayerInfo) ProtoReflect ¶ added in v0.1.3
func (x *StreakInfoResponse_PlayerInfo) ProtoReflect() protoreflect.Message
func (*StreakInfoResponse_PlayerInfo) Reset ¶ added in v0.1.3
func (x *StreakInfoResponse_PlayerInfo) Reset()
func (*StreakInfoResponse_PlayerInfo) String ¶ added in v0.1.3
func (x *StreakInfoResponse_PlayerInfo) String() string
type StreakInfoResponse_SingleGameInfo ¶ added in v0.1.3
type StreakInfoResponse_SingleGameInfo struct { GameId string `protobuf:"bytes,1,opt,name=game_id,json=gameId,proto3" json:"game_id,omitempty"` Winner int32 `protobuf:"varint,3,opt,name=winner,proto3" json:"winner,omitempty"` // the index in `players` or -1 if no winner (tie) // contains filtered or unexported fields }
func (*StreakInfoResponse_SingleGameInfo) Descriptor
deprecated
added in
v0.1.3
func (*StreakInfoResponse_SingleGameInfo) Descriptor() ([]byte, []int)
Deprecated: Use StreakInfoResponse_SingleGameInfo.ProtoReflect.Descriptor instead.
func (*StreakInfoResponse_SingleGameInfo) GetGameId ¶ added in v0.1.3
func (x *StreakInfoResponse_SingleGameInfo) GetGameId() string
func (*StreakInfoResponse_SingleGameInfo) GetWinner ¶ added in v0.1.3
func (x *StreakInfoResponse_SingleGameInfo) GetWinner() int32
func (*StreakInfoResponse_SingleGameInfo) ProtoMessage ¶ added in v0.1.3
func (*StreakInfoResponse_SingleGameInfo) ProtoMessage()
func (*StreakInfoResponse_SingleGameInfo) ProtoReflect ¶ added in v0.1.3
func (x *StreakInfoResponse_SingleGameInfo) ProtoReflect() protoreflect.Message
func (*StreakInfoResponse_SingleGameInfo) Reset ¶ added in v0.1.3
func (x *StreakInfoResponse_SingleGameInfo) Reset()
func (*StreakInfoResponse_SingleGameInfo) String ¶ added in v0.1.3
func (x *StreakInfoResponse_SingleGameInfo) String() string
type TwirpServer ¶
type TwirpServer interface { http.Handler // ServiceDescriptor returns gzipped bytes describing the .proto file that // this service was generated from. Once unzipped, the bytes can be // unmarshalled as a // google.golang.org/protobuf/types/descriptorpb.FileDescriptorProto. // // The returned integer is the index of this particular service within that // FileDescriptorProto's 'Service' slice of ServiceDescriptorProtos. This is a // low-level field, expected to be used for reflection. ServiceDescriptor() ([]byte, int) // ProtocGenTwirpVersion is the semantic version string of the version of // twirp used to generate this file. ProtocGenTwirpVersion() string // PathPrefix returns the HTTP URL path prefix for all methods handled by this // service. This can be used with an HTTP mux to route Twirp requests. // The path prefix is in the form: "/<prefix>/<package>.<Service>/" // that is, everything in a Twirp route except for the <Method> at the end. PathPrefix() string }
TwirpServer is the interface generated server structs will support: they're HTTP handlers with additional methods for accessing metadata about the service. Those accessors are a low-level API for building reflection tools. Most people can think of TwirpServers as just http.Handlers.
func NewGameMetadataServiceServer ¶
func NewGameMetadataServiceServer(svc GameMetadataService, opts ...interface{}) TwirpServer
NewGameMetadataServiceServer builds a TwirpServer that can be used as an http.Handler to handle HTTP requests that are routed to the right method in the provided svc implementation. The opts are twirp.ServerOption modifiers, for example twirp.WithServerHooks(hooks).