...

Package utils

import "github.com/aliyun/credentials-go/credentials/utils"
Overview
Index

Overview ▾

func GetMD5Base64

func GetMD5Base64(bytes []byte) (base64Value string)

GetMD5Base64 returns a string which has been base64

func GetTimeInFormatISO8601

func GetTimeInFormatISO8601() (timeStr string)

GetTimeInFormatISO8601 returns a time string

func GetURLFormedMap

func GetURLFormedMap(source map[string]string) (urlEncoded string)

GetURLFormedMap returns a url encoded string

func GetUUID

func GetUUID() (uuidHex string)

GetUUID returns a uuid

func RandStringBytes

func RandStringBytes(n int) string

RandStringBytes returns a rand string

func Sha256WithRsa

func Sha256WithRsa(source, secret string) string

Sha256WithRsa return a string which has been hashed with Rsa

func ShaHmac1

func ShaHmac1(source, secret string) string

ShaHmac1 return a string which has been hashed

func Timeout

func Timeout(connectTimeout time.Duration) func(cxt context.Context, net, addr string) (c net.Conn, err error)

Timeout is for connect Timeout

type Runtime

Runtime is for setting timeout, proxy and host

type Runtime struct {
    ReadTimeout    int
    ConnectTimeout int
    Proxy          string
    Host           string
    STSEndpoint    string
}

func NewRuntime

func NewRuntime(readTimeout, connectTimeout int, proxy string, host string) *Runtime

NewRuntime returns a Runtime