Documentation ¶
Index ¶
- type Args
- type MicroCluster
- func (m *MicroCluster) JoinCluster(ctx context.Context, name string, address string, token string, ...) error
- func (m *MicroCluster) ListJoinTokens(ctx context.Context) ([]internalTypes.TokenRecord, error)
- func (m *MicroCluster) LocalClient() (*client.Client, error)
- func (m *MicroCluster) NewCluster(ctx context.Context, name string, address string, config map[string]string) error
- func (m *MicroCluster) NewJoinToken(ctx context.Context, name string) (string, error)
- func (m *MicroCluster) Ready(ctx context.Context) error
- func (m *MicroCluster) RemoteClient(address string) (*client.Client, error)
- func (m *MicroCluster) RevokeJoinToken(ctx context.Context, name string) error
- func (m *MicroCluster) SQL(ctx context.Context, query string) (string, *internalTypes.SQLBatch, error)
- func (m *MicroCluster) Start(ctx context.Context, extensionsAPI []rest.Endpoint, ...) error
- func (m *MicroCluster) Status(ctx context.Context) (*internalTypes.Server, error)
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 ¶
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 ¶
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 ¶
func (m *MicroCluster) SQL(ctx context.Context, query string) (string, *internalTypes.SQLBatch, error)
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 ¶
func (m *MicroCluster) Status(ctx context.Context) (*internalTypes.Server, error)
Status returns basic status information about the cluster.