cluster

package
v0.0.0-...-c2ba8ab Latest Latest
Warning

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

Go to latest
Published: May 28, 2020 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckNodeInCluster

func CheckNodeInCluster(ctx context.Context) error

CheckNodeInCluster checks whether or not the local MySQL instance is a member of an InnoDB cluster.

func GetClusterStatus

func GetClusterStatus(ctx context.Context) (*innodb.ClusterStatus, error)

GetClusterStatus returns a JSON string representing the status of the InnoDb MySQL cluster. TODO: Remove me.

Types

type Instance

type Instance struct {
	// Namespace is the Kubernetes Namespace in which the instance is running.
	Namespace string
	// ClusterName is the name of the MySQLCluster to which the instance
	// belongs.
	ClusterName string
	// ParentName is the name of the StatefulSet to which the instance belongs.
	ParentName string
	// Ordinal is the StatefulSet ordinal of the instances Pod.
	Ordinal int
	// Port is the port on which MySQLDB is listening.
	Port int
	// MultiMaster specifies if all, or just a single, instance is configured to be read/write.
	MultiMaster bool
}

Instance represents the local MySQL instance.

func NewInstance

func NewInstance(namespace, clusterName, parentName string, ordinal, port int, multiMaster bool) *Instance

NewInstance creates a new Instance.

func NewInstanceFromGroupSeed

func NewInstanceFromGroupSeed(seed string) (*Instance, error)

NewInstanceFromGroupSeed creates an Instance from a fully qualified group seed.

func NewLocalInstance

func NewLocalInstance() (*Instance, error)

NewLocalInstance creates a new instance of this structure, with it's name and index populated from os.Hostname().

func (*Instance) GetPassword

func (i *Instance) GetPassword() string

GetPassword returns the password of the MySQL operator's management user.

func (*Instance) GetShellURI

func (i *Instance) GetShellURI() string

GetShellURI returns the MySQL shell URI for the local MySQL instance.

func (*Instance) GetUser

func (i *Instance) GetUser() string

GetUser returns the username of the MySQL operator's management user.

func (*Instance) Name

func (i *Instance) Name() string

Name returns the name of the instance.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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