Documentation ¶
Index ¶
- func ConvertToQueryValues(ifc interface{}) url.Values
- func CreateRandomString() string
- func CreateSignature(stringToSignature, accessKeySecret string) string
- func CreateSignatureForRequest(method string, values *url.Values, accessKeySecret string) string
- func Encode(v url.Values) string
- func GenerateRandomECSPassword() string
- func GetGMTime() string
- func GetISO8601TimeStamp(ts time.Time) string
- func SetQueryValues(ifc interface{}, values *url.Values)
- type Attempt
- type AttemptStrategy
- type ISO6801Time
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConvertToQueryValues ¶
ConvertToQueryValues converts the struct to url.Values
func CreateSignature ¶
CreateSignature creates signature for string following Aliyun rules
func CreateSignatureForRequest ¶
CreateSignatureForRequest creates signature for query string values
func Encode ¶
Encode encodes the values into “URL encoded” form ("acl&bar=baz&foo=quux") sorted by key.
func GenerateRandomECSPassword ¶
func GenerateRandomECSPassword() string
tools for generating a random ECS instance password from 8 to 30 char MUST contain digit upper, case letter and upper case letter http://docs.aliyun.com/#/pub/ecs/open-api/instance&createinstance
func GetISO8601TimeStamp ¶
GetISO8601TimeStamp gets timestamp string in ISO8601 format
func SetQueryValues ¶
SetQueryValues sets the struct to existing url.Values following ECS encoding rules
Types ¶
type Attempt ¶
type Attempt struct {
// contains filtered or unexported fields
}
type AttemptStrategy ¶
type AttemptStrategy struct { Total time.Duration // total duration of attempt. Delay time.Duration // interval between each try in the burst. Min int // minimum number of retries; overrides Total }
AttemptStrategy represents a strategy for waiting for an action to complete successfully. This is an internal type used by the implementation of other packages.
func (AttemptStrategy) Start ¶
func (s AttemptStrategy) Start() *Attempt
Start begins a new sequence of attempts for the given strategy.
type ISO6801Time ¶
A ISO6801Time represents a time in ISO8601 format
func NewISO6801Time ¶
func NewISO6801Time(t time.Time) ISO6801Time
New constructs a new iso8601.Time instance from an existing time.Time instance. This causes the nanosecond field to be set to 0, and its time zone set to a fixed zone with no offset from UTC (but it is *not* UTC itself).
func (*ISO6801Time) IsDefault ¶
func (it *ISO6801Time) IsDefault() bool
IsDefault checks if the time is default
func (ISO6801Time) MarshalJSON ¶
func (it ISO6801Time) MarshalJSON() ([]byte, error)
MarshalJSON serializes the ISO6801Time into JSON string
func (ISO6801Time) String ¶
func (it ISO6801Time) String() string
String returns the time in ISO6801Time format
func (*ISO6801Time) UnmarshalJSON ¶
func (it *ISO6801Time) UnmarshalJSON(data []byte) error
UnmarshalJSON deserializes the ISO6801Time from JSON string