Documentation
¶
Index ¶
- Constants
- Variables
- func AESDecrypt(crypt, iv, key []byte) ([]byte, error)
- func AESEncrypt(origData, iv, key []byte) ([]byte, error)
- func Abs(x int) int
- func AppendToIncomingContext(ctx context.Context, k, v string) context.Context
- func AppendToOutgoingContext(ctx context.Context, k, v string) context.Context
- func AppendToOutgoingContextByHeader(ctx context.Context, header http.Header) context.Context
- func Assert(b bool, v ...interface{})
- func Assertf(b bool, format string, v ...interface{})
- func Base64Decode(input string) ([]byte, error)
- func Base64Encode(input []byte) string
- func CheckEnvKey(key string) bool
- func ChkErr(e error)
- func Close(c Closer)
- func ConvertBoolToInt(b bool) int
- func ConvertIntToBool(i int) bool
- func ConvertPeerID2SCId(peerID string) string
- func ConvertSCId2PeerID(scID string) string
- func Decrypt(cipherText string) (string, error)
- func Encrypt(plainText string) (string, error)
- func FirstOfMonth() time.Time
- func GetFuncName(i interface{}) string
- func GetGOPATHs() []string
- func GetInMetadata(ctx context.Context, key string) (string, error)
- func GetOutMetadata(ctx context.Context, key string) (string, error)
- func GoVersionCompare(a, b string) (bool, error)
- func HMACSHA1Encrypt(origData, key []byte) []byte
- func HeaderFromIncomingContext(ctx context.Context) http.Header
- func MD5(s string) string
- func MaxInt64(a, b int64) (c int64)
- func MustParseJSON(v interface{}) (s string)
- func PKCS5Padding(cipherText []byte, blockSize int) []byte
- func PKCS5UnPadding(origData []byte) []byte
- func ParseTimeDuration(t string) (time.Duration, error)
- func RandomData(byteNum int) ([]byte, error)
- func RandomString(strLen int) string
- func ReplaceLinuxLineBreak(input string) string
- func ReplaceWindowsLineBreak(input string) string
- func SetInMetadata(ctx context.Context, key, value string) context.Context
- func SpaceTrimmedSplit(s string, sep string) []string
- func TimeTrack(start time.Time, ctx string)
- func Utf8ToGbk(s []byte) ([]byte, error)
- func WaitTimeout(wg *sync.WaitGroup, timeout time.Duration) bool
- type Closer
- type ErrorArray
- type ErrorArrayBuilder
Constants ¶
const RemoteHost = "X-REMOTE-EDGEPROXY"
RemoteHost RemoteHost
const SCPrefix = "sc_"
SCPrefix SCPrefix
Variables ¶
var DevZero = io.Reader(devZero(0))
DevZero /dev/zero
Functions ¶
func AESDecrypt ¶
AESDecrypt secret byte to byte
func AESEncrypt ¶
AESEncrypt byte to secret byte return data length may be different with input, be careful
func AppendToIncomingContext ¶
AppendToIncomingContext append `k`, `v` to incoming context
func AppendToOutgoingContext ¶
AppendToOutgoingContext append `k`, `v` to incoming context
func AppendToOutgoingContextByHeader ¶
AppendToOutgoingContextByHeader AppendToOutgoingContextByHeader
func CheckEnvKey ¶
CheckEnvKey checks the user key of environment variable whether or not is conflict with system Ignore the user one if conflict
func Close ¶
func Close(c Closer)
Close is a convenience function to close a object that has a Close() method, ignoring any errors Used to satisfy errcheck lint
func ConvertPeerID2SCId ¶
ConvertPeerID2SCId Convert peerID to SC id The convert rule is to remove the prefix "sc_" (if exists) of the peerID to get the scID
func ConvertSCId2PeerID ¶
ConvertSCId2PeerID Convert SC id to peerID The convert rule is to add the prefix "sc_" (if exists) of the peerID to the scID
func FirstOfMonth ¶
FirstOfMonth get the start timestamp of current month
func GetInMetadata ¶
GetInMetadata returns metadata
func GetOutMetadata ¶
GetOutMetadata return metadata
func GoVersionCompare ¶
GoVersionCompare returns a bool comparing two strings lexicographically. The result will be false if a < b, and true if a >= b
func HMACSHA1Encrypt ¶
HMACSHA1Encrypt encrype data as hmac-sha1
func HeaderFromIncomingContext ¶
HeaderFromIncomingContext HeaderFromIncomingContext
func MustParseJSON ¶
func MustParseJSON(v interface{}) (s string)
func PKCS5Padding ¶
PKCS5Padding is padding byte
func ParseTimeDuration ¶
ParseTimeDuration parses strings like 1-00:00:00 or 01:23:55
func RandomData ¶
RandomData gen random data len by byte num
func ReplaceLinuxLineBreak ¶
ReplaceLinuxLineBreak replace the Windows line break character '\n'
func ReplaceWindowsLineBreak ¶
ReplaceWindowsLineBreak replace the Windows line break character '\r'
func SetInMetadata ¶
SetInMetadata SetInMetadata
func SpaceTrimmedSplit ¶
SpaceTrimmedSplit splits a string with a separator It trims white space from all elements in the result array
Types ¶
type ErrorArray ¶
type ErrorArray struct {
// contains filtered or unexported fields
}
ErrorArray is lots of error
type ErrorArrayBuilder ¶
type ErrorArrayBuilder ErrorArray
ErrorArrayBuilder build ErrorArray
func NewErrorArrayBuilder ¶
func NewErrorArrayBuilder() *ErrorArrayBuilder
NewErrorArrayBuilder create ErrorArrayBuilder
func (*ErrorArrayBuilder) Append ¶
func (p *ErrorArrayBuilder) Append(err error) *ErrorArrayBuilder
Append : append a error to ErrorArray
Source Files
¶
Directories
¶
Path | Synopsis |
---|---|
Package snowflake is a generated GoMock package.
|
Package snowflake is a generated GoMock package. |