rest

package
v0.0.19 Latest Latest
Warning

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

Go to latest
Published: Jan 5, 2024 License: GPL-3.0 Imports: 10 Imported by: 0

README

REST client(为丹灵云定制)

说明

为丹灵云定制的rest client, 支持到丹灵云的数据上报

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DebugEnable bool

Functions

This section is empty.

Types

type RestClient

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

func NewRest

func NewRest(host string) *RestClient

func (*RestClient) Auth

func (rc *RestClient) Auth(token string) *RestClient

func (*RestClient) Decrypt

func (rc *RestClient) Decrypt(h func(payload []byte) ([]byte, error)) *RestClient

func (*RestClient) Encrypt

func (rc *RestClient) Encrypt(h func(payload []byte) ([]byte, error)) *RestClient

func (*RestClient) Form

func (rc *RestClient) Form(req map[string]string) (code int, err error)

func (*RestClient) FormUrl

func (rc *RestClient) FormUrl(req map[string]string) (code int, err error)

func (*RestClient) Get

func (rc *RestClient) Get(query map[string]string) (code int, err error)

func (*RestClient) Header

func (rc *RestClient) Header(name, value string) *RestClient

func (*RestClient) Path

func (rc *RestClient) Path(name ...string) *RestClient

func (*RestClient) Post

func (rc *RestClient) Post(payload []byte) (code int, err error)

func (*RestClient) PostQuery added in v0.0.10

func (rc *RestClient) PostQuery(query map[string]string) (code int, err error)

func (*RestClient) ResponseJson

func (rc *RestClient) ResponseJson(respPtr any) *RestClient

Jump to

Keyboard shortcuts

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