commons

package module
v0.0.0-...-2199a7d Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2019 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Version string

Functions

func AesCBCDecrypt

func AesCBCDecrypt(_encryptData, _key []byte) ([]byte, error)

func AesCBCEncrypt

func AesCBCEncrypt(_rawData, _key []byte) ([]byte, error)

aes加密,填充秘钥key的16位,24,32分别对应AES-128, AES-192, or AES-256.

func BytesSha1ToBytes

func BytesSha1ToBytes(_srcBytes []byte) ([]byte, error)

func BytesSha1ToHexString

func BytesSha1ToHexString(_srcBytes []byte) (string, error)

func BytesSha256ToBytes

func BytesSha256ToBytes(_srcBytes []byte) ([]byte, error)

func BytesSha256ToHexString

func BytesSha256ToHexString(_srcBytes []byte) (string, error)

func CheckAndMakeDirs

func CheckAndMakeDirs(_dirPath string)

func CheckExists

func CheckExists(_path string) bool

func CreateCommonRender

func CreateCommonRender(_templatesDir string) multitemplate.Renderer

func FillByte

func FillByte(_fixByteCount int, _fileBuffer *bytes.Buffer)

func GenUUIDBytes

func GenUUIDBytes() *bytes.Buffer

func GenUUIDString

func GenUUIDString(_splitChar string) string

func GetFileExtName

func GetFileExtName(_fileName string) string

func HexDecodeBytesToBytes

func HexDecodeBytesToBytes(_src []byte) []byte

func HexEncodeBytesToBytes

func HexEncodeBytesToBytes(_src []byte) []byte

func InitRedisClient

func InitRedisClient(_address, _password string, _dbNum int) *redis.Client

func LoadJsonConfigFile

func LoadJsonConfigFile(_confPath string, _pConfig interface{})

func LoadYamlConfigFile

func LoadYamlConfigFile(_confPath string, _pConfig interface{})

func PKCS7Padding

func PKCS7Padding(_cipherText []byte, _blockSize int) []byte

使用PKCS7进行填充,IOS也是7

func PKCS7UnPadding

func PKCS7UnPadding(_originData []byte) []byte

func ParseJsonString

func ParseJsonString(_data interface{}) string

func SaveJsonConfigFile

func SaveJsonConfigFile(_confPath string, _config ConfigFormat)

func SaveYamlConfigFile

func SaveYamlConfigFile(_confPath string, _config ConfigFormat)

func StringSha1ToHexString

func StringSha1ToHexString(_srcString string) (string, error)

func StringSha256ToHexString

func StringSha256ToHexString(_srcString string) (string, error)

func TestRedisClient

func TestRedisClient(_redisClient *redis.Client) bool

func ZeroPadding

func ZeroPadding(_cipherText []byte, _blockSize int) []byte

func ZeroUnPadding

func ZeroUnPadding(_originData []byte) []byte

Types

type AppMode

type AppMode string
const (
	DebugMode   AppMode = "debug"
	TestMode    AppMode = "test"
	ReleaseMode AppMode = "release"
)

func (AppMode) String

func (am AppMode) String() string

type ConfigFormat

type ConfigFormat interface {
	AppMode() string
}

Jump to

Keyboard shortcuts

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