Documentation
¶
Index ¶
- Constants
- func EnableMonitor(listen string) error
- func Forward(serviceName string, packet *pkt.LogicPkt) error
- func HashCode(key string) int
- func Init(srv him.Server, deps ...string) error
- func Push(server string, p *pkt.LogicPkt) error
- func SetDialer(dialer him.Dialer)
- func SetSelector(selector Selector)
- func SetServiceNaming(nm naming.Naming)
- func Start() error
- type ClientMap
- type ClientMapImpl
- type Container
- type HashSelector
- type Selector
Constants ¶
View Source
const ( StateYoung = "young" StateAdult = "adult" )
新/旧服务
View Source
const (
KeyServiceState = "service_state"
)
Variables ¶
This section is empty.
Functions ¶
func EnableMonitor ¶
func SetSelector ¶
func SetSelector(selector Selector)
SetSelector set a default selector 用于上层业务注册一个自定义的服务路由器
Types ¶
type ClientMap ¶
type ClientMap interface { Add(client him.Client) Remove(clientId string) Get(clientId string) (client him.Client, ok bool) Services(kvs ...string) []him.Service }
func NewClientMap ¶
type ClientMapImpl ¶
type ClientMapImpl struct {
// contains filtered or unexported fields
}
func (*ClientMapImpl) Add ¶
func (ch *ClientMapImpl) Add(client him.Client)
func (*ClientMapImpl) Get ¶
func (ch *ClientMapImpl) Get(clientId string) (client him.Client, ok bool)
func (*ClientMapImpl) Remove ¶
func (ch *ClientMapImpl) Remove(clientId string)
type Container ¶
Click to show internal directories.
Click to hide internal directories.