Documentation ¶
Index ¶
- Constants
- Variables
- func RegisterHostServer(s grpc.ServiceRegistrar, srv HostServer)
- func RegisterPluginServer(s grpc.ServiceRegistrar, srv PluginServer)
- func TyrInitHelper(hostServer HostServer, pluginServer PluginServer)
- type Helper
- type HostClient
- type HostServer
- type HostXClient
- func (x HostXClient) AskAction(userId string, actions []*proto.Action) *proto.AskAction_Resp
- func (x HostXClient) AskAction0(req *proto.AskAction_Req) *proto.AskAction_Resp
- func (x HostXClient) GetPlayerInfo(userId string) *proto.GetPlayerInfo_Resp
- func (x HostXClient) GetPlayerInfo0(req *proto.GetPlayerInfo_Req) *proto.GetPlayerInfo_Resp
- func (x HostXClient) RegisterNotify(event []string) *proto.RegisterNotify_Resp
- func (x HostXClient) RegisterNotify0(req *proto.RegisterNotify_Req) *proto.RegisterNotify_Resp
- type HostXServer
- type PluginClient
- type PluginServer
- type PluginXClient
- func (x PluginXClient) GetPluginInfo() *proto.GetPluginInfo_Resp
- func (x PluginXClient) GetPluginInfo0(req *proto.GetPluginInfo_Req) *proto.GetPluginInfo_Resp
- func (x PluginXClient) StartGame(name string, seed uint64) *proto.StartGame_Resp
- func (x PluginXClient) StartGame0(req *proto.StartGame_Req) *proto.StartGame_Resp
- type PluginXServer
- type Rand
- type UnimplementedHostServer
- func (UnimplementedHostServer) AskAction(context.Context, *proto.AskAction_Req) (*proto.AskAction_Resp, error)
- func (UnimplementedHostServer) GetPlayerInfo(context.Context, *proto.GetPlayerInfo_Req) (*proto.GetPlayerInfo_Resp, error)
- func (UnimplementedHostServer) RegisterNotify(context.Context, *proto.RegisterNotify_Req) (*proto.RegisterNotify_Resp, error)
- type UnimplementedPluginServer
- type UnsafeHostServer
- type UnsafePluginServer
Constants ¶
const ( Host_GetPlayerInfo_FullMethodName = "/proto.Host/GetPlayerInfo" Host_RegisterNotify_FullMethodName = "/proto.Host/RegisterNotify" Host_AskAction_FullMethodName = "/proto.Host/AskAction" )
const ( Plugin_GetPluginInfo_FullMethodName = "/proto.Plugin/GetPluginInfo" Plugin_StartGame_FullMethodName = "/proto.Plugin/StartGame" )
Variables ¶
var File_service_proto protoreflect.FileDescriptor
var Host_ServiceDesc = grpc.ServiceDesc{ ServiceName: "proto.Host", HandlerType: (*HostServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "GetPlayerInfo", Handler: _Host_GetPlayerInfo_Handler, }, { MethodName: "RegisterNotify", Handler: _Host_RegisterNotify_Handler, }, { MethodName: "AskAction", Handler: _Host_AskAction_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "service.proto", }
Host_ServiceDesc is the grpc.ServiceDesc for Host service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
var Plugin_ServiceDesc = grpc.ServiceDesc{ ServiceName: "proto.Plugin", HandlerType: (*PluginServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "GetPluginInfo", Handler: _Plugin_GetPluginInfo_Handler, }, { MethodName: "StartGame", Handler: _Plugin_StartGame_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "service.proto", }
Plugin_ServiceDesc is the grpc.ServiceDesc for Plugin service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterHostServer ¶
func RegisterHostServer(s grpc.ServiceRegistrar, srv HostServer)
func RegisterPluginServer ¶
func RegisterPluginServer(s grpc.ServiceRegistrar, srv PluginServer)
func TyrInitHelper ¶
func TyrInitHelper(hostServer HostServer, pluginServer PluginServer)
Types ¶
type Helper ¶
type Helper struct {
*HostXClient
}
type HostClient ¶
type HostClient interface { GetPlayerInfo(ctx context.Context, in *proto.GetPlayerInfo_Req, opts ...grpc.CallOption) (*proto.GetPlayerInfo_Resp, error) RegisterNotify(ctx context.Context, in *proto.RegisterNotify_Req, opts ...grpc.CallOption) (*proto.RegisterNotify_Resp, error) AskAction(ctx context.Context, in *proto.AskAction_Req, opts ...grpc.CallOption) (*proto.AskAction_Resp, error) }
HostClient is the client API for Host 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 NewHostClient ¶
func NewHostClient(cc grpc.ClientConnInterface) HostClient
func NewHostClientFromServer ¶
func NewHostClientFromServer(x HostServer) HostClient
type HostServer ¶
type HostServer interface { GetPlayerInfo(context.Context, *proto.GetPlayerInfo_Req) (*proto.GetPlayerInfo_Resp, error) RegisterNotify(context.Context, *proto.RegisterNotify_Req) (*proto.RegisterNotify_Resp, error) AskAction(context.Context, *proto.AskAction_Req) (*proto.AskAction_Resp, error) }
HostServer is the server API for Host service. All implementations should embed UnimplementedHostServer for forward compatibility
func NewHostServerFromXServer ¶
func NewHostServerFromXServer(server HostXServer) HostServer
type HostXClient ¶
type HostXClient struct {
// contains filtered or unexported fields
}
func NewHostXClient ¶
func NewHostXClient(c HostClient) *HostXClient
func (HostXClient) AskAction ¶
func (x HostXClient) AskAction(userId string, actions []*proto.Action) *proto.AskAction_Resp
func (HostXClient) AskAction0 ¶
func (x HostXClient) AskAction0(req *proto.AskAction_Req) *proto.AskAction_Resp
func (HostXClient) GetPlayerInfo ¶
func (x HostXClient) GetPlayerInfo(userId string) *proto.GetPlayerInfo_Resp
func (HostXClient) GetPlayerInfo0 ¶
func (x HostXClient) GetPlayerInfo0(req *proto.GetPlayerInfo_Req) *proto.GetPlayerInfo_Resp
func (HostXClient) RegisterNotify ¶
func (x HostXClient) RegisterNotify(event []string) *proto.RegisterNotify_Resp
func (HostXClient) RegisterNotify0 ¶
func (x HostXClient) RegisterNotify0(req *proto.RegisterNotify_Req) *proto.RegisterNotify_Resp
type HostXServer ¶
type HostXServer interface { GetPlayerInfo(req *proto.GetPlayerInfo_Req, resp *proto.GetPlayerInfo_Resp) RegisterNotify(req *proto.RegisterNotify_Req, resp *proto.RegisterNotify_Resp) AskAction(req *proto.AskAction_Req, resp *proto.AskAction_Resp) }
type PluginClient ¶
type PluginClient interface { GetPluginInfo(ctx context.Context, in *proto.GetPluginInfo_Req, opts ...grpc.CallOption) (*proto.GetPluginInfo_Resp, error) StartGame(ctx context.Context, in *proto.StartGame_Req, opts ...grpc.CallOption) (*proto.StartGame_Resp, error) }
PluginClient is the client API for Plugin 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 NewPluginClient ¶
func NewPluginClient(cc grpc.ClientConnInterface) PluginClient
func NewPluginClientFromServer ¶
func NewPluginClientFromServer(x PluginServer) PluginClient
type PluginServer ¶
type PluginServer interface { GetPluginInfo(context.Context, *proto.GetPluginInfo_Req) (*proto.GetPluginInfo_Resp, error) StartGame(context.Context, *proto.StartGame_Req) (*proto.StartGame_Resp, error) }
PluginServer is the server API for Plugin service. All implementations should embed UnimplementedPluginServer for forward compatibility
func NewPluginServerFromXServer ¶
func NewPluginServerFromXServer(server PluginXServer) PluginServer
type PluginXClient ¶
type PluginXClient struct {
// contains filtered or unexported fields
}
func NewPluginXClient ¶
func NewPluginXClient(c PluginClient) *PluginXClient
func (PluginXClient) GetPluginInfo ¶
func (x PluginXClient) GetPluginInfo() *proto.GetPluginInfo_Resp
func (PluginXClient) GetPluginInfo0 ¶
func (x PluginXClient) GetPluginInfo0(req *proto.GetPluginInfo_Req) *proto.GetPluginInfo_Resp
func (PluginXClient) StartGame ¶
func (x PluginXClient) StartGame(name string, seed uint64) *proto.StartGame_Resp
func (PluginXClient) StartGame0 ¶
func (x PluginXClient) StartGame0(req *proto.StartGame_Req) *proto.StartGame_Resp
type PluginXServer ¶
type PluginXServer interface { GetPluginInfo(helper *Helper, req *proto.GetPluginInfo_Req, resp *proto.GetPluginInfo_Resp) StartGame(helper *Helper, req *proto.StartGame_Req, resp *proto.StartGame_Resp) }
type UnimplementedHostServer ¶
type UnimplementedHostServer struct { }
UnimplementedHostServer should be embedded to have forward compatible implementations.
func (UnimplementedHostServer) AskAction ¶
func (UnimplementedHostServer) AskAction(context.Context, *proto.AskAction_Req) (*proto.AskAction_Resp, error)
func (UnimplementedHostServer) GetPlayerInfo ¶
func (UnimplementedHostServer) GetPlayerInfo(context.Context, *proto.GetPlayerInfo_Req) (*proto.GetPlayerInfo_Resp, error)
func (UnimplementedHostServer) RegisterNotify ¶
func (UnimplementedHostServer) RegisterNotify(context.Context, *proto.RegisterNotify_Req) (*proto.RegisterNotify_Resp, error)
type UnimplementedPluginServer ¶
type UnimplementedPluginServer struct { }
UnimplementedPluginServer should be embedded to have forward compatible implementations.
func (UnimplementedPluginServer) GetPluginInfo ¶
func (UnimplementedPluginServer) GetPluginInfo(context.Context, *proto.GetPluginInfo_Req) (*proto.GetPluginInfo_Resp, error)
func (UnimplementedPluginServer) StartGame ¶
func (UnimplementedPluginServer) StartGame(context.Context, *proto.StartGame_Req) (*proto.StartGame_Resp, error)
type UnsafeHostServer ¶
type UnsafeHostServer interface {
// contains filtered or unexported methods
}
UnsafeHostServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to HostServer will result in compilation errors.
type UnsafePluginServer ¶
type UnsafePluginServer interface {
// contains filtered or unexported methods
}
UnsafePluginServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to PluginServer will result in compilation errors.