Documentation ¶
Index ¶
- Variables
- func AddFileToMemory(memFile MemFile)
- func AppendInt(buf []byte, u uint64) []byte
- func AppendUniqueString(to []string, from string) []string
- func AppendUniqueStrings(to []string, from []string) []string
- func BBlack(s interface{}, attribs ...AttribCode) string
- func BBlue(s interface{}, attribs ...AttribCode) string
- func BCyan(s interface{}, attribs ...AttribCode) string
- func BGreen(s interface{}, attribs ...AttribCode) string
- func BMagenta(s interface{}, attribs ...AttribCode) string
- func BRed(s interface{}, attribs ...AttribCode) string
- func BWhite(s interface{}, attribs ...AttribCode) string
- func BYellow(s interface{}, attribs ...AttribCode) string
- func Base64(data []byte) string
- func Base64String(data string) string
- func Black(s interface{}, attribs ...AttribCode) string
- func Blue(s interface{}, attribs ...AttribCode) string
- func Bool(value interface{}) bool
- func Bytes(value interface{}) []byte
- func CheckPath(filename string)
- func Color(s interface{}, textColor TextColor, bgColor BgColor, attribs ...AttribCode) string
- func Convert(from, to interface{})
- func CopyFile(from, to string) error
- func CopyToFile(from io.Reader, to string) error
- func Cyan(s interface{}, attribs ...AttribCode) string
- func DecodeInt(buf []byte) uint64
- func DecryptAes(crypted string, key []byte, iv []byte) (out string)
- func DecryptAesBytes(cryptedBytes []byte, key []byte, iv []byte) (out []byte, outErr error)
- func Dim(s interface{}) string
- func Duration(value string) time.Duration
- func EncodeInt(u uint64) []byte
- func EncryptAes(origData string, key []byte, iv []byte) (out string)
- func EncryptAesBytes(origData []byte, key []byte, iv []byte) (out []byte, outErr error)
- func FileExists(filename string) bool
- func FillInt(buf []byte, length int) []byte
- func FinalSet(from, to reflect.Value)
- func FinalType(v reflect.Value) reflect.Type
- func FinalValue(v reflect.Value) reflect.Value
- func FixJsonBytes(b []byte) []byte
- func FixNilValue(v reflect.Value)
- func FixPath(path string) string
- func FixPtr(value interface{}) interface{}
- func FixUpperCase(data []byte, excludesKeys []string)
- func FixedJson(value interface{}) string
- func FixedJsonP(value interface{}) string
- func Float(value interface{}) float32
- func Float64(value interface{}) float64
- func Floats(value interface{}) []float64
- func GenECDSA256Key() (privateKey string, publicKey string, err error)
- func GenECDSA384Key() (privateKey string, publicKey string, err error)
- func GenECDSA521Key() (privateKey string, publicKey string, err error)
- func GenECDSAKey(curve elliptic.Curve) (privateKey string, publicKey string, err error)
- func GetAbsFilename(filename string) string
- func GetLowerName(s string) string
- func GetUpperName(s string) string
- func Green(s interface{}, attribs ...AttribCode) string
- func Gunzip(data []byte) ([]byte, error)
- func GunzipN(data []byte) []byte
- func Gzip(data []byte) ([]byte, error)
- func GzipN(data []byte) []byte
- func Id10() string
- func Id12() string
- func Id6() string
- func Id8() string
- func If(i bool, a, b interface{}) interface{}
- func In(arr []interface{}, s interface{}) bool
- func Int(value interface{}) int
- func Int64(value interface{}) int64
- func Ints(value interface{}) []int64
- func Italic(s interface{}) string
- func JoinArgs(arr []string, sep string) string
- func Json(value interface{}) string
- func JsonBytes(value interface{}) []byte
- func JsonBytesP(value interface{}) []byte
- func JsonP(value interface{}) string
- func Load(filename string, to interface{}) error
- func LoadFileToMemory(filename string)
- func LoadFileToMemoryWithCompress(filename string)
- func LoadFilesToMemoryFromB64(b64File *MemFileB64)
- func LoadFilesToMemoryFromB64KeepGzip(b64File *MemFileB64)
- func LoadFilesToMemoryFromJson(jsonFiles string)
- func LoadJson(filename string, to interface{}) error
- func LoadX(filename string, to interface{}) error
- func LoadYaml(filename string, to interface{}) error
- func MD5(data []byte) []byte
- func MD5Base64(data string) string
- func MD5String(data string) string
- func Magenta(s interface{}, attribs ...AttribCode) string
- func MakeECDSA256PrivateKey(privateKeyStr string) (priKey *ecdsa.PrivateKey, err error)
- func MakeECDSA256PublicKey(publicKeyStr string) (pubKey *ecdsa.PublicKey, err error)
- func MakeECDSA384PrivateKey(privateKeyStr string) (priKey *ecdsa.PrivateKey, err error)
- func MakeECDSA384PublicKey(publicKeyStr string) (pubKey *ecdsa.PublicKey, err error)
- func MakeECDSA521PrivateKey(privateKeyStr string) (priKey *ecdsa.PrivateKey, err error)
- func MakeECDSA521PublicKey(publicKeyStr string) (pubKey *ecdsa.PublicKey, err error)
- func MakeECDSAPrivateKey(privateKeyStr string, curve elliptic.Curve) (priKey *ecdsa.PrivateKey, err error)
- func MakeECDSAPublicKey(publicKeyStr string, curve elliptic.Curve) (pubKey *ecdsa.PublicKey, err error)
- func MakeExcludeUpperKeys(data interface{}, prefix string) []string
- func MakeToken(size int) []byte
- func NewIntEncoder(digits string, radix uint8) (*intEncoder, error)
- func ParseInt(s string) int64
- func ParseUint(s string) uint64
- func ReadFile(filename string) (string, error)
- func ReadFileBytes(filename string) ([]byte, error)
- func ReadFileBytesN(filename string) []byte
- func ReadFileLines(filename string) ([]string, error)
- func ReadFileLinesN(filename string) []string
- func ReadFileN(filename string) string
- func RealValue(v reflect.Value) reflect.Value
- func Red(s interface{}, attribs ...AttribCode) string
- func RunCommand(command string, args ...string) ([]string, error)
- func Save(filename string, data interface{}) error
- func SaveJson(filename string, data interface{}) error
- func SaveJsonP(filename string, data interface{}) error
- func SaveYaml(filename string, data interface{}) error
- func SetValue(to, from reflect.Value)
- func Sha1(data []byte) []byte
- func Sha1Base64(data string) string
- func Sha1String(data string) string
- func Sha256(data []byte) []byte
- func Sha256Base64(data string) string
- func Sha256String(data string) string
- func Sha512(data []byte) []byte
- func Sha512Base64(data string) string
- func Sha512String(data string) string
- func ShortUniqueId() string
- func SignECDSA(content []byte, priKey *ecdsa.PrivateKey) (signature string, err error)
- func SplitArgs(s string) []string
- func SplitTrim(s, sep string) []string
- func SplitWithoutNone(s, sep string) []string
- func String(value interface{}) string
- func StringFromValue(v reflect.Value) string
- func StringIf(i bool, a, b string) string
- func StringIn(arr []string, s string) bool
- func StringP(value interface{}) string
- func Strings(value interface{}) []string
- func Switch(i uint, args ...interface{}) interface{}
- func ToInterfaceArray(in interface{}) []interface{}
- func Uint(value interface{}) uint
- func Uint64(value interface{}) uint64
- func UnBase64(data string) []byte
- func UnBase64String(data string) string
- func UnJson(str string, value interface{}) interface{}
- func UnJsonArr(str string) []interface{}
- func UnJsonBytes(data []byte, value interface{}) interface{}
- func UnJsonMap(str string) map[string]interface{}
- func UnUrlBase64(data string) []byte
- func UnUrlBase64String(data string) string
- func UnYaml(data string, value interface{}) interface{}
- func UnYamlArr(data string) []interface{}
- func UnYamlMap(data string) map[string]interface{}
- func UniqueId() string
- func UrlBase64(data []byte) string
- func UrlBase64String(data string) string
- func ValueToString(v reflect.Value) string
- func VerifyECDSA(content []byte, signature string, pubKey *ecdsa.PublicKey) bool
- func White(s interface{}, attribs ...AttribCode) string
- func WriteFile(filename string, content string) error
- func WriteFileBytes(filename string, content []byte) error
- func Yaml(value interface{}) string
- func Yellow(s interface{}, attribs ...AttribCode) string
- type Aes
- func (_this *Aes) DecryptBase64ToBytes(data string) []byte
- func (_this *Aes) DecryptBase64ToString(data string) string
- func (_this *Aes) DecryptBytes(data []byte) (out []byte, outErr error)
- func (_this *Aes) DecryptHexToBytes(data string) []byte
- func (_this *Aes) DecryptHexToString(data string) string
- func (_this *Aes) DecryptUrlBase64ToBytes(data string) []byte
- func (_this *Aes) DecryptUrlBase64ToString(data string) string
- func (_this *Aes) EncryptBytes(data []byte) (out []byte, outErr error)
- func (_this *Aes) EncryptBytesToBase64(data []byte) string
- func (_this *Aes) EncryptBytesToHex(data []byte) string
- func (_this *Aes) EncryptBytesToUrlBase64(data []byte) string
- func (_this *Aes) EncryptStringToBase64(data string) string
- func (_this *Aes) EncryptStringToHex(data string) string
- func (_this *Aes) EncryptStringToUrlBase64(data string) string
- type AttribCode
- type BgColor
- type FileInfo
- type MemFile
- type MemFileB64
- type Rand
- func (r *Rand) Float32() float32
- func (r *Rand) Float64() float64
- func (r *Rand) Int() int
- func (r *Rand) Int31() int32
- func (r *Rand) Int31n(n int32) int32
- func (r *Rand) Int63() int64
- func (r *Rand) Int63n(n int64) int64
- func (r *Rand) Intn(n int) int
- func (r *Rand) Perm(n int) []int
- func (r *Rand) Read(p []byte) (n int, err error)
- func (r *Rand) Seed(seed int64)
- func (r *Rand) Shuffle(n int, swap func(i, j int))
- func (r *Rand) Uint32() uint32
- func (r *Rand) Uint64() uint64
- type StructInfo
- type TextColor
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func AddFileToMemory ¶ added in v1.7.4
func AddFileToMemory(memFile MemFile)
func AppendUniqueString ¶ added in v0.1.17
func AppendUniqueStrings ¶ added in v0.1.17
func BBlack ¶
func BBlack(s interface{}, attribs ...AttribCode) string
func BBlue ¶
func BBlue(s interface{}, attribs ...AttribCode) string
func BCyan ¶
func BCyan(s interface{}, attribs ...AttribCode) string
func BGreen ¶
func BGreen(s interface{}, attribs ...AttribCode) string
func BMagenta ¶
func BMagenta(s interface{}, attribs ...AttribCode) string
func BRed ¶
func BRed(s interface{}, attribs ...AttribCode) string
func BWhite ¶
func BWhite(s interface{}, attribs ...AttribCode) string
func BYellow ¶
func BYellow(s interface{}, attribs ...AttribCode) string
func Base64String ¶ added in v0.5.40
func Black ¶
func Black(s interface{}, attribs ...AttribCode) string
func Blue ¶
func Blue(s interface{}, attribs ...AttribCode) string
func Color ¶
func Color(s interface{}, textColor TextColor, bgColor BgColor, attribs ...AttribCode) string
func Cyan ¶
func Cyan(s interface{}, attribs ...AttribCode) string
func DecryptAesBytes ¶ added in v0.1.17
func EncryptAesBytes ¶ added in v0.1.17
func FileExists ¶ added in v0.0.8
func FixJsonBytes ¶ added in v0.5.40
修复Golang中Json默认处理HTML转义 < > & 的问题
func FixNilValue ¶ added in v0.1.9
func FixUpperCase ¶
func FixedJsonP ¶ added in v0.5.40
func FixedJsonP(value interface{}) string
func GenECDSA256Key ¶ added in v0.5.48
func GenECDSA384Key ¶ added in v0.5.48
func GenECDSA521Key ¶ added in v0.5.48
func GenECDSAKey ¶ added in v0.5.48
func GetAbsFilename ¶ added in v1.7.5
func GetLowerName ¶ added in v0.1.9
func GetUpperName ¶ added in v0.1.9
func Green ¶
func Green(s interface{}, attribs ...AttribCode) string
func JsonBytesP ¶ added in v0.5.40
func JsonBytesP(value interface{}) []byte
func LoadFileToMemory ¶ added in v1.7.4
func LoadFileToMemory(filename string)
func LoadFileToMemoryWithCompress ¶ added in v1.7.4
func LoadFileToMemoryWithCompress(filename string)
func LoadFilesToMemoryFromB64 ¶ added in v1.7.4
func LoadFilesToMemoryFromB64(b64File *MemFileB64)
func LoadFilesToMemoryFromB64KeepGzip ¶ added in v1.7.4
func LoadFilesToMemoryFromB64KeepGzip(b64File *MemFileB64)
func LoadFilesToMemoryFromJson ¶ added in v1.7.4
func LoadFilesToMemoryFromJson(jsonFiles string)
func Magenta ¶
func Magenta(s interface{}, attribs ...AttribCode) string
func MakeECDSA256PrivateKey ¶ added in v0.5.48
func MakeECDSA256PrivateKey(privateKeyStr string) (priKey *ecdsa.PrivateKey, err error)
func MakeECDSA256PublicKey ¶ added in v0.5.48
func MakeECDSA384PrivateKey ¶ added in v0.5.48
func MakeECDSA384PrivateKey(privateKeyStr string) (priKey *ecdsa.PrivateKey, err error)
func MakeECDSA384PublicKey ¶ added in v0.5.48
func MakeECDSA521PrivateKey ¶ added in v0.5.48
func MakeECDSA521PrivateKey(privateKeyStr string) (priKey *ecdsa.PrivateKey, err error)
func MakeECDSA521PublicKey ¶ added in v0.5.48
func MakeECDSAPrivateKey ¶ added in v0.5.48
func MakeECDSAPublicKey ¶ added in v0.5.48
func MakeExcludeUpperKeys ¶ added in v0.5.50
func NewIntEncoder ¶
func ReadFileBytes ¶ added in v0.5.30
func ReadFileBytesN ¶ added in v1.7.4
func ReadFileLines ¶ added in v0.1.15
func ReadFileLinesN ¶ added in v1.7.4
func Red ¶
func Red(s interface{}, attribs ...AttribCode) string
func Sha1Base64 ¶ added in v0.1.17
func Sha1String ¶ added in v0.1.17
func Sha256Base64 ¶ added in v0.1.17
func Sha256String ¶ added in v0.1.17
func Sha512Base64 ¶ added in v0.1.17
func Sha512String ¶ added in v0.1.17
func ShortUniqueId ¶ added in v0.0.10
func ShortUniqueId() string
func SignECDSA ¶ added in v0.5.48
func SignECDSA(content []byte, priKey *ecdsa.PrivateKey) (signature string, err error)
func SplitWithoutNone ¶ added in v0.1.17
func StringFromValue ¶ added in v1.7.7
func ToInterfaceArray ¶ added in v0.1.17
func ToInterfaceArray(in interface{}) []interface{}
func UnBase64String ¶ added in v0.5.40
func UnJsonBytes ¶ added in v0.5.40
func UnJsonBytes(data []byte, value interface{}) interface{}
func UnUrlBase64 ¶ added in v0.5.40
func UnUrlBase64String ¶ added in v0.5.40
func UrlBase64String ¶ added in v0.5.40
func ValueToString ¶ added in v0.1.10
func VerifyECDSA ¶ added in v0.5.48
func White ¶
func White(s interface{}, attribs ...AttribCode) string
func WriteFileBytes ¶ added in v0.5.30
func Yellow ¶
func Yellow(s interface{}, attribs ...AttribCode) string
Types ¶
type Aes ¶ added in v0.5.40
type Aes struct {
// contains filtered or unexported fields
}
func (*Aes) DecryptBase64ToBytes ¶ added in v0.5.40
func (*Aes) DecryptBase64ToString ¶ added in v0.5.40
func (*Aes) DecryptBytes ¶ added in v0.5.40
func (*Aes) DecryptHexToBytes ¶ added in v0.5.40
func (*Aes) DecryptHexToString ¶ added in v0.5.40
func (*Aes) DecryptUrlBase64ToBytes ¶ added in v0.5.40
func (*Aes) DecryptUrlBase64ToString ¶ added in v0.5.40
func (*Aes) EncryptBytes ¶ added in v0.5.40
func (*Aes) EncryptBytesToBase64 ¶ added in v0.5.40
func (*Aes) EncryptBytesToHex ¶ added in v0.5.40
func (*Aes) EncryptBytesToUrlBase64 ¶ added in v0.5.40
func (*Aes) EncryptStringToBase64 ¶ added in v0.5.40
func (*Aes) EncryptStringToHex ¶ added in v0.5.40
func (*Aes) EncryptStringToUrlBase64 ¶ added in v0.5.40
type AttribCode ¶
type AttribCode int
const ( AttrNone AttribCode = iota AttrBold AttrDim AttrItalic AttrUnderline AttrBlink AttrFastBlink AttrReverse AttrHidden AttrCrossedOut )
type FileInfo ¶ added in v1.7.4
func GetFileInfo ¶ added in v1.7.5
type MemFile ¶ added in v1.7.4
type MemFile struct { Name string ModTime time.Time IsDir bool Compressed bool Size int64 Data []byte // contains filtered or unexported fields }
func ReadDirFromMemory ¶ added in v1.7.4
func ReadFileFromMemory ¶ added in v1.7.4
type MemFileB64 ¶ added in v1.7.4
type MemFileB64 struct { Name string ModTime time.Time IsDir bool DataB64 string Compressed bool Size int64 Children []MemFileB64 }
func LoadFileToB64 ¶ added in v1.7.4
func LoadFileToB64(filename string) *MemFileB64
type StructInfo ¶ added in v0.5.43
type StructInfo struct { Fields []reflect.StructField Values map[string]reflect.Value Methods []reflect.Method MethodValues map[string]reflect.Value }
func FlatStruct ¶ added in v0.5.43
func FlatStruct(data interface{}) *StructInfo
func FlatStructWithUnexported ¶ added in v0.5.43
func FlatStructWithUnexported(data interface{}) *StructInfo
Source Files ¶
Click to show internal directories.
Click to hide internal directories.