hareq

package
v0.1.43 Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2022 License: MIT Imports: 12 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AuthFastGet

func AuthFastGet(url string, resData interface{}, th string) error

func AuthFastPost

func AuthFastPost(body interface{}, url string, resData interface{}, th string) error

post with body, url and auth, get decoded res

func BodyParser added in v0.0.14

func BodyParser(r *http.Request, body interface{}) error

http post req body parser

func DataGet added in v0.1.20

func DataGet(url string) (string, error)

get with url, get decoded res

func DownloadFileFromUrl added in v0.1.23

func DownloadFileFromUrl(url string, saveIn string, name string) error

func FastGet

func FastGet(url string, resData interface{}) error

get with url, get decoded res

func FastPost

func FastPost(body interface{}, url string, resData interface{}) error

post with body and url, get decoded res

func FastUpload

func FastUpload(url string, body map[string]string, resData interface{}, files ...FileToUpload) error

func SendJson added in v0.0.15

func SendJson(w http.ResponseWriter, data interface{}) error

http send json

func SendString added in v0.0.15

func SendString(w http.ResponseWriter, data string) error

http send string

func SetStatus added in v0.0.15

func SetStatus(w http.ResponseWriter, status int)

http set header

Types

type Caller added in v0.1.20

type Caller struct {
	Url   string
	Body  interface{}
	Data  string
	Err   error
	Param []string
}

func NewCaller added in v0.1.20

func NewCaller(url string) *Caller

func (*Caller) Decode added in v0.1.20

func (caller *Caller) Decode(res interface{}) *Caller

func (*Caller) Get added in v0.1.20

func (caller *Caller) Get() *Caller

func (*Caller) GetUrl added in v0.1.43

func (caller *Caller) GetUrl() string

func (*Caller) OnErr added in v0.1.20

func (caller *Caller) OnErr(handler func(error)) *Caller

func (*Caller) SetParam added in v0.1.43

func (caller *Caller) SetParam(param []string) *Caller

type FileToUpload added in v0.0.8

type FileToUpload struct {
	Name string
	Path string
}

type HaConnection added in v0.1.18

type HaConnection struct {
	Host     string
	Port     int
	Protocol string
}

func (HaConnection) GetConnection added in v0.1.18

func (conn HaConnection) GetConnection() string

func (HaConnection) GetPort added in v0.1.18

func (conn HaConnection) GetPort() string

type MsgRes added in v0.1.19

type MsgRes struct {
	Message string `json:"message"`
	Success bool   `json:"success"`
}

Jump to

Keyboard shortcuts

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