metadata

package
v0.1.0-beta.11 Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// BaseDir is the working directory of gtctl and
	// all the metadata will be stored in ${HomeDir}/${BaseDir}.
	BaseDir = ".gtctl"

	ClusterLogsDir = "logs"
	ClusterDataDir = "data"
	ClusterPidsDir = "pids"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ClusterScopeDirs

type ClusterScopeDirs struct {
	BaseDir    string
	LogsDir    string
	DataDir    string
	PidsDir    string
	ConfigPath string
}

type Manager

type Manager interface {
	// AllocateArtifactFilePath allocates the file path of the artifact.
	AllocateArtifactFilePath(src *artifacts.Source, installBinary bool) (string, error)

	// AllocateClusterScopeDirs allocates the directories and config path of one cluster.
	AllocateClusterScopeDirs(clusterName string)

	// SetHomeDir sets the home directory of the metadata manager.
	SetHomeDir(dir string) error

	// GetWorkingDir returns the working directory of the metadata manager.
	// It should be ${HomeDir}/${BaseDir}.
	GetWorkingDir() string

	// CreateClusterScopeDirs creates cluster scope directories and config path that allocated by AllocateClusterScopeDirs.
	CreateClusterScopeDirs(cfg *config.BareMetalClusterConfig) error

	// GetClusterScopeDirs returns the cluster scope directory of current cluster.
	GetClusterScopeDirs() *ClusterScopeDirs

	// Clean cleans up all the metadata. It will remove the working directory.
	Clean() error
}

Manager is the interface of the metadata manager. The metadata manager is responsible for managing all the metadata of gtctl.

func New

func New(homeDir string) (Manager, error)

Jump to

Keyboard shortcuts

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