代码拉取完成,页面将自动刷新
package module
import (
"gitee.com/micro-tools/wf/extend/utils/gmicro/registry"
"gitee.com/micro-tools/wf/extend/utils/gmicro/selector"
"gitee.com/micro-tools/wf/os/glog"
"time"
)
// Option 配置项
type Option func(*Options)
type Trace struct {
Status bool
Name string
URL string
}
type Options struct {
Version string
Debug bool
Tracing Trace
Log *glog.Logger
KillWaitTTL time.Duration
RegistryEnable bool //是否使用注册中心
Registry registry.Registry
RegisterInterval time.Duration
RegisterTTL time.Duration
Port int
Selector selector.Selector
RPCExpired time.Duration
}
func Version(version string) Option {
return func(o *Options) {
o.Version = version
}
}
func Debug(t bool) Option {
return func(o *Options) {
o.Debug = t
}
}
func Tracing(t Trace) Option {
return func(o *Options) {
o.Tracing = t
}
}
func Port(port int) Option {
return func(o *Options) {
o.Port = port
}
}
// KillWaitTTL specifies the interval on which to re-register
func KillWaitTTL(t time.Duration) Option {
return func(o *Options) {
o.KillWaitTTL = t
}
}
// RegisterTTL specifies the TTL to use when registering the service
func RegisterTTL(t time.Duration) Option {
return func(o *Options) {
o.RegisterTTL = t
}
}
// RegisterInterval specifies the interval on which to re-register
func RegisterInterval(t time.Duration) Option {
return func(o *Options) {
o.RegisterInterval = t
}
}
// Registry sets the registry for the service
// and the underlying components
func Registry(r registry.Registry) Option {
return func(o *Options) {
o.Registry = r
}
}
// RegistryEnable sets the registry for the service status open or close
func RegistryEnable(status bool) Option {
return func(o *Options) {
o.RegistryEnable = status
}
}
//RPC超时时间
func RPCExpired(t time.Duration) Option {
return func(o *Options) {
o.RPCExpired = t
}
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。