network

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2024 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DownloadBytes

func DownloadBytes(source string) ([]byte, error)

func OpenBrowser

func OpenBrowser(url string)

func RequestToObject

func RequestToObject(r io.ReadCloser, data interface{}) (e error)

func Response

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

func ResponseError

func ResponseError(w http.ResponseWriter, e error)

func ResponseWithMeta added in v0.2.2

func ResponseWithMeta(w http.ResponseWriter, data interface{}, meta *Meta)

Types

type JSONResponse

type JSONResponse struct {
	// Body
	Data interface{} `json:"data,omitempty"`
	// Meta
	Meta *Meta `json:"meta,omitempty"`
	// Error information
	Error interface{} `json:"error,omitempty"`
}

type Meta added in v0.2.2

type Meta struct {
	Total      int `json:"total"`
	CardsTotal int `json:"cardsTotal,omitempty"`
}

Jump to

Keyboard shortcuts

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