utils

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2023 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// Version082 hserver version <= v0.8.2 or == 0.8.4 should
	// start without `--seed` argument
	Version082 = Version{0, 8, 2, false}
	Version084 = Version{0, 8, 4, false}
	// Version090 hserver version >= v0.9.0 need call server init
	Version090 = Version{0, 9, 0, false}
	// Version095 hserver version > v0.9.5 should replace argument
	// `--zkuri` to `--meta-store` when start
	Version095 = Version{0, 9, 5, false}
	// Version096 hserver version > v0.9.6 should replace argument
	// `--meta-store` to `--metastore-uri`
	Version096 = Version{0, 9, 6, false}
	// Version0100 hserver version >= v0.10.0 should support rqlite
	// as meta store
	Version0100 = Version{0, 10, 0, false}
	// Version0101 hserver version >= v0.10.1 should replace argument
	// `--host` and `--address` to `--bind-address` and
	// `--advertised-address`, `--compression` should be removed
	Version0101 = Version{0, 10, 1, false}
)

Functions

func CheckExist

func CheckExist(path string) bool

func CheckSSHAuthentication

func CheckSSHAuthentication(identityFile string, usePassword bool) (string, string, error)

func CompareVersion

func CompareVersion(lh, rh Version) int

func MakeDirs

func MakeDirs(dirs []DirCfg) error

func RenderTable added in v0.3.0

func RenderTable(headers []string, data [][]string) (string, error)

func ScpDir

func ScpDir(originPath, remotePath string) []executor.Position

func ShowComponents added in v0.3.0

func ShowComponents(mp map[string][]DisplayedComponent)

Types

type DirCfg

type DirCfg struct {
	Path string
	Perm fs.FileMode
}

type DisplayedComponent added in v0.3.0

type DisplayedComponent struct {
	Name          string
	Host          string
	Ports         string
	ContainerName string
	Image         string
	Paths         string
}

type Show added in v0.3.0

type Show interface {
	// Display will return components info with following columns:
	// | component name | host | ports | Image | container name | paths |
	Display() map[string]DisplayedComponent
}

type Version

type Version struct {
	Major, Minor, Patch int
	IsLatest            bool
}

func CreateVersion

func CreateVersion(ver string) Version

Jump to

Keyboard shortcuts

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