rest

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Handler

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

func (*Handler) Get

func (r *Handler) Get(uri string) (code int, result string, err error)

func (*Handler) GetJson

func (r *Handler) GetJson(uri string, req interface{}, resultPtr interface{}, headers ...Header) (code int, err error)

func (*Handler) Post

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

func (*Handler) PostJson

func (r *Handler) PostJson(uri string, req interface{}, result interface{}, headers ...Header) (code int, err error)
type Header struct {
	Name  string
	Value string
}

type ReqOption

type ReqOption func()

type Rest

type Rest interface {
	Get(uri string) (code int, body string, err error)
	GetJson(uri string, body interface{}, resultPrt interface{}, headers ...Header) (code int, err error)
	Post(uri string) (code int, result string, err error)
	PostJson(uri string, req interface{}, resultPrt interface{}, headers ...Header) (code int, err error)
}

func New

func New() (r Rest)

Jump to

Keyboard shortcuts

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