Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var OnHeartbeatHook func(state *State) error
OnHeartbeatHook is a post-action hook that is run on the leader after a successful heartbeat round.
View Source
var OnNewMemberHook func(state *State) error
OnNewMemberHook is a post-action hook that is run on all cluster members when a new cluster member joins the cluster.
View Source
var PostRemoveHook func(state *State, force bool) error
PostRemoveHook is a post-action hook that is run on all cluster members when a cluster member is removed.
View Source
var PreRemoveHook func(state *State, force bool) error
PreRemoveHook is a post-action hook that is run on a cluster member just before it is is removed.
View Source
var ReloadClusterCert func() error
ReloadClusterCert reloads the cluster keypair from the state directory.
View Source
var StopListeners func() error
StopListeners stops the network listeners and the fsnotify listener.
Functions ¶
This section is empty.
Types ¶
type State ¶
type State struct { // Context. Context context.Context // Ready channel. ReadyCh chan struct{} // ShutdownDoneCh receives the result of the d.Stop() function and tells the daemon to end. ShutdownDoneCh chan error // File structure. OS *sys.OS // Listen Address. Address func() *api.URL // Name of the cluster member. Name func() string // Server. Endpoints *endpoints.Endpoints // Server certificate is used for server-to-server connection. ServerCert func() *shared.CertInfo // Cluster certificate is used for downstream connections within a cluster. ClusterCert func() *shared.CertInfo // Database. Database *db.DB // Remotes. Remotes func() *trust.Remotes // Initialize APIs and bootstrap/join database. StartAPI func(bootstrap bool, initConfig map[string]string, newConfig *trust.Location, joinAddresses ...string) error // Stop fully stops the daemon, its database, and all listeners. Stop func() (exit func(), stopErr error) // Runtime extensions. Extensions extensions.Extensions }
State is a gateway to the stateful components of the microcluster daemon.
Click to show internal directories.
Click to hide internal directories.