daemon

package
v0.0.0-...-3659ccf Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2024 License: AGPL-3.0 Imports: 33 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Daemon

type Daemon struct {
	ReadyChan chan struct{} // Closed when the daemon is fully ready.

	Extensions extensions.Extensions // Extensions supported at runtime by the daemon.
	// contains filtered or unexported fields
}

Daemon holds information for the microcluster daemon.

func NewDaemon

func NewDaemon(project string) *Daemon

NewDaemon initializes the Daemon context and channels.

func (*Daemon) Address

func (d *Daemon) Address() *api.URL

Address ensures both the daemon and state have the same address.

func (*Daemon) ClusterCert

func (d *Daemon) ClusterCert() *shared.CertInfo

ClusterCert ensures both the daemon and state have the same cluster cert.

func (*Daemon) Name

func (d *Daemon) Name() string

Name ensures both the daemon and state have the same name.

func (*Daemon) ReloadClusterCert

func (d *Daemon) ReloadClusterCert() error

ReloadClusterCert reloads the cluster keypair from the state directory.

func (*Daemon) Run

func (d *Daemon) Run(ctx context.Context, listenPort string, stateDir string, socketGroup string, extensionsAPI []rest.Endpoint, extensionsSchema []schema.Update, apiExtensions []string, hooks *config.Hooks) error

Run initializes the Daemon with the given configuration, starts the database, and blocks until the daemon is cancelled. - `extensionsAPI` is a list of endpoints to be served over `/1.0`. - `extensionsSchema` is a list of schema updates in the order that they should be applied. - `hooks` are a set of functions that trigger at certain points during cluster communication.

func (*Daemon) ServerCert

func (d *Daemon) ServerCert() *shared.CertInfo

ServerCert ensures both the daemon and state have the same server cert.

func (*Daemon) StartAPI

func (d *Daemon) StartAPI(bootstrap bool, initConfig map[string]string, newConfig *trust.Location, joinAddresses ...string) error

StartAPI starts up the admin and consumer APIs, and generates a cluster cert if we are bootstrapping the first node.

func (*Daemon) State

func (d *Daemon) State() *state.State

State creates a State instance with the daemon's stateful components.

Jump to

Keyboard shortcuts

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