core

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2021 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	BaseUrl   string //openapi baseurl,eg: https://api2.hopex.com
	Apikey    string //api key
	ApiSecret string //api Secret
	UserAgent string //<product>/<product-version> <comment>
}

func NewConfig

func NewConfig(baseUrl, apiKey, apiSecret, userAgent string) *Config

type DefaultHttpRequester

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

func (*DefaultHttpRequester) Get

func (req *DefaultHttpRequester) Get(path string, queries map[string]string, auth bool, response Response) error

func (*DefaultHttpRequester) Init

func (req *DefaultHttpRequester) Init(config *Config, logger logging.Logger) *DefaultHttpRequester

func (*DefaultHttpRequester) InitByZapLogger

func (req *DefaultHttpRequester) InitByZapLogger(config *Config) *DefaultHttpRequester

func (*DefaultHttpRequester) Post

func (req *DefaultHttpRequester) Post(path string, body []byte, queries map[string]string, auth bool, response Response) error

type HttpRequester

type HttpRequester interface {
	//get request
	Get(path string, queries map[string]string, auth bool, response Response) error

	//post request
	Post(path string, body []byte, queries map[string]string, auth bool, response Response) error
}

type Response

type Response interface {
	//check ret field
	CheckRet() error
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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