mirror of
https://github.com/FlourishingWorld/hk4e.git
synced 2026-02-09 07:22:26 +08:00
添加了节点服务器,各个服务器之间支持多对多
This commit is contained in:
70
node/api/api.natsrpc.pb.go
Normal file
70
node/api/api.natsrpc.pb.go
Normal file
@@ -0,0 +1,70 @@
|
||||
// Code generated by protoc-gen-natsrpc. DO NOT EDIT.
|
||||
// versions:
|
||||
// - protoc-gen-natsrpc v0.5.0
|
||||
// source: api.proto
|
||||
|
||||
package api
|
||||
|
||||
import (
|
||||
context "context"
|
||||
fmt "fmt"
|
||||
natsrpc "github.com/byebyebruce/natsrpc"
|
||||
nats_go "github.com/nats-io/nats.go"
|
||||
proto "google.golang.org/protobuf/proto"
|
||||
)
|
||||
|
||||
var _ = new(context.Context)
|
||||
var _ = proto.Marshal
|
||||
var _ = fmt.Errorf
|
||||
var _ = natsrpc.Version
|
||||
var _ = nats_go.Version
|
||||
|
||||
// 节点服务器注册发现服务
|
||||
type DiscoveryNATSRPCServer interface {
|
||||
RegisterServer(ctx context.Context, req *RegisterServerReq) (*RegisterServerRsp, error)
|
||||
GetServerAppId(ctx context.Context, req *GetServerAppIdReq) (*GetServerAppIdRsp, error)
|
||||
GetRegionEc2B(ctx context.Context, req *NullMsg) (*RegionEc2B, error)
|
||||
}
|
||||
|
||||
// RegisterDiscoveryNATSRPCServer register Discovery service
|
||||
func RegisterDiscoveryNATSRPCServer(server *natsrpc.Server, s DiscoveryNATSRPCServer, opts ...natsrpc.ServiceOption) (natsrpc.IService, error) {
|
||||
return server.Register("hk4e.node.api.Discovery", s, opts...)
|
||||
}
|
||||
|
||||
// 节点服务器注册发现服务
|
||||
type DiscoveryNATSRPCClient interface {
|
||||
RegisterServer(ctx context.Context, req *RegisterServerReq, opt ...natsrpc.CallOption) (*RegisterServerRsp, error)
|
||||
GetServerAppId(ctx context.Context, req *GetServerAppIdReq, opt ...natsrpc.CallOption) (*GetServerAppIdRsp, error)
|
||||
GetRegionEc2B(ctx context.Context, req *NullMsg, opt ...natsrpc.CallOption) (*RegionEc2B, error)
|
||||
}
|
||||
|
||||
type _DiscoveryNATSRPCClient struct {
|
||||
c *natsrpc.Client
|
||||
}
|
||||
|
||||
// NewDiscoveryNATSRPCClient
|
||||
func NewDiscoveryNATSRPCClient(enc *nats_go.EncodedConn, opts ...natsrpc.ClientOption) (DiscoveryNATSRPCClient, error) {
|
||||
c, err := natsrpc.NewClient(enc, "hk4e.node.api.Discovery", opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
ret := &_DiscoveryNATSRPCClient{
|
||||
c: c,
|
||||
}
|
||||
return ret, nil
|
||||
}
|
||||
func (c *_DiscoveryNATSRPCClient) RegisterServer(ctx context.Context, req *RegisterServerReq, opt ...natsrpc.CallOption) (*RegisterServerRsp, error) {
|
||||
rep := &RegisterServerRsp{}
|
||||
err := c.c.Request(ctx, "RegisterServer", req, rep, opt...)
|
||||
return rep, err
|
||||
}
|
||||
func (c *_DiscoveryNATSRPCClient) GetServerAppId(ctx context.Context, req *GetServerAppIdReq, opt ...natsrpc.CallOption) (*GetServerAppIdRsp, error) {
|
||||
rep := &GetServerAppIdRsp{}
|
||||
err := c.c.Request(ctx, "GetServerAppId", req, rep, opt...)
|
||||
return rep, err
|
||||
}
|
||||
func (c *_DiscoveryNATSRPCClient) GetRegionEc2B(ctx context.Context, req *NullMsg, opt ...natsrpc.CallOption) (*RegionEc2B, error) {
|
||||
rep := &RegionEc2B{}
|
||||
err := c.c.Request(ctx, "GetRegionEc2B", req, rep, opt...)
|
||||
return rep, err
|
||||
}
|
||||
Reference in New Issue
Block a user