Documentation ¶
Index ¶
- Variables
- func AppendFile(fileName string, content string) error
- func AppendIPList(src, dst []string) []string
- func AssemblyIPList(args *string) error
- func AtomicWriteFile(filepath string, data []byte, perm os.FileMode) (err error)
- func CheckCmdIsExist(cmd string) (string, bool)
- func CheckIP(i string) bool
- func CleanDir(dir string)
- func CleanDirs(dirs ...string)
- func CleanFile(file *os.File)
- func CleanFiles(file ...string) error
- func Cmd(name string, args ...string) error
- func CmdOutput(name string, args ...string) ([]byte, error)
- func CompareIP(v1, v2 string) (int, error)
- func ContainList(list []string, toComplete string) (containerList []string)
- func CopyDir(srcPath, dstPath string) error
- func CopySingleFile(src, dst string) (int64, error)
- func CountDirFiles(dirName string) int
- func DecodeCluster(filepath string) (clusters []v1.Cluster, err error)
- func DecodeConfigs(filepath string) (configs []v1.Config, err error)
- func DecodePlugins(filepath string) (plugins []v1.Plugin, err error)
- func DedupeStrSlice(in []string) []string
- func DisassembleIPList(arg string) (res []string)
- func ExecutableFilePath() string
- func FileMD5(path string) (string, error)
- func GenUniqueID(n int) string
- func GetClusterFromFile(filepath string) (cluster *v2.Cluster, err error)
- func GetDefaultClusterName() (string, error)
- func GetDiffHosts(hostsOld, hostsNew []string) (add, sub []string)
- func GetDockerAuthInfoFromDocker(domain string) (types.AuthConfig, error)
- func GetFileSize(path string) (size int64, err error)
- func GetFilesSize(paths []string) (int64, error)
- func GetHostIP(host string) string
- func GetHostIPAndPortOrDefault(host, Default string) (string, string)
- func GetHostIPSlice(hosts []string) (res []string)
- func GetLocalHostAddresses() (*[]net.Addr, error)
- func GetSSHHostIPAndPort(host string) (string, string)
- func IPToInt(v string) *big.Int
- func InList(key string, slice []string) bool
- func IsDir(path string) bool
- func IsExist(fileName string) bool
- func IsFileContent(fileName string, content string) bool
- func IsFileExist(filename string) bool
- func IsHostPortExist(protocol string, hostname string, port int) bool
- func IsInContainer() bool
- func IsLocalIP(ip string, addrs *[]net.Addr) bool
- func Lgetxattr(path string, attr string) ([]byte, error)
- func Lsetxattr(path string, attr string, data []byte, flags int) error
- func MD5(body []byte) string
- func MarshalConfigsToYaml(in ...interface{}) ([]byte, error)
- func MarshalConfigsYaml(configs ...interface{}) ([]byte, error)
- func MarshalJSONToFile(file string, obj interface{}) error
- func MarshalYamlToFile(file string, obj interface{}) error
- func MkDirs(dirs ...string) error
- func MkFileFullPathDir(fileName string) error
- func MkTmpFile(path string) (*os.File, error)
- func MkTmpdir() (string, error)
- func Mkdir(dirName string) error
- func NextIP(ip string) net.IP
- func NotIn(key string, slice []string) bool
- func NotInIPList(key string, slice []string) bool
- func ParseCIDRString(s string) (string, error)
- func ReadAll(fileName string) ([]byte, error)
- func ReadLines(fileName string) ([]string, error)
- func RecursionCopy(src, dst string) error
- func RecursionHardLink(src, dst string) error
- func RecursionHardLinkDir(src, dst string, modTimes *[]*tar.Header) error
- func ReduceIPList(src, dst []string) []string
- func RemoveDuplicate(list []string) []string
- func RemoveFileContent(fileName string, content string) error
- func RemoveIPList(src, dst []string) []string
- func Retry(tryTimes int, trySleepTime time.Duration, action func() error) error
- func Reverse(s []string) []string
- func RunSimpleCmd(cmd string) (string, error)
- func SaveClusterInfoToFile(cluster runtime.Object, clusterName string) error
- func SaveClusterfile(cluster *v1.Cluster) error
- func SetDockerConfig(hostname, username, password string) error
- func SetRootfsBinToSystemEnv(rootfs string) error
- func SortIPList(iplist []string)
- func UnmarshalYamlFile(file string, obj interface{}) error
- func WrapExecResult(host, command string, output []byte, err error) error
- func WriteFile(fileName string, content []byte) error
- func YamlMatcher(path string) bool
- type AuthItem
- type CIDR
- type DockerInfo
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrClusterNotExist = fmt.Errorf("no cluster exist")
Functions ¶
func AppendFile ¶
func AppendIPList ¶
func AssemblyIPList ¶ added in v0.5.0
func AtomicWriteFile ¶ added in v0.3.0
func CheckCmdIsExist ¶
func CleanFiles ¶
func ContainList ¶ added in v0.5.2
func CopySingleFile ¶
cp a.txt /tmp/mytest/a.txt
func CountDirFiles ¶
func DecodeCluster ¶ added in v0.3.4
func DecodeConfigs ¶ added in v0.3.4
func DecodePlugins ¶ added in v0.3.4
func DedupeStrSlice ¶ added in v0.6.0
func DisassembleIPList ¶ added in v0.5.0
func ExecutableFilePath ¶
func ExecutableFilePath() string
func GetClusterFromFile ¶ added in v0.5.2
func GetDefaultClusterName ¶ added in v0.5.0
func GetDiffHosts ¶
func GetDockerAuthInfoFromDocker ¶ added in v0.1.5
func GetDockerAuthInfoFromDocker(domain string) (types.AuthConfig, error)
func GetFileSize ¶ added in v0.5.0
func GetFilesSize ¶ added in v0.5.0
func GetHostIPAndPortOrDefault ¶ added in v0.3.0
func GetHostIPSlice ¶
func GetLocalHostAddresses ¶ added in v0.6.1
func GetSSHHostIPAndPort ¶ added in v0.3.0
func IsFileContent ¶ added in v0.5.0
func IsFileExist ¶
func IsHostPortExist ¶ added in v0.5.0
func IsInContainer ¶ added in v0.3.0
func IsInContainer() bool
func Lgetxattr ¶ added in v0.3.3
Lgetxattr retrieves the value of the extended attribute identified by attr and associated with the given path in the file system. It will returns a nil slice and nil error if the xattr is not set.
func Lsetxattr ¶ added in v0.3.3
Lsetxattr sets the value of the extended attribute identified by attr and associated with the given path in the file system.
func MarshalConfigsToYaml ¶ added in v0.6.0
func MarshalConfigsYaml ¶ added in v0.6.0
func MarshalJSONToFile ¶ added in v0.6.0
func MarshalYamlToFile ¶
func MkFileFullPathDir ¶
file ./test/dir/xxx.txt if dir ./test/dir not exist, create it
func NotInIPList ¶ added in v0.3.0
func ParseCIDRString ¶ added in v0.1.5
Parse CIDR Fix to Standard CIDR
func RecursionCopy ¶
copy a.txt /var/lib/a.txt copy /root/test/abc /tmp/abc
func RecursionHardLink ¶ added in v0.3.3
func RecursionHardLinkDir ¶ added in v0.3.3
func ReduceIPList ¶
func RemoveDuplicate ¶ added in v0.3.0
func RemoveFileContent ¶
func RemoveIPList ¶ added in v0.6.0
func RunSimpleCmd ¶
func SaveClusterInfoToFile ¶ added in v0.6.0
func SaveClusterfile ¶ added in v0.3.0
func SetDockerConfig ¶
func SetRootfsBinToSystemEnv ¶ added in v0.5.2
func SortIPList ¶
func SortIPList(iplist []string)
func UnmarshalYamlFile ¶
func WrapExecResult ¶ added in v0.6.0
func YamlMatcher ¶ added in v0.6.0
Types ¶
type CIDR ¶ added in v0.1.5
type CIDR struct {
// contains filtered or unexported fields
}
https://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing CIDR doc: IPv4 network Addr/prefixLength 192.168.1.0/24 IPv6 network Addr/prefixLength 2001:db8::/64
type DockerInfo ¶
func DockerConfig ¶
func DockerConfig() (*DockerInfo, error)
func (DockerInfo) DecodeDockerAuth ¶
func (d DockerInfo) DecodeDockerAuth(hostname string) (string, string, error)
func (DockerInfo) LocalDockerAuth ¶
func (d DockerInfo) LocalDockerAuth(hostname string) string
Source Files ¶
Click to show internal directories.
Click to hide internal directories.