kernel

package
v0.0.0-...-ac4b63c Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2023 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateSalt

func GenerateSalt() string

func GenerateSignature

func GenerateSignature(appID, query, salt, secret string) string

GenerateSignature 生成签名

Types

type BaseClient

type BaseClient struct {
	HttpHelper *helper.RequestHelper
	Config     *config.BaiduTranslateConfig
	BaseUri    string

	GetMiddlewareOfLog func(logger contract2.LoggerInterface) contract.RequestMiddleware
}

func NewBaseClient

func NewBaseClient(config *config.BaiduTranslateConfig) (*BaseClient, error)

func (*BaseClient) HttpGet

func (client *BaseClient) HttpGet(ctx context.Context, url string, query *object.StringMap, outHeader interface{}, outBody interface{}) (interface{}, error)

func (*BaseClient) HttpPost

func (client *BaseClient) HttpPost(ctx context.Context, endpoint string, data interface{}, outHeader interface{}, outBody interface{}) (interface{}, error)

func (*BaseClient) OverrideGetMiddlewareOfLog

func (client *BaseClient) OverrideGetMiddlewareOfLog()

func (*BaseClient) OverrideGetMiddlewares

func (client *BaseClient) OverrideGetMiddlewares()

func (*BaseClient) RegisterHttpMiddlewares

func (client *BaseClient) RegisterHttpMiddlewares()

func (*BaseClient) Request

func (client *BaseClient) Request(ctx context.Context, uri string, method string, options *object.HashMap,
	returnRaw bool, outHeader interface{}, outBody interface{},
) (*http.Response, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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