protoservice

package
v0.0.0-...-7299733 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 6, 2024 License: BSD-3-Clause Imports: 9 Imported by: 1

Documentation

Index

Constants

View Source
const (
	Host_GetPlayerInfo_FullMethodName  = "/proto.Host/GetPlayerInfo"
	Host_RegisterNotify_FullMethodName = "/proto.Host/RegisterNotify"
	Host_AskAction_FullMethodName      = "/proto.Host/AskAction"
)
View Source
const (
	Plugin_GetPluginInfo_FullMethodName = "/proto.Plugin/GetPluginInfo"
	Plugin_StartGame_FullMethodName     = "/proto.Plugin/StartGame"
)

Variables

View Source
var File_service_proto protoreflect.FileDescriptor
View Source
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)

View Source
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
}

func (*Helper) NewRand

func (h *Helper) NewRand(seed uint64) *Rand

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

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 (HostXClient) RegisterNotify

func (x HostXClient) RegisterNotify(event []string) *proto.RegisterNotify_Resp

func (HostXClient) RegisterNotify0

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 (PluginXClient) StartGame

func (x PluginXClient) StartGame(name string, seed uint64) *proto.StartGame_Resp

func (PluginXClient) StartGame0

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 Rand

type Rand = rand.Rand

type UnimplementedHostServer

type UnimplementedHostServer struct {
}

UnimplementedHostServer should be embedded to have forward compatible implementations.

func (UnimplementedHostServer) AskAction

func (UnimplementedHostServer) GetPlayerInfo

func (UnimplementedHostServer) RegisterNotify

type UnimplementedPluginServer

type UnimplementedPluginServer struct {
}

UnimplementedPluginServer should be embedded to have forward compatible implementations.

func (UnimplementedPluginServer) GetPluginInfo

func (UnimplementedPluginServer) StartGame

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.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL