utils

package
v0.0.0-...-e2819db Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2020 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Contains

func Contains(source interface{}, target interface{}) (bool, error)

Contains 判断 source 是否包含在target中,target支持类型:Array/Slice/Map

func GetBinDir

func GetBinDir() string

GetBinDir 获取当前程序所在目录

func GetBinPath

func GetBinPath() (string, error)

GetBinPath 获取当前程序完整路径

func GetENV

func GetENV(key string) string

GetENV *

func GetENVToBool

func GetENVToBool(key string) bool

GetENVToBool *

func GetENVToInt

func GetENVToInt(key string) (int, error)

GetENVToInt *

func GetENVToInt64

func GetENVToInt64(key string) (int64, error)

GetENVToInt64 *

func GetIPs

func GetIPs(filterPhysical ...bool) (ipv4 []string, err error)

GetIPs 获取当前机器IP地址,filterPhysical为true时,只获取物理络设备IP地址

func GobMarshal

func GobMarshal(v interface{}) ([]byte, error)

GobMarshal *

func GobUnmarshal

func GobUnmarshal(data []byte, v interface{}) error

GobUnmarshal *

func IsDir

func IsDir(path string) bool

判断所给路径是否为文件夹

func IsEmpty

func IsEmpty(value ...string) bool

IsEmpty *

func IsFileExist

func IsFileExist(path string) (bool, os.FileInfo, error)

IsFileExist 文件是否存在

func IsPhysicalInterfaceDevice

func IsPhysicalInterfaceDevice(name string) (bool, error)

IsPhysicalInterfaceDevice 查看网卡是否是物理设备

func JsonMarshal

func JsonMarshal(v interface{}) ([]byte, error)

func JsonMarshalIndent

func JsonMarshalIndent(v interface{}, prefix, indent string) ([]byte, error)

func JsonMarshalToString

func JsonMarshalToString(v interface{}) (string, error)

func JsonUnmarshal

func JsonUnmarshal(data []byte, v interface{}) error

func RegGob

func RegGob(o ...interface{})

RegGob *

func ToStr

func ToStr(value interface{}) (s string)

ToStr *

Types

type StringUtils

type StringUtils string

StringUtils *

func (StringUtils) Base64Decode

func (s StringUtils) Base64Decode() (string, error)

Base64Decode *

func (StringUtils) Bool

func (s StringUtils) Bool() (bool, error)

Bool *

func (*StringUtils) Clear

func (s *StringUtils) Clear()

Clear *

func (StringUtils) Contains

func (s StringUtils) Contains(sep string) bool

Contains *

func (StringUtils) Exist

func (s StringUtils) Exist() bool

Exist *

func (StringUtils) Float32

func (s StringUtils) Float32() (float32, error)

Float32 *

func (StringUtils) Float64

func (s StringUtils) Float64() (float64, error)

Float64 *

func (StringUtils) HmacSha1

func (s StringUtils) HmacSha1(key string) string

HmacSha1 *

func (StringUtils) HmacSha256

func (s StringUtils) HmacSha256(key string) string

HmacSha256 *

func (StringUtils) HmacSha512

func (s StringUtils) HmacSha512(key string) string

HmacSha512 *

func (StringUtils) Int

func (s StringUtils) Int() (int, error)

Int *

func (StringUtils) Int16

func (s StringUtils) Int16() (int16, error)

Int16 *

func (StringUtils) Int32

func (s StringUtils) Int32() (int32, error)

Int32 *

func (StringUtils) Int64

func (s StringUtils) Int64() (int64, error)

Int64 *

func (StringUtils) Int8

func (s StringUtils) Int8() (int8, error)

Int8 *

func (StringUtils) Md5

func (s StringUtils) Md5() string

Md5 *

func (StringUtils) ReplaceSBCCommaOrSemiColonToDBC

func (s StringUtils) ReplaceSBCCommaOrSemiColonToDBC() string

ReplaceSBCCommaOrSemiColonToDBC 替换字符串中的全角逗号和分号为半角逗号

func (*StringUtils) Set

func (s *StringUtils) Set(v string)

Set *

func (StringUtils) Sha1

func (s StringUtils) Sha1() string

Sha1 *

func (StringUtils) Sha256

func (s StringUtils) Sha256() string

Sha256 *

func (StringUtils) Sha512

func (s StringUtils) Sha512() string

Sha512 *

func (StringUtils) StdBase64Encode

func (s StringUtils) StdBase64Encode() string

StdBase64Encode *

func (StringUtils) String

func (s StringUtils) String() string

String *

func (StringUtils) ToTitleLower

func (s StringUtils) ToTitleLower() string

ToTitleLower *

func (StringUtils) ToTitleUpper

func (s StringUtils) ToTitleUpper() string

ToTitleUpper *

func (StringUtils) URLBase64Encode

func (s StringUtils) URLBase64Encode() string

URLBase64Encode *

func (StringUtils) Uint

func (s StringUtils) Uint() (uint, error)

Uint *

func (StringUtils) Uint16

func (s StringUtils) Uint16() (uint16, error)

Uint16 *

func (StringUtils) Uint32

func (s StringUtils) Uint32() (uint32, error)

Uint32 *

func (StringUtils) Uint64

func (s StringUtils) Uint64() (uint64, error)

Uint64 *

func (StringUtils) Uint8

func (s StringUtils) Uint8() (uint8, error)

Uint8 *

Jump to

Keyboard shortcuts

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