Versions in this module Expand all Collapse all v0 v0.1.0 Mar 14, 2024 Changes in this version + const OpenApiAccessKey + const OpenApiSign + const OpenApiTimestamp + const URI_INFO + const URI_LIST + const URI_ROOT + func GenerateHMACSHA256Digest(appID, secretKey string, timestamp int64) string + type Client struct + AccessKey string + Endpoint string + RequestTimeout int + Secret string + func NewClient(accessKey, secret string, endpoint string, requestTimeout int) (*Client, error) + func (c *Client) DoRequest(options ...ClientRequestOption) (*httputil.Response, error) + type ClientRequestOption func(*ClientRequestOptions) + func WithAuthReqired(auth bool) ClientRequestOption + func WithBody(body io.Reader) ClientRequestOption + func WithHeaders(headers map[string]string) ClientRequestOption + func WithMethod(method string) ClientRequestOption + func WithQueryParams(params map[string]string) ClientRequestOption + func WithURI(uri string) ClientRequestOption + type ClientRequestOptions struct + AuthReqired bool + Body io.Reader + Headers map[string]string + Method string + QueryParams map[string]string + URI string + func NewClientRequestOptions(options ...ClientRequestOption) *ClientRequestOptions + type FileServiceClient struct + func NewFileServiceClient(accessKey, secret string, endpoint string, requestTimeout int) (*FileServiceClient, error) + func (c *FileServiceClient) DeleteFile(filename string) (*httputil.Response, error) + func (c *FileServiceClient) GetFile(filename string) (*httputil.Response, error) + func (c *FileServiceClient) GetFiles(prefix string) (*httputil.Response, error) + func (c *FileServiceClient) InfoFile(filename string) (*httputil.Response, error) + func (c *FileServiceClient) PostFile(filename string, reader io.Reader) (*httputil.Response, error) + type OpenApiArgs struct + AccessKey string + Sign string + Timestamp int64 + func GetOpenApiArgs(c *gin.Context) (*OpenApiArgs, error) + type OpenApiMiddleware struct + ApiKeys map[string]string + SignTtl int + func NewOpenApiMiddleware(apiKeys map[string]string, signTtl int) *OpenApiMiddleware + func (mw *OpenApiMiddleware) GetSecretByAccessKey(accessKey string) (string, error) + func (mw *OpenApiMiddleware) OpenApiAuth(c *gin.Context) + type SdkConfig struct + AccessKey string + EndPoint string + RequestTimeout int + Secret string + func LoadSdkConfig() (*SdkConfig, error)