Documentation ¶
Index ¶
- Variables
- func AddRemoteService(ses lib.Session, svcId, name string)
- func Db(dbAlias string) *mysql.Client
- func GetDiscoveryAddr() string
- func GetLocalSvcId() string
- func GetProcName() string
- func GetRemoteService(svcId string) lib.Session
- func GetSvcGroup() string
- func GetSvcIndex() int
- func GetWANIP() string
- func MakeLocalSvcId(svcName string) string
- func MakeSvcId(svcName string, svcIndex int, svcGroup string) string
- func ParseSvcId(svcid string) (svcName string, svcIndex int, svcGroup string, err error)
- func RemoveRemoteService(ses lib.Session)
- func Reply(ev lib.Event, msg interface{})
- func SetRemoteServiceNotify(mode string, callback NotifyFunc)
- func StartMysql()
- func VisitRemoteService(callback func(ses lib.Session, ctx *RemoteServiceContext) bool)
- type MatchRule
- type NotifyFunc
- type RemoteServiceContext
- type SvcEventHooker
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrInvalidRelayMessage = errors.New("invalid relay message") ErrInvalidRelayPassthroughType = errors.New("invalid relay passthrough type") )
View Source
var ( // 独立出来避免污染工具类的flagset CommandLine = flag.NewFlagSet(os.Args[0], flag.ExitOnError) )
View Source
var (
LinkRules []MatchRule // 互联发现规则
)
Functions ¶
func AddRemoteService ¶
func AddRemoteService(ses lib.Session, svcId, name string)
func GetDiscoveryAddr ¶
func GetDiscoveryAddr() string
func GetSvcGroup ¶
func GetSvcGroup() string
func GetSvcIndex ¶
func GetSvcIndex() int
func ParseSvcId ¶
func RemoveRemoteService ¶
func RemoveRemoteService(ses lib.Session)
func StartMysql ¶
func StartMysql()
func VisitRemoteService ¶
func VisitRemoteService(callback func(ses lib.Session, ctx *RemoteServiceContext) bool)
遍历远程服务(已经连接到本进程)
Types ¶
type MatchRule ¶
type MatchRule struct {
Target string
}
func ParseMatchRule ¶
return util.WildcardPatternMatch(desc.GetMeta("SvcGroup"), rule.Target) }
type NotifyFunc ¶
type NotifyFunc func(ctx *RemoteServiceContext, ses lib.Session)
type RemoteServiceContext ¶
func SessionToContext ¶
func SessionToContext(ses lib.Session) *RemoteServiceContext
取得其他服务器的会话对应的上下文
type SvcEventHooker ¶
type SvcEventHooker struct { }
服务互联消息处理
func (SvcEventHooker) OnInboundEvent ¶
func (SvcEventHooker) OnInboundEvent(inputEvent lib.Event) (outputEvent lib.Event)
func (SvcEventHooker) OnOutboundEvent ¶
func (SvcEventHooker) OnOutboundEvent(inputEvent lib.Event) (outputEvent lib.Event)
Click to show internal directories.
Click to hide internal directories.