Help us shape the future of Go! Take the 2026 Go Developer Survey

instance

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2020 License: Apache-2.0 Imports: 20 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	ConfigPath string
	BinPath    string
	Num        int
	Host       string
}

Config of the instance.

type Instance

type Instance interface {
	Pid() int
	Start(ctx context.Context, version v0manifest.Version, binPath string) error
	Wait() error
}

Instance represent running component

type PDInstance

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

PDInstance represent a running pd-server

func NewPDInstance

func NewPDInstance(dir, host, configPath string, id int) *PDInstance

NewPDInstance return a PDInstance

func (*PDInstance) Addr

func (inst *PDInstance) Addr() string

Addr return the listen address of PD

func (*PDInstance) Join

func (inst *PDInstance) Join(pds []*PDInstance) *PDInstance

Join set endpoints field of PDInstance

func (*PDInstance) Pid

func (inst *PDInstance) Pid() int

Pid return the PID of the instance

func (*PDInstance) Start

func (inst *PDInstance) Start(ctx context.Context, version v0manifest.Version, binPath string) error

Start calls set inst.cmd and Start

func (*PDInstance) Wait

func (inst *PDInstance) Wait() error

Wait calls inst.cmd.Wait

type TiDBInstance

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

TiDBInstance represent a running tidb-server

func NewTiDBInstance

func NewTiDBInstance(dir, host, configPath string, id int, pds []*PDInstance) *TiDBInstance

NewTiDBInstance return a TiDBInstance

func (*TiDBInstance) Addr

func (inst *TiDBInstance) Addr() string

Addr return the listen address of TiDB

func (*TiDBInstance) Pid

func (inst *TiDBInstance) Pid() int

Pid return the PID of the instance

func (*TiDBInstance) Start

func (inst *TiDBInstance) Start(ctx context.Context, version v0manifest.Version, binPath string) error

Start calls set inst.cmd and Start

func (*TiDBInstance) Wait

func (inst *TiDBInstance) Wait() error

Wait calls inst.cmd.Wait

type TiFlashInstance

type TiFlashInstance struct {
	TCPPort         int
	ServicePort     int
	ProxyPort       int
	ProxyStatusPort int
	ProxyConfigPath string
	// contains filtered or unexported fields
}

TiFlashInstance represent a running TiFlash

func NewTiFlashInstance

func NewTiFlashInstance(dir, host, configPath string, id int, pds []*PDInstance, dbs []*TiDBInstance) *TiFlashInstance

NewTiFlashInstance return a TiFlashInstance

func (*TiFlashInstance) Pid

func (inst *TiFlashInstance) Pid() int

Pid return the PID of the instance

func (*TiFlashInstance) Start

func (inst *TiFlashInstance) Start(ctx context.Context, version v0manifest.Version, binPath string) error

Start calls set inst.cmd and Start

func (*TiFlashInstance) StoreAddr

func (inst *TiFlashInstance) StoreAddr() string

StoreAddr return the store address of TiFlash

func (*TiFlashInstance) Wait

func (inst *TiFlashInstance) Wait() error

Wait calls inst.cmd.Wait

type TiKVInstance

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

TiKVInstance represent a running tikv-server

func NewTiKVInstance

func NewTiKVInstance(dir, host, configPath string, id int, pds []*PDInstance) *TiKVInstance

NewTiKVInstance return a TiKVInstance

func (*TiKVInstance) Pid

func (inst *TiKVInstance) Pid() int

Pid return the PID of the instance

func (*TiKVInstance) Start

func (inst *TiKVInstance) Start(ctx context.Context, version v0manifest.Version, binPath string) error

Start calls set inst.cmd and Start

func (*TiKVInstance) StoreAddr

func (inst *TiKVInstance) StoreAddr() string

StoreAddr return the store address of TiKV

func (*TiKVInstance) Wait

func (inst *TiKVInstance) Wait() error

Wait calls inst.cmd.Wait

Jump to

Keyboard shortcuts

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