request

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DEBUG = os.Getenv("DEBUG") == "true"

Functions

func Get

func Get(service string, action string, config *RequestConfig) (*fetch.Response, error)

func Post

func Post(service string, action string, data map[string]interface{}, config *RequestConfig) (*fetch.Response, error)

func Request

func Request(config *RequestConfig) (*fetch.Response, error)

Types

type RequestConfig

type RequestConfig struct {
	SecretId  string
	SecretKey string
	//
	Version string
	//
	Service string
	Action  string
	Region  string
	//
	RequestMethod string
	RequestURI    string
	//
	// RequestHeaders map[string]string
	RequestQuery map[string]string
	RequestBody  map[string]interface{}
}

type ResponseError

type ResponseError struct {
	Code    string `json:"code"`
	Message string `json:"message"`
}

func (ResponseError) Error

func (re ResponseError) Error() string

Jump to

Keyboard shortcuts

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