Documentation ¶
Index ¶
- Variables
- func GetFutures(servCtx service.Context) concurrent.IFutures
- func MakeBalanceAddr(servCtx service.Context, serviceName string) string
- func MakeBroadcastAddr(servCtx service.Context, serviceName string) string
- func MakeNodeAddr(servCtx service.Context, nodeId string) (string, error)
- func SendMsg(servCtx service.Context, dst string, msg gap.Msg) error
- type Address
- type DistServiceOptions
- type IDistService
- type IWatcher
- type Option
- func (Option) DecoderMsgCreator(mc gap.IMsgCreator) option.Setting[DistServiceOptions]
- func (Option) Default() option.Setting[DistServiceOptions]
- func (Option) Domain(domain string) option.Setting[DistServiceOptions]
- func (Option) FutureTimeout(d time.Duration) option.Setting[DistServiceOptions]
- func (Option) Meta(meta map[string]string) option.Setting[DistServiceOptions]
- func (Option) RecvMsgHandler(handler RecvMsgHandler) option.Setting[DistServiceOptions]
- func (Option) RefreshInterval(d time.Duration) option.Setting[DistServiceOptions]
- func (Option) Version(version string) option.Setting[DistServiceOptions]
- type RecvMsgHandler
Constants ¶
This section is empty.
Variables ¶
View Source
var ( Name = plugin.Name Using = plugin.Using Install = plugin.Install Uninstall = plugin.Uninstall )
Functions ¶
func GetFutures ¶
func GetFutures(servCtx service.Context) concurrent.IFutures
GetFutures 获取异步模型Future控制器
func MakeBalanceAddr ¶ added in v0.1.25
MakeBalanceAddr 创建服务负载均衡地址
func MakeBroadcastAddr ¶ added in v0.1.25
MakeBroadcastAddr 创建服务广播地址
func MakeNodeAddr ¶ added in v0.1.25
MakeNodeAddr 创建服务节点地址
Types ¶
type Address ¶
type Address struct { Domain string // 主域 BroadcastSubdomain string // 广播地址子域 BalanceSubdomain string // 负载均衡地址子域 NodeSubdomain string // 服务节点地址子域 GlobalBroadcastAddr string // 全局广播地址 GlobalBalanceAddr string // 全局负载均衡地址 ServiceBroadcastAddr string // 服务广播地址 ServiceBalanceAddr string // 服务负载均衡地址 LocalAddr string // 本服务节点地址 }
Address 地址信息
type DistServiceOptions ¶ added in v0.1.22
type DistServiceOptions struct { Version string // 服务版本号 Meta map[string]string // 服务元数据,以键值对的形式保存附加信息 Domain string // 服务地址域 RefreshInterval time.Duration // 服务信息刷新间隔 FutureTimeout time.Duration // 异步模型Future超时时间 DecoderMsgCreator gap.IMsgCreator // 消息包解码器的消息构建器 RecvMsgHandler RecvMsgHandler // 接收消息的处理器(优先级低于监控器) }
DistServiceOptions 所有选项
type IDistService ¶ added in v0.1.22
type IDistService interface { // GetAddress 获取地址信息 GetAddress() Address // GetFutures 获取异步模型Future控制器 GetFutures() concurrent.IFutures // MakeBroadcastAddr 创建服务广播地址 MakeBroadcastAddr(service string) string // MakeBalanceAddr 创建服务负载均衡地址 MakeBalanceAddr(service string) string // MakeNodeAddr 创建服务节点地址 MakeNodeAddr(node string) (string, error) // SendMsg 发送消息 SendMsg(dst string, msg gap.Msg) error // WatchMsg 监听消息(优先级高) WatchMsg(ctx context.Context, handler RecvMsgHandler) IWatcher }
IDistService 分布式服务支持
type Option ¶
type Option struct{}
Option 所有选项设置器
func (Option) DecoderMsgCreator ¶
func (Option) DecoderMsgCreator(mc gap.IMsgCreator) option.Setting[DistServiceOptions]
DecoderMsgCreator 消息包解码器的消息构建器
func (Option) Domain ¶
func (Option) Domain(domain string) option.Setting[DistServiceOptions]
Domain 服务地址域
func (Option) FutureTimeout ¶
FutureTimeout 异步模型Future超时时间
func (Option) RecvMsgHandler ¶
func (Option) RecvMsgHandler(handler RecvMsgHandler) option.Setting[DistServiceOptions]
RecvMsgHandler 接收消息的处理器
func (Option) RefreshInterval ¶
RefreshInterval 服务信息刷新间隔
type RecvMsgHandler ¶
Click to show internal directories.
Click to hide internal directories.