web

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jun 23, 2022 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildAuthTokenFromEnv

func BuildAuthTokenFromEnv() (map[string]string, error)

func DispatchAndWait

func DispatchAndWait(method, host string, url string, token map[string]string, data interface{}) ([]byte, error)

func DispatchSocket

func DispatchSocket(method, host string, url string, headers map[string]string, data interface{}) ([]byte, error)

func JSONResponse

func JSONResponse(response interface{}, w http.ResponseWriter) error

func JSONResponseError

func JSONResponseError(err error, w http.ResponseWriter) error

func JSONUnmarshal

func JSONUnmarshal(msg []byte) (map[string]interface{}, error)

Types

type JSONResponseMessage

type JSONResponseMessage struct {
	Success bool        `json:"success"`
	Message interface{} `json:"message"`
	Errors  string      `json:"errors"`
}

type Response

type Response struct {
	Body       []byte
	Status     string
	StatusCode int
	Header     http.Header
}

func DispatchSocketWithStatus

func DispatchSocketWithStatus(method, host string, url string, headers map[string]string, data interface{}) (*Response, error)

type StatusDesc

type StatusDesc struct {
	Success bool           `json:"success"`
	Message StatusResponse `json:"message"`
	Errors  string         `json:"errors"`
}

type StatusResponse

type StatusResponse struct {
	Status string `json:"Status"`
	Link   string `json:"Link"`
}

Jump to

Keyboard shortcuts

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