Documentation
¶
Index ¶
- type BaseResponse
- type Client
- func (c *Client) GetCredential() CredentialIface
- func (c *Client) Init() *Client
- func (c *Client) Send(service, method string, params interface{}, resp Response) error
- func (c *Client) WithCredential(cred CredentialIface) *Client
- func (c *Client) WithPath(path string) *Client
- func (c *Client) WithScheme(scheme string) *Client
- func (c *Client) WithSecretId(secretId, secretKey string) *Client
- type Config
- type Credential
- type CredentialIface
- type Response
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BaseResponse ¶
type BaseResponse[T any] struct { Code int `json:"code"` Error bool `json:"error"` Key string `json:"key,omitempty"` Message string `json:"message"` Data T `json:"data,omitempty"` }
func (*BaseResponse[T]) FromJsonReader ¶
func (r *BaseResponse[T]) FromJsonReader(reader io.Reader) error
func (*BaseResponse[T]) FromJsonString ¶
func (r *BaseResponse[T]) FromJsonString(s string) error
func (*BaseResponse[T]) ToJsonString ¶
func (r *BaseResponse[T]) ToJsonString() string
type Client ¶
type Client struct { Scheme string Domain string Path string // contains filtered or unexported fields }
func NewDefaultClient ¶
func (*Client) GetCredential ¶
func (c *Client) GetCredential() CredentialIface
func (*Client) WithCredential ¶
func (c *Client) WithCredential(cred CredentialIface) *Client
func (*Client) WithScheme ¶
func (*Client) WithSecretId ¶
type Credential ¶
func NewCredential ¶
func NewCredential(secretId, secretKey string) *Credential
func NewTokenCredential ¶
func NewTokenCredential(secretId, secretKey, token string) *Credential
func (*Credential) GetCredential ¶
func (c *Credential) GetCredential() (string, string, string)
func (*Credential) GetSecretId ¶
func (c *Credential) GetSecretId() string
func (*Credential) GetSecretKey ¶
func (c *Credential) GetSecretKey() string
func (*Credential) GetToken ¶
func (c *Credential) GetToken() string
type CredentialIface ¶
Click to show internal directories.
Click to hide internal directories.