Documentation ¶
Overview ¶
Package proto is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Index ¶
- Constants
- Variables
- func RegisterApiHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterApiHandlerClient(ctx context.Context, mux *runtime.ServeMux, client ApiClient) error
- func RegisterApiHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterApiHandlerServer(ctx context.Context, mux *runtime.ServeMux, server ApiServer) error
- func RegisterApiServer(s grpc.ServiceRegistrar, srv ApiServer)
- type ApiClient
- type ApiServer
- type GetMatchIdsRequest
- func (*GetMatchIdsRequest) Descriptor() ([]byte, []int)deprecated
- func (x *GetMatchIdsRequest) GetFrom() *timestamppb.Timestamp
- func (x *GetMatchIdsRequest) GetOptions() *GetMatchIdsRequest_Options
- func (x *GetMatchIdsRequest) GetState() MatchState
- func (x *GetMatchIdsRequest) GetTo() *timestamppb.Timestamp
- func (*GetMatchIdsRequest) ProtoMessage()
- func (x *GetMatchIdsRequest) ProtoReflect() protoreflect.Message
- func (x *GetMatchIdsRequest) Reset()
- func (x *GetMatchIdsRequest) String() string
- type GetMatchIdsRequest_Options
- func (*GetMatchIdsRequest_Options) Descriptor() ([]byte, []int)deprecated
- func (x *GetMatchIdsRequest_Options) GetEventId() string
- func (*GetMatchIdsRequest_Options) ProtoMessage()
- func (x *GetMatchIdsRequest_Options) ProtoReflect() protoreflect.Message
- func (x *GetMatchIdsRequest_Options) Reset()
- func (x *GetMatchIdsRequest_Options) String() string
- type GetMatchIdsResponse
- func (*GetMatchIdsResponse) Descriptor() ([]byte, []int)deprecated
- func (x *GetMatchIdsResponse) GetMatchIds() []string
- func (*GetMatchIdsResponse) ProtoMessage()
- func (x *GetMatchIdsResponse) ProtoReflect() protoreflect.Message
- func (x *GetMatchIdsResponse) Reset()
- func (x *GetMatchIdsResponse) String() string
- type GetMatchRequest
- type GetMatchResponse
- type Match
- func (*Match) Descriptor() ([]byte, []int)deprecated
- func (x *Match) GetHead() *Match_Head
- func (x *Match) GetMaps() []*Match_Map
- func (x *Match) GetVersus() *Match_Versus
- func (*Match) ProtoMessage()
- func (x *Match) ProtoReflect() protoreflect.Message
- func (x *Match) Reset()
- func (x *Match) String() string
- type MatchState
- type Match_Head
- func (*Match_Head) Descriptor() ([]byte, []int)deprecated
- func (x *Match_Head) GetDateTime() *timestamppb.Timestamp
- func (x *Match_Head) GetEvent() *Match_Head_Event
- func (x *Match_Head) GetMatchId() string
- func (x *Match_Head) GetState() MatchState
- func (*Match_Head) ProtoMessage()
- func (x *Match_Head) ProtoReflect() protoreflect.Message
- func (x *Match_Head) Reset()
- func (x *Match_Head) String() string
- type Match_Head_Event
- func (*Match_Head_Event) Descriptor() ([]byte, []int)deprecated
- func (x *Match_Head_Event) GetEventId() string
- func (x *Match_Head_Event) GetName() string
- func (x *Match_Head_Event) GetStage() string
- func (*Match_Head_Event) ProtoMessage()
- func (x *Match_Head_Event) ProtoReflect() protoreflect.Message
- func (x *Match_Head_Event) Reset()
- func (x *Match_Head_Event) String() string
- type Match_Map
- type Match_Map_Round
- func (*Match_Map_Round) Descriptor() ([]byte, []int)deprecated
- func (x *Match_Map_Round) GetScore1() int32
- func (x *Match_Map_Round) GetScore2() int32
- func (*Match_Map_Round) ProtoMessage()
- func (x *Match_Map_Round) ProtoReflect() protoreflect.Message
- func (x *Match_Map_Round) Reset()
- func (x *Match_Map_Round) String() string
- type Match_Versus
- func (*Match_Versus) Descriptor() ([]byte, []int)deprecated
- func (x *Match_Versus) GetScore1() int32
- func (x *Match_Versus) GetScore2() int32
- func (x *Match_Versus) GetTeam1() *Team
- func (x *Match_Versus) GetTeam2() *Team
- func (*Match_Versus) ProtoMessage()
- func (x *Match_Versus) ProtoReflect() protoreflect.Message
- func (x *Match_Versus) Reset()
- func (x *Match_Versus) String() string
- type Team
- type UnimplementedApiServer
- type UnsafeApiServer
Constants ¶
const ( Api_GetMatchIds_FullMethodName = "/vlr.api.Api/GetMatchIds" Api_GetMatch_FullMethodName = "/vlr.api.Api/GetMatch" )
Variables ¶
var ( MatchState_name = map[int32]string{ 0: "MATCH_STATE_UNSPECIFIED", 1: "MATCH_STATE_LIVE", 2: "MATCH_STATE_UPCOMING", 3: "MATCH_STATE_COMPLETED", } MatchState_value = map[string]int32{ "MATCH_STATE_UNSPECIFIED": 0, "MATCH_STATE_LIVE": 1, "MATCH_STATE_UPCOMING": 2, "MATCH_STATE_COMPLETED": 3, } )
Enum value maps for MatchState.
var Api_ServiceDesc = grpc.ServiceDesc{ ServiceName: "vlr.api.Api", HandlerType: (*ApiServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "GetMatchIds", Handler: _Api_GetMatchIds_Handler, }, { MethodName: "GetMatch", Handler: _Api_GetMatch_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "vlr/api/api_service.proto", }
Api_ServiceDesc is the grpc.ServiceDesc for Api service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
var File_vlr_api_api_proto protoreflect.FileDescriptor
var File_vlr_api_api_service_proto protoreflect.FileDescriptor
Functions ¶
func RegisterApiHandler ¶
RegisterApiHandler registers the http handlers for service Api to "mux". The handlers forward requests to the grpc endpoint over "conn".
func RegisterApiHandlerClient ¶
RegisterApiHandlerClient registers the http handlers for service Api to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "ApiClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "ApiClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "ApiClient" to call the correct interceptors.
func RegisterApiHandlerFromEndpoint ¶
func RegisterApiHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)
RegisterApiHandlerFromEndpoint is same as RegisterApiHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterApiHandlerServer ¶
RegisterApiHandlerServer registers the http handlers for service Api to "mux". UnaryRPC :call ApiServer directly. StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterApiHandlerFromEndpoint instead.
func RegisterApiServer ¶
func RegisterApiServer(s grpc.ServiceRegistrar, srv ApiServer)
Types ¶
type ApiClient ¶
type ApiClient interface { GetMatchIds(ctx context.Context, in *GetMatchIdsRequest, opts ...grpc.CallOption) (*GetMatchIdsResponse, error) GetMatch(ctx context.Context, in *GetMatchRequest, opts ...grpc.CallOption) (*GetMatchResponse, error) }
ApiClient is the client API for Api service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
func NewApiClient ¶
func NewApiClient(cc grpc.ClientConnInterface) ApiClient
type ApiServer ¶
type ApiServer interface { GetMatchIds(context.Context, *GetMatchIdsRequest) (*GetMatchIdsResponse, error) GetMatch(context.Context, *GetMatchRequest) (*GetMatchResponse, error) // contains filtered or unexported methods }
ApiServer is the server API for Api service. All implementations must embed UnimplementedApiServer for forward compatibility
type GetMatchIdsRequest ¶
type GetMatchIdsRequest struct { State MatchState `protobuf:"varint,1,opt,name=state,proto3,enum=vlr.api.MatchState" json:"state,omitempty"` From *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=from,proto3" json:"from,omitempty"` To *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=to,proto3" json:"to,omitempty"` Options *GetMatchIdsRequest_Options `protobuf:"bytes,4,opt,name=options,proto3" json:"options,omitempty"` // contains filtered or unexported fields }
* Returns a list of match ids that match the given criteria
You can further limit the results by filling one or more optional *options* fields. - If an event id is provided, *from* and *to* are ignored´
Timestamps are in UTC ¶
If the state is MATCH_STATE_LIVE, the *from* and *to* fields are ignored If the state is MATCH_STATE_UPCOMING and no *from* field is provided, the *from* field is set to the current time, if no *to* field is provided, the *to* field is set to the *from* field +24h If the state is MATCH_STATE_COMPLETED and no *from* field is provided, the *from* field is is set to the *to* field -24h, if no *to* field is provided, the *to* field is set to the current time
func (*GetMatchIdsRequest) Descriptor
deprecated
func (*GetMatchIdsRequest) Descriptor() ([]byte, []int)
Deprecated: Use GetMatchIdsRequest.ProtoReflect.Descriptor instead.
func (*GetMatchIdsRequest) GetFrom ¶
func (x *GetMatchIdsRequest) GetFrom() *timestamppb.Timestamp
func (*GetMatchIdsRequest) GetOptions ¶
func (x *GetMatchIdsRequest) GetOptions() *GetMatchIdsRequest_Options
func (*GetMatchIdsRequest) GetState ¶ added in v0.1.1
func (x *GetMatchIdsRequest) GetState() MatchState
func (*GetMatchIdsRequest) GetTo ¶
func (x *GetMatchIdsRequest) GetTo() *timestamppb.Timestamp
func (*GetMatchIdsRequest) ProtoMessage ¶
func (*GetMatchIdsRequest) ProtoMessage()
func (*GetMatchIdsRequest) ProtoReflect ¶
func (x *GetMatchIdsRequest) ProtoReflect() protoreflect.Message
func (*GetMatchIdsRequest) Reset ¶
func (x *GetMatchIdsRequest) Reset()
func (*GetMatchIdsRequest) String ¶
func (x *GetMatchIdsRequest) String() string
type GetMatchIdsRequest_Options ¶
type GetMatchIdsRequest_Options struct { EventId string `protobuf:"bytes,1,opt,name=event_id,json=eventId,proto3" json:"event_id,omitempty"` // contains filtered or unexported fields }
func (*GetMatchIdsRequest_Options) Descriptor
deprecated
func (*GetMatchIdsRequest_Options) Descriptor() ([]byte, []int)
Deprecated: Use GetMatchIdsRequest_Options.ProtoReflect.Descriptor instead.
func (*GetMatchIdsRequest_Options) GetEventId ¶
func (x *GetMatchIdsRequest_Options) GetEventId() string
func (*GetMatchIdsRequest_Options) ProtoMessage ¶
func (*GetMatchIdsRequest_Options) ProtoMessage()
func (*GetMatchIdsRequest_Options) ProtoReflect ¶
func (x *GetMatchIdsRequest_Options) ProtoReflect() protoreflect.Message
func (*GetMatchIdsRequest_Options) Reset ¶
func (x *GetMatchIdsRequest_Options) Reset()
func (*GetMatchIdsRequest_Options) String ¶
func (x *GetMatchIdsRequest_Options) String() string
type GetMatchIdsResponse ¶
type GetMatchIdsResponse struct { MatchIds []string `protobuf:"bytes,1,rep,name=match_ids,json=matchIds,proto3" json:"match_ids,omitempty"` // contains filtered or unexported fields }
func (*GetMatchIdsResponse) Descriptor
deprecated
func (*GetMatchIdsResponse) Descriptor() ([]byte, []int)
Deprecated: Use GetMatchIdsResponse.ProtoReflect.Descriptor instead.
func (*GetMatchIdsResponse) GetMatchIds ¶
func (x *GetMatchIdsResponse) GetMatchIds() []string
func (*GetMatchIdsResponse) ProtoMessage ¶
func (*GetMatchIdsResponse) ProtoMessage()
func (*GetMatchIdsResponse) ProtoReflect ¶
func (x *GetMatchIdsResponse) ProtoReflect() protoreflect.Message
func (*GetMatchIdsResponse) Reset ¶
func (x *GetMatchIdsResponse) Reset()
func (*GetMatchIdsResponse) String ¶
func (x *GetMatchIdsResponse) String() string
type GetMatchRequest ¶
type GetMatchRequest struct { MatchId string `protobuf:"bytes,1,opt,name=match_id,json=matchId,proto3" json:"match_id,omitempty"` // contains filtered or unexported fields }
Returns a match by its id
func (*GetMatchRequest) Descriptor
deprecated
func (*GetMatchRequest) Descriptor() ([]byte, []int)
Deprecated: Use GetMatchRequest.ProtoReflect.Descriptor instead.
func (*GetMatchRequest) GetMatchId ¶
func (x *GetMatchRequest) GetMatchId() string
func (*GetMatchRequest) ProtoMessage ¶
func (*GetMatchRequest) ProtoMessage()
func (*GetMatchRequest) ProtoReflect ¶
func (x *GetMatchRequest) ProtoReflect() protoreflect.Message
func (*GetMatchRequest) Reset ¶
func (x *GetMatchRequest) Reset()
func (*GetMatchRequest) String ¶
func (x *GetMatchRequest) String() string
type GetMatchResponse ¶
type GetMatchResponse struct { Match *Match `protobuf:"bytes,1,opt,name=match,proto3" json:"match,omitempty"` // contains filtered or unexported fields }
func (*GetMatchResponse) Descriptor
deprecated
func (*GetMatchResponse) Descriptor() ([]byte, []int)
Deprecated: Use GetMatchResponse.ProtoReflect.Descriptor instead.
func (*GetMatchResponse) GetMatch ¶
func (x *GetMatchResponse) GetMatch() *Match
func (*GetMatchResponse) ProtoMessage ¶
func (*GetMatchResponse) ProtoMessage()
func (*GetMatchResponse) ProtoReflect ¶
func (x *GetMatchResponse) ProtoReflect() protoreflect.Message
func (*GetMatchResponse) Reset ¶
func (x *GetMatchResponse) Reset()
func (*GetMatchResponse) String ¶
func (x *GetMatchResponse) String() string
type Match ¶
type Match struct { Head *Match_Head `protobuf:"bytes,1,opt,name=head,proto3" json:"head,omitempty"` Versus *Match_Versus `protobuf:"bytes,2,opt,name=versus,proto3" json:"versus,omitempty"` Maps []*Match_Map `protobuf:"bytes,3,rep,name=maps,proto3" json:"maps,omitempty"` // contains filtered or unexported fields }
func (*Match) Descriptor
deprecated
func (*Match) GetHead ¶
func (x *Match) GetHead() *Match_Head
func (*Match) GetVersus ¶
func (x *Match) GetVersus() *Match_Versus
func (*Match) ProtoMessage ¶
func (*Match) ProtoMessage()
func (*Match) ProtoReflect ¶
func (x *Match) ProtoReflect() protoreflect.Message
type MatchState ¶ added in v0.1.1
type MatchState int32
const ( MatchState_MATCH_STATE_UNSPECIFIED MatchState = 0 MatchState_MATCH_STATE_LIVE MatchState = 1 MatchState_MATCH_STATE_UPCOMING MatchState = 2 MatchState_MATCH_STATE_COMPLETED MatchState = 3 )
func (MatchState) Descriptor ¶ added in v0.1.1
func (MatchState) Descriptor() protoreflect.EnumDescriptor
func (MatchState) Enum ¶ added in v0.1.1
func (x MatchState) Enum() *MatchState
func (MatchState) EnumDescriptor
deprecated
added in
v0.1.1
func (MatchState) EnumDescriptor() ([]byte, []int)
Deprecated: Use MatchState.Descriptor instead.
func (MatchState) Number ¶ added in v0.1.1
func (x MatchState) Number() protoreflect.EnumNumber
func (MatchState) String ¶ added in v0.1.1
func (x MatchState) String() string
func (MatchState) Type ¶ added in v0.1.1
func (MatchState) Type() protoreflect.EnumType
type Match_Head ¶
type Match_Head struct { State MatchState `protobuf:"varint,1,opt,name=state,proto3,enum=vlr.api.MatchState" json:"state,omitempty"` MatchId string `protobuf:"bytes,2,opt,name=match_id,json=matchId,proto3" json:"match_id,omitempty"` Event *Match_Head_Event `protobuf:"bytes,3,opt,name=event,proto3" json:"event,omitempty"` DateTime *timestamppb.Timestamp `protobuf:"bytes,4,opt,name=date_time,json=dateTime,proto3" json:"date_time,omitempty"` // contains filtered or unexported fields }
func (*Match_Head) Descriptor
deprecated
func (*Match_Head) Descriptor() ([]byte, []int)
Deprecated: Use Match_Head.ProtoReflect.Descriptor instead.
func (*Match_Head) GetDateTime ¶
func (x *Match_Head) GetDateTime() *timestamppb.Timestamp
func (*Match_Head) GetEvent ¶
func (x *Match_Head) GetEvent() *Match_Head_Event
func (*Match_Head) GetMatchId ¶
func (x *Match_Head) GetMatchId() string
func (*Match_Head) GetState ¶ added in v0.1.1
func (x *Match_Head) GetState() MatchState
func (*Match_Head) ProtoMessage ¶
func (*Match_Head) ProtoMessage()
func (*Match_Head) ProtoReflect ¶
func (x *Match_Head) ProtoReflect() protoreflect.Message
func (*Match_Head) Reset ¶
func (x *Match_Head) Reset()
func (*Match_Head) String ¶
func (x *Match_Head) String() string
type Match_Head_Event ¶
type Match_Head_Event struct { // vlr.gg/event/{event_id} EventId string `protobuf:"bytes,1,opt,name=event_id,json=eventId,proto3" json:"event_id,omitempty"` Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` Stage string `protobuf:"bytes,3,opt,name=stage,proto3" json:"stage,omitempty"` // contains filtered or unexported fields }
func (*Match_Head_Event) Descriptor
deprecated
func (*Match_Head_Event) Descriptor() ([]byte, []int)
Deprecated: Use Match_Head_Event.ProtoReflect.Descriptor instead.
func (*Match_Head_Event) GetEventId ¶
func (x *Match_Head_Event) GetEventId() string
func (*Match_Head_Event) GetName ¶
func (x *Match_Head_Event) GetName() string
func (*Match_Head_Event) GetStage ¶
func (x *Match_Head_Event) GetStage() string
func (*Match_Head_Event) ProtoMessage ¶
func (*Match_Head_Event) ProtoMessage()
func (*Match_Head_Event) ProtoReflect ¶
func (x *Match_Head_Event) ProtoReflect() protoreflect.Message
func (*Match_Head_Event) Reset ¶
func (x *Match_Head_Event) Reset()
func (*Match_Head_Event) String ¶
func (x *Match_Head_Event) String() string
type Match_Map ¶
type Match_Map struct { Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` Rounds []*Match_Map_Round `protobuf:"bytes,3,rep,name=rounds,proto3" json:"rounds,omitempty"` // contains filtered or unexported fields }
func (*Match_Map) Descriptor
deprecated
func (*Match_Map) GetRounds ¶
func (x *Match_Map) GetRounds() []*Match_Map_Round
func (*Match_Map) ProtoMessage ¶
func (*Match_Map) ProtoMessage()
func (*Match_Map) ProtoReflect ¶
func (x *Match_Map) ProtoReflect() protoreflect.Message
type Match_Map_Round ¶
type Match_Map_Round struct { // the score of the first team Score1 int32 `protobuf:"varint,2,opt,name=score1,proto3" json:"score1,omitempty"` // the score of the second team Score2 int32 `protobuf:"varint,3,opt,name=score2,proto3" json:"score2,omitempty"` // contains filtered or unexported fields }
func (*Match_Map_Round) Descriptor
deprecated
func (*Match_Map_Round) Descriptor() ([]byte, []int)
Deprecated: Use Match_Map_Round.ProtoReflect.Descriptor instead.
func (*Match_Map_Round) GetScore1 ¶
func (x *Match_Map_Round) GetScore1() int32
func (*Match_Map_Round) GetScore2 ¶
func (x *Match_Map_Round) GetScore2() int32
func (*Match_Map_Round) ProtoMessage ¶
func (*Match_Map_Round) ProtoMessage()
func (*Match_Map_Round) ProtoReflect ¶
func (x *Match_Map_Round) ProtoReflect() protoreflect.Message
func (*Match_Map_Round) Reset ¶
func (x *Match_Map_Round) Reset()
func (*Match_Map_Round) String ¶
func (x *Match_Map_Round) String() string
type Match_Versus ¶
type Match_Versus struct { Team1 *Team `protobuf:"bytes,1,opt,name=team1,proto3" json:"team1,omitempty"` // the map score of the first team Score1 int32 `protobuf:"varint,2,opt,name=score1,proto3" json:"score1,omitempty"` Team2 *Team `protobuf:"bytes,3,opt,name=team2,proto3" json:"team2,omitempty"` // the map score of the second team Score2 int32 `protobuf:"varint,4,opt,name=score2,proto3" json:"score2,omitempty"` // contains filtered or unexported fields }
func (*Match_Versus) Descriptor
deprecated
func (*Match_Versus) Descriptor() ([]byte, []int)
Deprecated: Use Match_Versus.ProtoReflect.Descriptor instead.
func (*Match_Versus) GetScore1 ¶
func (x *Match_Versus) GetScore1() int32
func (*Match_Versus) GetScore2 ¶
func (x *Match_Versus) GetScore2() int32
func (*Match_Versus) GetTeam1 ¶
func (x *Match_Versus) GetTeam1() *Team
func (*Match_Versus) GetTeam2 ¶
func (x *Match_Versus) GetTeam2() *Team
func (*Match_Versus) ProtoMessage ¶
func (*Match_Versus) ProtoMessage()
func (*Match_Versus) ProtoReflect ¶
func (x *Match_Versus) ProtoReflect() protoreflect.Message
func (*Match_Versus) Reset ¶
func (x *Match_Versus) Reset()
func (*Match_Versus) String ¶
func (x *Match_Versus) String() string
type Team ¶
type Team struct { // vlr.gg/team/{team_id} TeamId string `protobuf:"bytes,1,opt,name=team_id,json=teamId,proto3" json:"team_id,omitempty"` Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` // contains filtered or unexported fields }
func (*Team) Descriptor
deprecated
func (*Team) ProtoMessage ¶
func (*Team) ProtoMessage()
func (*Team) ProtoReflect ¶
func (x *Team) ProtoReflect() protoreflect.Message
type UnimplementedApiServer ¶
type UnimplementedApiServer struct { }
UnimplementedApiServer must be embedded to have forward compatible implementations.
func (UnimplementedApiServer) GetMatch ¶
func (UnimplementedApiServer) GetMatch(context.Context, *GetMatchRequest) (*GetMatchResponse, error)
func (UnimplementedApiServer) GetMatchIds ¶
func (UnimplementedApiServer) GetMatchIds(context.Context, *GetMatchIdsRequest) (*GetMatchIdsResponse, error)
type UnsafeApiServer ¶
type UnsafeApiServer interface {
// contains filtered or unexported methods
}
UnsafeApiServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to ApiServer will result in compilation errors.