meta

package
v1.0.8 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2020 License: Apache-2.0 Imports: 11 Imported by: 1

Documentation

Index

Constants

View Source
const (
	TypeConflict = "conflict"
	TypeMismatch = "mismatch"
)

error types

View Source
const (

	// PatchDirName is the directory to store patch file eg. {PatchDirName}/tidb-hotfix.tar.gz
	PatchDirName = "patch"
	// BackupDirName is the directory to save backup files.
	BackupDirName = "backup"
)

Variables

View Source
var (

	// ErrCreateDirFailed is ErrCreateDirFailed
	ErrCreateDirFailed = errNS.NewType("create_dir_failed")
	// ErrSaveMetaFailed is ErrSaveMetaFailed
	ErrSaveMetaFailed = errNS.NewType("save_meta_failed")
)
View Source
var (
	// ErrValidate is an empty ValidateErr object, useful for type checking
	ErrValidate = &ValidateErr{}
)

Functions

This section is empty.

Types

type DirPaths

type DirPaths struct {
	Deploy string
	Data   []string
	Log    string
	Cache  string
}

DirPaths stores the paths needed for component to put files

func (DirPaths) String

func (p DirPaths) String() string

String implements the fmt.Stringer interface

type ResourceControl

type ResourceControl struct {
	MemoryLimit         string `yaml:"memory_limit,omitempty"`
	CPUQuota            string `yaml:"cpu_quota,omitempty"`
	IOReadBandwidthMax  string `yaml:"io_read_bandwidth_max,omitempty"`
	IOWriteBandwidthMax string `yaml:"io_write_bandwidth_max,omitempty"`
}

ResourceControl is used to control the system resource See: https://www.freedesktop.org/software/systemd/man/systemd.resource-control.html

type SpecManager added in v1.0.8

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

SpecManager control management of spec meta data.

func NewSpec added in v1.0.8

func NewSpec(base string) *SpecManager

NewSpec create a spec instance.

func (*SpecManager) Exist added in v1.0.8

func (s *SpecManager) Exist(name string) (exist bool, err error)

Exist check if the cluster exist by checking the meta file.

func (*SpecManager) List added in v1.0.8

func (s *SpecManager) List() (names []string, err error)

List return the cluster names.

func (*SpecManager) Metadata added in v1.0.8

func (s *SpecManager) Metadata(clusterName string, meta interface{}) error

Metadata tries to read the metadata of a cluster from file

func (*SpecManager) Path added in v1.0.8

func (s *SpecManager) Path(cluster string, subpath ...string) string

Path returns the full path to a subpath (file or directory) of a cluster, it is a subdir in the profile dir of the user, with the cluster name as its name.

func (*SpecManager) SaveMeta added in v1.0.8

func (s *SpecManager) SaveMeta(clusterName string, meta interface{}) error

SaveMeta save the meta with specified cluster name.

type ValidateErr

type ValidateErr struct {
	Type   string      // conflict type
	Target string      // conflict Target
	Value  interface{} // conflict Value
	LHS    string      // object 1
	RHS    string      // object 2
}

ValidateErr is the error when meta validation fails with conflicts

func (*ValidateErr) Error

func (e *ValidateErr) Error() string

Error implements the error interface

func (*ValidateErr) Is

func (e *ValidateErr) Is(target error) bool

Is implements the error interface

func (*ValidateErr) Unwrap

func (e *ValidateErr) Unwrap() error

Unwrap implements the error interface

Jump to

Keyboard shortcuts

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