requests

package
v0.0.0-...-432dbe7 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RPC = "RPC"
	ROA = "ROA"

	HTTP  = "HTTP"
	HTTPS = "HTTPS"

	DefaultHttpPort = "80"

	GET     = "GET"
	PUT     = "PUT"
	POST    = "POST"
	DELETE  = "DELETE"
	PATCH   = "PATCH"
	HEAD    = "HEAD"
	OPTIONS = "OPTIONS"

	Json = "application/json"
	Xml  = "application/xml"
	Raw  = "application/octet-stream"
	Form = "application/x-www-form-urlencoded"

	Header = "Header"
	Query  = "Query"
	Body   = "Body"
	Path   = "Path"

	HeaderSeparator = "\n"
)

Variables

This section is empty.

Functions

func InitParams

func InitParams(request AcsRequest) (err error)

Types

type AcsRequest

type AcsRequest interface {
	GetScheme() string
	GetMerchantId() string
	GetMethod() string
	GetDomain() string
	GetPort() string
	GetHeaders() map[string]string
	GetQueryParams() map[string]string
	GetFormParams() map[string]string
	GetJsonParams() map[string]interface{}
	GetContent() []byte
	GetBodyReader() io.Reader
	GetStyle() string
	GetProduct() string
	GetVersion() string
	SetVersion(version string)
	GetActionName() string
	GetAcceptFormat() string
	GetReadTimeout() time.Duration
	GetConnectTimeout() time.Duration
	SetReadTimeout(readTimeout time.Duration)
	SetConnectTimeout(connectTimeout time.Duration)
	SetHTTPSInsecure(isInsecure bool)
	GetHTTPSInsecure() *bool

	GetUserAgent() map[string]string

	SetStringToSign(stringToSign string)
	GetStringToSign() string

	SetDomain(domain string)
	SetContent(content []byte)
	SetScheme(scheme string)
	BuildUrl() string
	BuildQueries() string
	// contains filtered or unexported methods
}

interface

type Boolean

type Boolean string

func NewBoolean

func NewBoolean(bool bool) Boolean

func (Boolean) GetValue

func (boolean Boolean) GetValue() (bool, error)

func (Boolean) HasValue

func (boolean Boolean) HasValue() bool

type CommonRequest

type CommonRequest struct {
	Version string
	ApiName string

	PathParams map[string]string

	Ontology AcsRequest
	// contains filtered or unexported fields
}

func NewCommonRequest

func NewCommonRequest() (request *CommonRequest)

func (CommonRequest) AppendUserAgent

func (request CommonRequest) AppendUserAgent(key, value string)

func (*CommonRequest) BuildQueries

func (request *CommonRequest) BuildQueries() string

func (*CommonRequest) BuildUrl

func (request *CommonRequest) BuildUrl() string

func (CommonRequest) GetAcceptFormat

func (request CommonRequest) GetAcceptFormat() string

func (CommonRequest) GetActionName

func (request CommonRequest) GetActionName() string

func (*CommonRequest) GetBodyReader

func (request *CommonRequest) GetBodyReader() io.Reader

func (CommonRequest) GetConnectTimeout

func (request CommonRequest) GetConnectTimeout() time.Duration

func (CommonRequest) GetContent

func (request CommonRequest) GetContent() []byte

func (CommonRequest) GetContentType

func (request CommonRequest) GetContentType() (contentType string, contains bool)

func (CommonRequest) GetDomain

func (request CommonRequest) GetDomain() string

func (CommonRequest) GetFormParams

func (request CommonRequest) GetFormParams() map[string]string

func (CommonRequest) GetHTTPSInsecure

func (request CommonRequest) GetHTTPSInsecure() *bool

func (CommonRequest) GetHeaders

func (request CommonRequest) GetHeaders() map[string]string

func (CommonRequest) GetJsonParams

func (request CommonRequest) GetJsonParams() map[string]interface{}

func (CommonRequest) GetMerchantId

func (request CommonRequest) GetMerchantId() string

func (CommonRequest) GetMethod

func (request CommonRequest) GetMethod() string

func (CommonRequest) GetPort

func (request CommonRequest) GetPort() string

func (CommonRequest) GetProduct

func (request CommonRequest) GetProduct() string

func (CommonRequest) GetQueryParams

func (request CommonRequest) GetQueryParams() map[string]string

func (CommonRequest) GetReadTimeout

func (request CommonRequest) GetReadTimeout() time.Duration

func (CommonRequest) GetRegionId

func (request CommonRequest) GetRegionId() string

func (CommonRequest) GetScheme

func (request CommonRequest) GetScheme() string

func (CommonRequest) GetStringToSign

func (request CommonRequest) GetStringToSign() string

func (*CommonRequest) GetStyle

func (request *CommonRequest) GetStyle() string

func (CommonRequest) GetUserAgent

func (request CommonRequest) GetUserAgent() map[string]string

func (CommonRequest) GetVersion

func (request CommonRequest) GetVersion() string

func (CommonRequest) SetConnectTimeout

func (request CommonRequest) SetConnectTimeout(connectTimeout time.Duration)

func (CommonRequest) SetContent

func (request CommonRequest) SetContent(content []byte)

func (CommonRequest) SetContentType

func (request CommonRequest) SetContentType(contentType string)

func (CommonRequest) SetDomain

func (request CommonRequest) SetDomain(host string)

func (CommonRequest) SetHTTPSInsecure

func (request CommonRequest) SetHTTPSInsecure(isInsecure bool)

func (CommonRequest) SetReadTimeout

func (request CommonRequest) SetReadTimeout(readTimeout time.Duration)

func (CommonRequest) SetScheme

func (request CommonRequest) SetScheme(scheme string)

func (CommonRequest) SetStringToSign

func (request CommonRequest) SetStringToSign(stringToSign string)

func (CommonRequest) SetVersion

func (request CommonRequest) SetVersion(version string)

func (*CommonRequest) String

func (request *CommonRequest) String() string

func (*CommonRequest) TransToAcsRequest

func (request *CommonRequest) TransToAcsRequest()

type Float

type Float string

func NewFloat

func NewFloat(f float64) Float

func (Float) GetValue

func (float Float) GetValue() (float64, error)

func (Float) HasValue

func (float Float) HasValue() bool

type Integer

type Integer string

func NewInteger

func NewInteger(integer int) Integer

func NewInteger64

func NewInteger64(integer int64) Integer

func (Integer) GetValue

func (integer Integer) GetValue() (int, error)

func (Integer) GetValue64

func (integer Integer) GetValue64() (int64, error)

func (Integer) HasValue

func (integer Integer) HasValue() bool

type RpcRequest

type RpcRequest struct {
	// contains filtered or unexported fields
}

func (RpcRequest) AppendUserAgent

func (request RpcRequest) AppendUserAgent(key, value string)

func (*RpcRequest) BuildQueries

func (request *RpcRequest) BuildQueries() string

func (*RpcRequest) BuildUrl

func (request *RpcRequest) BuildUrl() string

func (RpcRequest) GetAcceptFormat

func (request RpcRequest) GetAcceptFormat() string

func (*RpcRequest) GetActionName

func (request *RpcRequest) GetActionName() string

func (*RpcRequest) GetBodyReader

func (request *RpcRequest) GetBodyReader() io.Reader

func (RpcRequest) GetConnectTimeout

func (request RpcRequest) GetConnectTimeout() time.Duration

func (RpcRequest) GetContent

func (request RpcRequest) GetContent() []byte

func (RpcRequest) GetContentType

func (request RpcRequest) GetContentType() (contentType string, contains bool)

func (RpcRequest) GetDomain

func (request RpcRequest) GetDomain() string

func (RpcRequest) GetFormParams

func (request RpcRequest) GetFormParams() map[string]string

func (RpcRequest) GetHTTPSInsecure

func (request RpcRequest) GetHTTPSInsecure() *bool

func (RpcRequest) GetHeaders

func (request RpcRequest) GetHeaders() map[string]string

func (RpcRequest) GetJsonParams

func (request RpcRequest) GetJsonParams() map[string]interface{}

func (RpcRequest) GetMerchantId

func (request RpcRequest) GetMerchantId() string

func (RpcRequest) GetMethod

func (request RpcRequest) GetMethod() string

func (RpcRequest) GetPort

func (request RpcRequest) GetPort() string

func (RpcRequest) GetProduct

func (request RpcRequest) GetProduct() string

func (RpcRequest) GetQueryParams

func (request RpcRequest) GetQueryParams() map[string]string

func (RpcRequest) GetReadTimeout

func (request RpcRequest) GetReadTimeout() time.Duration

func (RpcRequest) GetRegionId

func (request RpcRequest) GetRegionId() string

func (RpcRequest) GetScheme

func (request RpcRequest) GetScheme() string

func (RpcRequest) GetStringToSign

func (request RpcRequest) GetStringToSign() string

func (*RpcRequest) GetStyle

func (*RpcRequest) GetStyle() string

func (RpcRequest) GetUserAgent

func (request RpcRequest) GetUserAgent() map[string]string

func (*RpcRequest) GetVersion

func (request *RpcRequest) GetVersion() string

func (*RpcRequest) InitWithApiInfo

func (request *RpcRequest) InitWithApiInfo(product, version, action, serviceCode, endpointType string)

func (RpcRequest) SetConnectTimeout

func (request RpcRequest) SetConnectTimeout(connectTimeout time.Duration)

func (RpcRequest) SetContent

func (request RpcRequest) SetContent(content []byte)

func (RpcRequest) SetContentType

func (request RpcRequest) SetContentType(contentType string)

func (RpcRequest) SetDomain

func (request RpcRequest) SetDomain(host string)

func (RpcRequest) SetHTTPSInsecure

func (request RpcRequest) SetHTTPSInsecure(isInsecure bool)

func (RpcRequest) SetReadTimeout

func (request RpcRequest) SetReadTimeout(readTimeout time.Duration)

func (RpcRequest) SetScheme

func (request RpcRequest) SetScheme(scheme string)

func (RpcRequest) SetStringToSign

func (request RpcRequest) SetStringToSign(stringToSign string)

func (RpcRequest) SetVersion

func (request RpcRequest) SetVersion(version string)

Jump to

Keyboard shortcuts

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