server

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 15, 2023 License: Apache-2.0 Imports: 3 Imported by: 1

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL