utils

package
v2.1.11 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2025 License: Apache-2.0 Imports: 32 Imported by: 125

Documentation

Overview

This file is auto-generated, don't edit it. Thanks.

Index

Constants

View Source
const (
	PEM_BEGIN = "-----BEGIN RSA PRIVATE KEY-----\n"
	PEM_END   = "\n-----END RSA PRIVATE KEY-----"
)

Variables

This section is empty.

Functions

func ArrayToStringWithSpecifiedStyle

func ArrayToStringWithSpecifiedStyle(array interface{}, prefix *string, style *string) (_result *string)

Description:

Parse array into a string with specified style

@param array - the array

@param prefix - the prefix string

@return the string

func Convert

func Convert(body interface{}, content interface{})

Description:

Convert all params of body other than type of readable into content

@param body - source Model

@param content - target Model

@return void

func GetAuthorization

func GetAuthorization(request *dara.Request, signatureAlgorithm *string, payload *string, accessKey *string, accessKeySecret *string) (_result *string)

Description:

Get the authorization

@param request - request params

@param signatureAlgorithm - the autograph method

@param payload - the hashed request

@param accessKey - the accessKey string

@param accessKeySecret - the accessKeySecret string

@return authorization string

func GetDateUTCString

func GetDateUTCString() (_result *string)

Description:

Get UTC string

@return the UTC string

func GetEndpoint added in v2.1.1

func GetEndpoint(endpoint *string, server *bool, endpointType *string) *string

func GetEndpointRules

func GetEndpointRules(product, regionId, endpointType, network, suffix *string) (_result *string, _err error)

func GetNonce

func GetNonce() (_result *string)

Description:

Generate a nonce string

@return the nonce string

func GetROASignature

func GetROASignature(stringToSign *string, secret *string) (_result *string)

Description:

Get signature according to stringToSign, secret

@param stringToSign - the signed string

@param secret - accesskey secret

@return the signature

func GetRPCSignature

func GetRPCSignature(signedParams map[string]*string, method *string, secret *string) (_result *string)

Description:

Get signature according to signedParams, method and secret

@param signedParams - params which need to be signed

@param method - http method e.g. GET

@param secret - AccessKeySecret

@return the signature

func GetStringToSign

func GetStringToSign(request *dara.Request) (_result *string)

Description:

Get the string to be signed according to request

@param request - which contains signed messages

@return the signed string

func GetThrottlingTimeLeft

func GetThrottlingTimeLeft(headers map[string]*string) (_result *int64)

Description:

Get throttling param

@param the - response headers

@return time left

func GetTimestamp

func GetTimestamp() (_result *string)

Description:

Get timestamp

@return the timestamp string

func GetUserAgent

func GetUserAgent(userAgent *string) (_result *string)

func Hash

func Hash(raw []byte, signatureAlgorithm *string) (_result []byte)

Description:

Hash the raw data with signatureAlgorithm

@param raw - hashing data

@param signatureAlgorithm - the autograph method

@return hashed bytes

func ParseToMap

func ParseToMap(in interface{}) map[string]interface{}

func Query

func Query(filter interface{}) (_result map[string]*string)

Description:

Parse filter into a object which's type is map[string]string

@param filter - query param

@return the object

func SignatureMethod

func SignatureMethod(secret, source, signatureAlgorithm string) []byte

func StringifyMapValue added in v2.1.4

func StringifyMapValue(a map[string]interface{}) map[string]*string

func ToArray added in v2.1.3

func ToArray(in interface{}) []map[string]interface{}

func ToForm

func ToForm(filter map[string]interface{}) (_result *string)

Description:

Parse filter into a form string

@param filter - object

@return the string

Types

type Config

type Config = models.Config

type GlobalParameters

type GlobalParameters = models.GlobalParameters

type OpenApiRequest

type OpenApiRequest = models.OpenApiRequest

type Params

type Params = models.Params

type Sorter

type Sorter struct {
	Keys []string
	Vals []string
}

func (*Sorter) Len

func (hs *Sorter) Len() int

Len is an additional function for function SignHeader.

func (*Sorter) Less

func (hs *Sorter) Less(i, j int) bool

Less is an additional function for function SignHeader.

func (*Sorter) Sort

func (hs *Sorter) Sort()

Sort is an additional function for function SignHeader.

func (*Sorter) Swap

func (hs *Sorter) Swap(i, j int)

Swap is an additional function for function SignHeader.

Jump to

Keyboard shortcuts

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