Documentation ¶
Index ¶
- Variables
- 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) TTL(ttl 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 = self.Name Using = self.Using Install = self.Install Uninstall = self.Uninstall )
Functions ¶
This section is empty.
Types ¶
type Address ¶
type Address struct { Domain string // 主域 BroadcastSubdomain string // 广播地址子域 BalanceSubdomain string // 负载均衡地址子域 NodeSubdomain string // 服务节点地址子域 GlobalBroadcastAddr string // 全局广播地址 GlobalBalanceAddr string // 全局负载均衡地址 BroadcastAddr string // 服务广播地址 BalanceAddr string // 服务负载均衡地址 LocalAddr string // 本服务节点地址 }
Address 地址信息
type DistServiceOptions ¶
type DistServiceOptions struct { Version string // 服务版本号 Meta map[string]string // 服务元数据,以键值对的形式保存附加信息 Domain string // 服务地址域 TTL time.Duration // 服务信息过期时间 FutureTimeout time.Duration // 异步模型Future超时时间 DecoderMsgCreator gap.IMsgCreator // 消息包解码器的消息构建器 RecvMsgHandler RecvMsgHandler // 接收消息的处理器(优先级低于监控器) }
DistServiceOptions 所有选项
type IDistService ¶
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 接收消息的处理器
type RecvMsgHandler ¶
Click to show internal directories.
Click to hide internal directories.