Documentation ¶
Overview ¶
******************************************************************************
- Copyright 2017 Dell Inc.
- Copyright (c) 2019 Intel Corporation *
- Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
- in compliance with the License. You may obtain a copy of the License at *
- http://www.apache.org/licenses/LICENSE-2.0 *
- Unless required by applicable law or agreed to in writing, software distributed under the License
- is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
- or implied. See the License for the specific language governing permissions and limitations under
- the License. ******************************************************************************
******************************************************************************
- Copyright 2017 Dell Inc.
- Copyright (c) 2019 Intel Corporation *
- Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
- in compliance with the License. You may obtain a copy of the License at *
- http://www.apache.org/licenses/LICENSE-2.0 *
- Unless required by applicable law or agreed to in writing, software distributed under the License
- is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
- or implied. See the License for the specific language governing permissions and limitations under
- the License. ******************************************************************************
Index ¶
- func AvailablePort(address *net.TCPAddr) (int, error)
- func CheckFileValid(fileName string) bool
- func CheckNetIface(ethName string) bool
- func CreateDirIfNotExist(filePath string) error
- func Decrypt(crypted []byte, mac string) (origData []byte, err error)
- func DecryptAuthPassword(encryptPassword string, saltKey string) (string, error)
- func Encrypt(src []byte, mac string) (crypted []byte, err error)
- func EncryptAuthPassword(rawPassword string, saltKey string) (string, error)
- func FilePathIsExist(path string) bool
- func FormatDockerTime(value string) (*time.Time, error)
- func FromContext(ctx context.Context, key string) string
- func GcmDecrypt(ciphertext []byte, key []byte) (plaintext []byte, err error)
- func GcmEncrypt(plaintext []byte, key []byte) (ciphertext []byte, err error)
- func GenUUID() string
- func GenerateDeviceSecret(n int) string
- func GenerateSaltKey() string
- func Get0ClockTimeStamp(d time.Time) int64
- func GetAvailablePort(port string) (int, error)
- func GetLocalIP() (ip string, err error)
- func GetNowTimestamp() int64
- func GetOutBoundIP() (ip string, err error)
- func GetPwdDir() string
- func InStringSlice(key string, keys []string) bool
- func InterfaceToString(value interface{}) string
- func MakeTimestamp() int64
- func NetIfaces() ([]string, error)
- func NetMacs() ([]string, error)
- func RandomNum() string
- func ReadJsonFile(filepath string) ([]byte, error)
- func RemoveFileOrDir(path string) error
- func SliceStringUnique(strings []string) []string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateDirIfNotExist ¶
func DecryptAuthPassword ¶
DecryptAuthPassword 账号密码解密
func EncryptAuthPassword ¶
EncryptAuthPassword 账号密码加密
func FilePathIsExist ¶
func FromContext ¶
FromContext allows for the retrieval of the specified key's value from the supplied Context. If the value is not found, an empty string is returned.
func GcmDecrypt ¶
使用aes gcm解密信息
func GcmEncrypt ¶
使用aes gcm加密信息
func GenerateDeviceSecret ¶
func GenerateSaltKey ¶
func GenerateSaltKey() string
func GetAvailablePort ¶
获取系统可用的的端口号, 如果传入的端口号可用,那就直接返回
func GetLocalIP ¶
func GetOutBoundIP ¶
func InStringSlice ¶
func InterfaceToString ¶
func InterfaceToString(value interface{}) string
func MakeTimestamp ¶
func MakeTimestamp() int64
func ReadJsonFile ¶
func RemoveFileOrDir ¶
func SliceStringUnique ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.