Documentation ¶
Index ¶
- Variables
- func CalculateBase64(s string) string
- func CalculateFileMD5(fn string) (string, error)
- func CopyFile(s, t string) error
- func CreateSymlink(target, symlink string) error
- func DirExists(path string) bool
- func FileExists(path string) bool
- func LoadYAML(path string, out interface{}) error
- func MarshalYAML(in interface{}, outPath string) error
- func NewTLSConfigClient(c Certificate) (*tls.Config, error)
- func NewTLSConfigServer(c Certificate) (*tls.Config, error)
- func ParseEnv(data []byte) ([]byte, error)
- func PathExists(path string) bool
- func SetDefaults(ptr interface{}) error
- func UnmarshalJSON(in []byte, out interface{}) error
- func UnmarshalYAML(in []byte, out interface{}) error
- func WriteFile(fn string, r io.Reader) error
- type Certificate
- type Length
- type Size
- type Tomb
Constants ¶
This section is empty.
Variables ¶
var ( ErrStillAlive = tb.ErrStillAlive ErrDying = tb.ErrDying )
all errors
Functions ¶
func CalculateBase64 ¶
CalculateBase64 calculates base64 encoding value of target string
func CalculateFileMD5 ¶
CalculateFileMD5 calculates file MD5
func CreateSymlink ¶
CreateSymlink create symlink of target
func MarshalYAML ¶
MarshalYAML write config to file
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 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 }
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.