util

package
v1.5.25 Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2024 License: MIT, Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const FormatISO8601 = "2006-01-02T15:04:05Z"

Variables

This section is empty.

Functions

func CreateRandomString

func CreateRandomString() string

func CreateSignature

func CreateSignature(stringToSignature, accessKeySecret string) string

CreateSignature creates signature for string following Aliyun rules

func CreateSignatureForRequest

func CreateSignatureForRequest(method string, values *url.Values, accessKeySecret string) string

CreateSignatureForRequest creates signature for query string values

func CreateSignatureForStreamUrlWithA

func CreateSignatureForStreamUrlWithA(uri, rand, uid, privateKey string, timeout time.Duration) (authKey string, timestamp int64)

CreateSignatureForStreamUrlWithA creates signature for Url string whit method A

func GetISO8601TimeStamp

func GetISO8601TimeStamp(ts time.Time) string

GetISO8601TimeStamp gets timestamp string in ISO8601 format

Types

type ISO6801Time

type ISO6801Time time.Time

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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