Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // DefaultAddress default addr DefaultAddress = ":0" // DefaultName default name DefaultName = "go.micro.server" // DefaultVersion version DefaultVersion = "latest" // DefaultID node of id DefaultID = uuid.New().String() // DefaultNamingServer ... // DefaultNamingServer Server = newNamingServer() // DefaultRegisterInterval ... DefaultRegisterInterval = time.Second * 30 // DefaultRegisterTTL ... DefaultRegisterTTL = time.Minute // NewServer creates a new server NewServer func(...Option) Server = newNamingServer )
Functions ¶
func NewNamingResolver ¶
func NewNamingResolver(opts ...Option) *namingResolver
NewNamingResolver new one
Types ¶
type Option ¶
type Option func(*Options)
Option option list
func RegisterInterval ¶
RegisterInterval Register the service with at interval
func RegisterTTL ¶
RegisterTTL Register the service with a TTL
func WithRegistryNaming ¶
WithRegistryNaming 注册naming 服务发现
type Options ¶
type Options struct { Name string Address string // Advertise string ID string Version string // registry // The register expiry time RegisterTTL time.Duration // The interval on which to register RegisterInterval time.Duration Registry *registry.Registry Server *grpc.Server Listener net.Listener }
Options is a simple micro server abstraction
Click to show internal directories.
Click to hide internal directories.