Documentation
¶
Index ¶
- func NewGameEtcdWatcher(scheme string, client *clientv3.Client) *etcdWatcher
- type Client
- type Config
- type GameClientClusterInterface
- type GameGrpcConn
- type GameRpcCluster
- func (self *GameRpcCluster) Close()
- func (self *GameRpcCluster) GetGameClientConns() []*GameGrpcConn
- func (self *GameRpcCluster) Handle(fn func(gconns []*GameGrpcConn))
- func (self *GameRpcCluster) Register(whatcher WatchInterface)
- func (self *GameRpcCluster) ResolveNow()
- func (self *GameRpcCluster) Start()
- func (self *GameRpcCluster) UpdateState(servInfos []*ServInfo) error
- func (self *GameRpcCluster) Wait()
- type Resolver
- type ServInfo
- type Server
- type WatchInterface
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewGameEtcdWatcher ¶
Types ¶
type Client ¶
type Client struct { Namespace string DialBalance string // default:round_robin ClientConn *grpc.ClientConn // contains filtered or unexported fields }
common balance cluster the balance was desided by grpc
func NewClient ¶
func NewClient(assignment option.Assignment) *Client
func (*Client) Dial ¶
func (self *Client) Dial(target string, opts ...grpc.DialOption) (*grpc.ClientConn, error)
as same as grpc.Dial.
type GameGrpcConn ¶
type GameGrpcConn struct { *grpc.ClientConn Info ServInfo }
func (*GameGrpcConn) Close ¶
func (self *GameGrpcConn) Close()
func (*GameGrpcConn) Dial ¶
func (self *GameGrpcConn) Dial(target string, opts ...grpc.DialOption) error
func (*GameGrpcConn) GetState ¶
func (self *GameGrpcConn) GetState() connectivity.State
type GameRpcCluster ¶
type GameRpcCluster struct {
// contains filtered or unexported fields
}
func NewGameGrpcCluster ¶
func NewGameGrpcCluster(assignment option.Assignment) *GameRpcCluster
func (*GameRpcCluster) Close ¶
func (self *GameRpcCluster) Close()
func (*GameRpcCluster) GetGameClientConns ¶
func (self *GameRpcCluster) GetGameClientConns() []*GameGrpcConn
func (*GameRpcCluster) Handle ¶
func (self *GameRpcCluster) Handle(fn func(gconns []*GameGrpcConn))
func (*GameRpcCluster) Register ¶
func (self *GameRpcCluster) Register(whatcher WatchInterface)
func (*GameRpcCluster) ResolveNow ¶
func (self *GameRpcCluster) ResolveNow()
func (*GameRpcCluster) Start ¶
func (self *GameRpcCluster) Start()
func (*GameRpcCluster) UpdateState ¶
func (self *GameRpcCluster) UpdateState(servInfos []*ServInfo) error
type Resolver ¶
type Resolver interface { GameClientClusterInterface }
type ServInfo ¶
type ServInfo struct { AddrToRpc string AddrToClient string Name string // contains filtered or unexported fields }
func NewServInfo ¶
type Server ¶
type Server struct { ID string Addr string AddrToClient string TTL int64 Namespace string LeaseKeepAliveResponse <-chan *clientv3.LeaseKeepAliveResponse // contains filtered or unexported fields }
func NewServer ¶
func NewServer(assignment option.Assignment) *Server
func (*Server) RegisterService ¶
func (*Server) Serv ¶
func (self *Server) Serv(opts ...grpc.ServerOption)
suitable grpc option configration
type WatchInterface ¶
type WatchInterface interface { Scheme() string Watch(target resolver.Target, cc GameClientClusterInterface, assignment option.Assignment) (Resolver, error) }
Click to show internal directories.
Click to hide internal directories.