mysqlsh

package
v0.0.0-...-9aebcc3 Latest Latest
Warning

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

Go to latest
Published: May 15, 2019 License: Apache-2.0 Imports: 11 Imported by: 8

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewErrorFromStderr

func NewErrorFromStderr(stderr string) error

NewErrorFromStderr parses the given output from mysql-shell into an Error if one is present.

Types

type Error

type Error struct {
	Type    string
	Message string
	// contains filtered or unexported fields
}

Error holds errors from mysql-shell commands.

func (*Error) Error

func (e *Error) Error() string

type Interface

type Interface interface {
	IsClustered(ctx context.Context) bool
	// CreateCluster creates a new InnoDB cluster called
	// innodb.DefaultClusterName.
	CreateCluster(ctx context.Context, opts Options) (*innodb.ClusterStatus, error)
	// GetClusterStatus gets the status of the innodb.DefaultClusterName InnoDB
	// cluster.
	GetClusterStatus(ctx context.Context) (*innodb.ClusterStatus, error)
	// CheckInstanceState verifies the existing data on the instance (specified
	// by URI) does not prevent it from joining a cluster.
	CheckInstanceState(ctx context.Context, uri string) (*innodb.InstanceState, error)
	// AddInstanceToCluster adds the instance (specified by URI) the InnoDB
	// cluster.
	AddInstanceToCluster(ctx context.Context, uri string, opts Options) error
	// RejoinInstanceToCluster rejoins an instance (specified by URI) to the
	// InnoDB cluster.
	RejoinInstanceToCluster(ctx context.Context, uri string, opts Options) error
	// RemoveInstanceFromCluster removes an instance (specified by URI) to the
	// InnoDB cluster.
	RemoveInstanceFromCluster(ctx context.Context, uri string, opts Options) error
	// RebootClusterFromCompleteOutage recovers a cluster when all of its members
	// have failed.
	RebootClusterFromCompleteOutage(ctx context.Context) error
}

Interface is an injectable interface for running mysqlsh commands.

func New

func New(exec utilexec.Interface, uri string) Interface

New creates a new MySQL Shell Interface.

type Options

type Options map[string]string

Options holds the options passed to individual mysqlsh commands.

func (Options) String

func (opts Options) String() string

String encodes options as a Python dictionary string.

Jump to

Keyboard shortcuts

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