util

package
v0.30.0 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AppendPrefix

func AppendPrefix(prefix string, keys []string) []string

func ArrayShift

func ArrayShift(array *[]string, position int, value string)

func IsConfigChanged

func IsConfigChanged(src, dest string) (bool, error)

IsConfigChanged reports whether src and dest config files are equal. Two config files are equal when they have the same file contents and Unix permissions. The owner, group, and mode must match. It return false in other cases.

func IsDirectory

func IsDirectory(path string) (bool, error)

func IsFileExist

func IsFileExist(fpath string) bool

isFileExist reports whether path exits.

func RecursiveDirsLookup

func RecursiveDirsLookup(root string, pattern string) ([]string, error)

func RecursiveFilesLookup

func RecursiveFilesLookup(root string, pattern string) ([]string, error)

Types

type FileInfo

type FileInfo struct {
	Uid  uint32
	Gid  uint32
	Mode os.FileMode
	Md5  string
}

fileInfo describes a configuration file and is returned by fileStat.

func FileStat

func FileStat(name string) (fi FileInfo, err error)

filestat return a FileInfo describing the named file.

type Nodes

type Nodes []string

Nodes is a custom flag Var representing a list of etcd nodes.

func (*Nodes) Set

func (n *Nodes) Set(node string) error

Set appends the node to the etcd node list.

func (*Nodes) String

func (n *Nodes) String() string

String returns the string representation of a node var.

Jump to

Keyboard shortcuts

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