Documentation ¶
Index ¶
- Variables
- func CalculateBase64(s string) string
- func CalculateFileMD5(fn string) (string, error)
- func CheckPortAvailable(ip string, port int) bool
- func CopyFile(s, t string) error
- func CreateSymlink(target, symlink string) error
- func DirExists(path string) bool
- func FileExists(path string) bool
- func GetAvailablePort(host string) (int, error)
- func IsLabelMatch(labelSelector string, labels map[string]string) (bool, error)
- func LoadYAML(path string, out interface{}) error
- func NewTLSConfigClient(c Certificate) (*tls.Config, error)
- func NewTLSConfigServer(c Certificate) (*tls.Config, error)
- func ParseEnv(data []byte) ([]byte, error)
- func ParseURL(addr string) (*url.URL, error)
- func PathExists(path string) bool
- func PrintVersion()
- func SetDefaults(ptr interface{}) error
- func Tar(sources []string, destination string) error
- func Trace(f func(string, ...log.Field), msg string, fields ...log.Field) func()
- func UnmarshalJSON(in []byte, out interface{}) error
- func UnmarshalYAML(in []byte, out interface{}) error
- func Untar(source, destination string) error
- func Unzip(source, destination string) error
- func Version() string
- func WriteFile(fn string, r io.Reader) error
- func Zip(sources []string, destination string) error
- type Certificate
- type Length
- type Size
- type Tomb
Constants ¶
This section is empty.
Variables ¶
var ( ErrStillAlive = tb.ErrStillAlive ErrDying = tb.ErrDying )
all errors
var ( VERSION = "unknown" REVISION = "unknown" )
Compile parameter
Functions ¶
func CalculateBase64 ¶
CalculateBase64 calculates base64 encoding value of target string
func CalculateFileMD5 ¶
CalculateFileMD5 calculates file MD5 in hex format
func CheckPortAvailable ¶ added in v2.0.46
func CreateSymlink ¶
CreateSymlink create symlink of target
func GetAvailablePort ¶ added in v2.0.42
GetAvailablePort finds an available port
func IsLabelMatch ¶ added in v2.0.67
IsLabelMatch match resource according to labels
func NewTLSConfigClient ¶
func NewTLSConfigClient(c Certificate) (*tls.Config, error)
NewTLSConfigClient loads tls config for client
func NewTLSConfigServer ¶
func NewTLSConfigServer(c Certificate) (*tls.Config, error)
NewTLSConfigServer loads tls config for server
func PrintVersion ¶ added in v2.0.13
func PrintVersion()
func UnmarshalJSON ¶
UnmarshalJSON unmarshals, defaults and validates
func UnmarshalYAML ¶
UnmarshalYAML unmarshals, defaults and validates
Types ¶
type Certificate ¶
type Certificate struct { CA string `yaml:"ca" json:"ca"` Key string `yaml:"key" json:"key"` Cert string `yaml:"cert" json:"cert"` Name string `yaml:"name" json:"name"` InsecureSkipVerify bool `yaml:"insecureSkipVerify" json:"insecureSkipVerify"` // for client, for test purpose tls.ClientAuthType `yaml:"clientAuthType" json:"clientAuthType"` }
Certificate certificate config for server Name : serverNameOverride, same to CommonName in server.pem if Name == "" , link would not verifies the server's certificate chain and host name AuthType : declares the policy the server will follow for TLS Client Authentication
type Length ¶
type Length struct {
Max int64 `yaml:"max" json:"max"`
}
Length length ! Length is deprecated, please to use Size
func (*Length) MarshalYAML ¶
MarshalYAML implements the Marshaller interface
func (*Length) UnmarshalYAML ¶
UnmarshalYAML customizes unmarshal
type Size ¶
type Size int64
Size size
func (Size) MarshalJSON ¶
MarshalJSON customizes marshal
func (Size) MarshalYAML ¶
MarshalYAML customizes marshal
func (*Size) UnmarshalJSON ¶
UnmarshalJSON customizes unmarshal
func (*Size) UnmarshalYAML ¶
UnmarshalYAML customizes unmarshal
type Tomb ¶
type Tomb struct {
// contains filtered or unexported fields
}
Tomb wraps tomb.Tomb
func (*Tomb) Dead ¶
func (t *Tomb) Dead() <-chan struct{}
Dead returns the channel that can be used to wait until all goroutines have finished running.
func (*Tomb) Dying ¶
func (t *Tomb) Dying() <-chan struct{}
Dying returns the channel that can be used to wait until t.Kill is called.
func (*Tomb) Err ¶
Err returns the death reason, or ErrStillAlive if the tomb is not in a dying or dead state.