common

package
v0.3.3 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package godler provides ...

Index

Constants

View Source
const (
	PermFile fs.FileMode = 0666
	PermDir              = 0755
)

Variables

This section is empty.

Functions

func AesDecrypt

func AesDecrypt(crypted, key []byte) ([]byte, error)

AES解密

func AesEncrypt

func AesEncrypt(origData, key []byte) ([]byte, error)

AES加密,CBC

func DirExists

func DirExists(dirpath string) bool

判断地址是否为目录

func DirSize

func DirSize(path string) (int64, error)

获取目录大小

func FileExists

func FileExists(filepath string) bool

判断地址是否存在

func GetFileInfoTimes

func GetFileInfoTimes(f os.FileInfo) (ctime, mtime time.Time)

获取文件的时间

func GetFileSize

func GetFileSize(path string) (int64, error)

func GetFileTimes

func GetFileTimes(path string) (ctime, mtime time.Time, err error)

获取文件的时间

func Md5

func Md5(str string) string

func Md5File

func Md5File(path string) (string, error)

func PKCS7Padding

func PKCS7Padding(ciphertext []byte, blockSize int) []byte

func PKCS7UnPadding

func PKCS7UnPadding(origData []byte) []byte

func ReadFileToInterface

func ReadFileToInterface(path string, i interface{}) error

func ReadFileToMap

func ReadFileToMap(path string) (map[string]interface{}, error)

func ToMap

func ToMap(i interface{}) (map[string]interface{}, error)

func ToMapString

func ToMapString(i interface{}) (string, error)

func WriteInterfaceToFile

func WriteInterfaceToFile(path string, data interface{}) error

func WriteMapToFile

func WriteMapToFile(path string, data map[string]interface{}) error

Types

This section is empty.

Jump to

Keyboard shortcuts

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