Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Server ¶
type Server interface { // Name returns the unique Name for this server in the cluster. Name() string // GetAddr returns the address of the server. GetAddr() string // Context returns the context of server. Context() context.Context // Run runs the server. Run() error // Close closes the server. Close() // GetLeaderListenUrls gets service endpoints from the leader in election group. GetLeaderListenUrls() []string // GetClient returns builtin etcd client. GetClient() *clientv3.Client // GetHTTPClient returns builtin http client. GetHTTPClient() *http.Client // AddStartCallback adds a callback in the startServer phase. AddStartCallback(callbacks ...func()) // IsServing returns whether the server is the leader, if there is embedded etcd, or the primary otherwise. IsServing() bool // AddServiceReadyCallback adds callbacks when the server becomes the leader, if there is embedded etcd, or the primary otherwise. AddServiceReadyCallback(callbacks ...func(context.Context)) }
Server defines the common basic behaviors of a server
Click to show internal directories.
Click to hide internal directories.