sdk

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2024 License: LGPL-2.1 Imports: 7 Imported by: 0

Documentation

Index

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 NewDefaultClient(domain string) *Client

func (*Client) GetCredential

func (c *Client) GetCredential() CredentialIface

func (*Client) Init

func (c *Client) Init() *Client

func (*Client) Send

func (c *Client) Send(service, method string, params interface{}, resp Response) error

func (*Client) WithCredential

func (c *Client) WithCredential(cred CredentialIface) *Client

func (*Client) WithPath

func (c *Client) WithPath(path string) *Client

func (*Client) WithScheme

func (c *Client) WithScheme(scheme string) *Client

func (*Client) WithSecretId

func (c *Client) WithSecretId(secretId, secretKey string) *Client

type Config

type Config struct {
}

type Credential

type Credential struct {
	SecretId  string
	SecretKey string
	Token     string
}

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

type CredentialIface interface {
	GetSecretId() string
	GetToken() string
	GetSecretKey() string
	GetCredential() (string, string, string)
}

type Response

type Response interface {
	ToJsonString() string
	FromJsonString(s string) error
	FromJsonReader(reader io.Reader) error
	// contains filtered or unexported methods
}

Jump to

Keyboard shortcuts

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