Documentation
¶
Index ¶
- Constants
- func AesDecrypt(ciphertext, key []byte) ([]byte, error)
- func AesEncrypt(plaintext, key []byte) ([]byte, error)
- func AppendEnv(paramEnv map[string]string, includeHostEnv bool) []string
- func CalculateFileMD5(fn string) (string, error)
- func DirExists(path string) bool
- func Equal(a, b interface{}) bool
- func FileExists(path string) bool
- func GetAvailablePort(host string) (int, error)
- func GetEnv(key string) string
- func LoadYAML(path string, out interface{}) error
- func NewAesKey() []byte
- func NewTLSClientConfig(c Certificate) (*tls.Config, error)
- func NewTLSServerConfig(c Certificate) (*tls.Config, error)
- func ParseURL(addr string) (*url.URL, error)
- func RsaPrivateDecrypt(data, privateKey []byte) ([]byte, error)
- func RsaPrivateEncrypt(data, privateKey []byte) ([]byte, error)
- func RsaPublicDecrypt(data, publicKey []byte) ([]byte, error)
- func RsaPublicEncrypt(data, publicKey []byte) ([]byte, error)
- func SetDefaults(ptr interface{}) error
- func SetEnv(key, value string) 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 Disk
- type Gpu
- type Length
- type Mem
- type Swap
- type Tomb
Constants ¶
const ( AesIvLen = 16 AesKeyLen = 32 AesKeyCharSet = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" )
AES aes
Variables ¶
This section is empty.
Functions ¶
func AesDecrypt ¶
AesDecrypt decrypts data using the specified key
func AesEncrypt ¶
AesEncrypt encrypts data using the specified key
func CalculateFileMD5 ¶
CalculateFileMD5 calculates file MD5
func GetAvailablePort ¶
GetAvailablePort finds an available port
func NewTLSClientConfig ¶
func NewTLSClientConfig(c Certificate) (*tls.Config, error)
NewTLSClientConfig loads tls config for client
func NewTLSServerConfig ¶
func NewTLSServerConfig(c Certificate) (*tls.Config, error)
NewTLSServerConfig loads tls config for server
func RsaPrivateDecrypt ¶
RsaPrivateDecrypt decrypts data using private key
func RsaPrivateEncrypt ¶
RsaPrivateEncrypt encrypts data using private key
func RsaPublicDecrypt ¶
RsaPublicDecrypt decrypts data using public key
func RsaPublicEncrypt ¶
RsaPublicEncrypt encrypts data using public key
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"`
Insecure bool `yaml:"insecure" json:"insecure"` // for client, for test purpose
}
Certificate certificate config for mqtt server
type Length ¶
type Length struct {
Max int64 `yaml:"max" json:"max"`
}
Length length
func (*Length) UnmarshalYAML ¶
UnmarshalYAML customizes unmarshal
type Tomb ¶
type Tomb struct {
// contains filtered or unexported fields
}
Tomb wraps tomb.Tomb
func (*Tomb) Dying ¶
func (t *Tomb) Dying() <-chan struct{}
Dying returns the channel that can be used to wait until t.Kill is called.