cluster

package
v0.0.0-...-43a2903 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2018 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	GitHashNote = "Git Commit Hash"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AnsibleCluster

type AnsibleCluster struct {
	// contains filtered or unexported fields
}

func NewAnsibleCluster

func NewAnsibleCluster(ctx context.Context, meta *clusterMeta) *AnsibleCluster

func (*AnsibleCluster) Accessor

func (c *AnsibleCluster) Accessor() *sql.DB

func (*AnsibleCluster) Boostrap

func (c *AnsibleCluster) Boostrap() error

func (*AnsibleCluster) Close

func (c *AnsibleCluster) Close() error

func (*AnsibleCluster) Deploy

func (c *AnsibleCluster) Deploy() error

func (*AnsibleCluster) Destory

func (c *AnsibleCluster) Destory() error

func (*AnsibleCluster) Open

func (c *AnsibleCluster) Open() error

func (*AnsibleCluster) Prepare

func (c *AnsibleCluster) Prepare() error

func (*AnsibleCluster) Reset

func (c *AnsibleCluster) Reset() error

func (*AnsibleCluster) Start

func (c *AnsibleCluster) Start() error

func (*AnsibleCluster) Stop

func (c *AnsibleCluster) Stop() error

type AnsibleConfig

type AnsibleConfig struct {
	Dir      string        `toml:"dir"`
	Clusters []*ClusterDSN `toml:"clusters"`
}

type BinPackage

type BinPackage struct {
	Repo     string `json:"repo"`
	Branch   string `json:"branch"`
	Tag      string `json:"tag"`
	GitHash  string `json:"git_hash"`
	Platform string `json:"platform"`
	BinUrl   string `json:"binary_url"`
}

func (*BinPackage) Valid

func (p *BinPackage) Valid() bool

type Cluster

type Cluster interface {
	Prepare() error // Prepare resources.
	Deploy() error  // Deploy resources.
	Start() error   // Start cluster.
	Stop() error    // Stop cluster.
	Close() error   // Close cluster.
	Reset() error   // Cleanup cluster data.
	Destory() error // Cleanup Cluster data and resources.
	Accessor() *sql.DB
}

type ClusterDSN

type ClusterDSN struct {
	Name     string `toml:"name"`
	Host     string `toml:"host"`
	Port     int    `toml:"port"`
	DB       string `toml:"db"`
	User     string `toml:"user"`
	Password string `toml:"password"`
}

type ClusterManager

type ClusterManager struct {
	// contains filtered or unexported fields
}

func NewClusterManager

func NewClusterManager(ctx context.Context, cfg *AnsibleConfig) (*ClusterManager, error)

func (*ClusterManager) ReleaseCluster

func (cm *ClusterManager) ReleaseCluster(name string)

func (*ClusterManager) RequireCluster

func (cm *ClusterManager) RequireCluster(pd, tikv, tidb *BinPackage) (Cluster, error)

Jump to

Keyboard shortcuts

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