microcluster

package
v4.0.0-...-60f9e0b Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2024 License: AGPL-3.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Args

type Args struct {
	Test        string
	Test2       string
	Verbose     bool
	Debug       bool
	StateDir    string
	SocketGroup string

	ListenPort string
	Client     *client.Client
	Proxy      func(*http.Request) (*url.URL, error)
}

Args contains options for configuring MicroCluster.

type MicroCluster

type MicroCluster struct {
	FileSystem *sys.OS
	// contains filtered or unexported fields
}

MicroCluster contains some basic filesystem information for interacting with the MicroCluster daemon.

func App

func App(args Args) (*MicroCluster, error)

App returns an instance of MicroCluster with a newly initialized filesystem if one does not exist.

func (*MicroCluster) JoinCluster

func (m *MicroCluster) JoinCluster(ctx context.Context, name string, address string, token string, initConfig map[string]string) error

JoinCluster joins an existing cluster with a join token supplied by an existing cluster member.

func (*MicroCluster) ListJoinTokens

func (m *MicroCluster) ListJoinTokens(ctx context.Context) ([]internalTypes.TokenRecord, error)

ListJoinTokens lists all the join tokens currently available for use.

func (*MicroCluster) LocalClient

func (m *MicroCluster) LocalClient() (*client.Client, error)

LocalClient returns a client connected to the local control socket.

func (*MicroCluster) NewCluster

func (m *MicroCluster) NewCluster(ctx context.Context, name string, address string, config map[string]string) error

NewCluster bootstrapps a brand new cluster with this daemon as its only member.

func (*MicroCluster) NewJoinToken

func (m *MicroCluster) NewJoinToken(ctx context.Context, name string) (string, error)

NewJoinToken creates and records a new join token containing all the necessary credentials for joining a cluster. Join tokens are tied to the server certificate of the joining node, and will be deleted once the node has joined the cluster.

func (*MicroCluster) Ready

func (m *MicroCluster) Ready(ctx context.Context) error

Ready waits for the daemon to report it has finished initial setup and is ready to be bootstrapped or join an existing cluster.

func (*MicroCluster) RemoteClient

func (m *MicroCluster) RemoteClient(address string) (*client.Client, error)

RemoteClient gets a client for the specified cluster member URL. The filesystem will be parsed for the cluster and server certificates.

func (*MicroCluster) RevokeJoinToken

func (m *MicroCluster) RevokeJoinToken(ctx context.Context, name string) error

RevokeJoinToken revokes the token record stored under the given name.

func (*MicroCluster) SQL

SQL performs either a GET or POST on /internal/sql with a given query. This is a useful helper for using direct SQL.

func (*MicroCluster) Start

func (m *MicroCluster) Start(ctx context.Context, extensionsAPI []rest.Endpoint, extensionsSchema []schema.Update, apiExtensions []string, hooks *config.Hooks) error

Start starts up a brand new MicroCluster daemon. Only the local control socket will be available at this stage, no database exists yet. Any api or schema extensions can be applied here. - `extensionsSchema` is a list of schema updates in the order that they should be applied. - `extensionsAPI` is a list of endpoints to be served over `/1.0`. - `hooks` are a set of functions that trigger at certain points during cluster communication.

func (*MicroCluster) Status

Status returns basic status information about the cluster.

Jump to

Keyboard shortcuts

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