request

package
v0.1.8 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2022 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Get

func Get(ctx context.Context, link string, opt RequestOption) (string, error)

func InitRequest

func InitRequest(name string)

func Post

func Post(ctx context.Context, link string, opt RequestOption) (string, error)

Types

type Request

type Request interface {
	Get(ctx context.Context, link string, opt RequestOption) (string, error)
	Post(ctx context.Context, link string, opt RequestOption) (string, error)
}

func NewResty

func NewResty() Request

type RequestOption

type RequestOption struct {
	Trace            string
	Timeout          int
	Proxy            string
	EnableSkipVerify bool
	EnableHeader     bool
	Payload          []byte
}

type Resty

type Resty struct{}

func (*Resty) Get

func (c *Resty) Get(ctx context.Context, link string, opt RequestOption) (string, error)

func (*Resty) Post

func (c *Resty) Post(ctx context.Context, link string, opt RequestOption) (string, error)

Jump to

Keyboard shortcuts

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