util

package
v0.11.3 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Join

func Join(j string, s ...string) string

func StatusIn

func StatusIn(status int, list []int) (b bool)

StatusIn 判定状态是否在列表中

Types

type Rest

type Rest interface {
	Get(uri string) (code int, body string, err error)
	Form(url string, data map[string]string, headers map[string]string) (code int, body string, err error)
	Post(uri string) (code int, body string, err error)
	PostJson(uri string, body interface{}) (code int, err error)
}

func New

func New() (r Rest)

type RestHandler

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

func (*RestHandler) Form

func (r *RestHandler) Form(url string, data map[string]string, headers map[string]string) (code int, body string, err error)

func (*RestHandler) Get

func (r *RestHandler) Get(uri string) (code int, body string, err error)

func (*RestHandler) GetJson

func (r *RestHandler) GetJson(uri string, body interface{}) (code int, err error)

func (*RestHandler) Post

func (r *RestHandler) Post(uri string) (code int, body string, err error)

func (*RestHandler) PostJson

func (r *RestHandler) PostJson(uri string, body interface{}) (code int, err error)

Jump to

Keyboard shortcuts

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