request

package
v0.0.9 Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

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

Functions

func SetService

func SetService(service string)

func SetToken

func SetToken(token string)

func SetVersion

func SetVersion(version string)

Types

type Config

type Config struct {
	Action   string
	Resource string
	//
	Headers map[string]string
	// Query   map[string]string
	// Params  map[string]string
	// Body    map[string]interface{}
	//
	Service string
	Token   string
	Version string
}

type Payload

type Payload struct {
	Headers map[string]string
	Query   map[string]string
	Params  map[string]string
	Body    map[string]interface{}
}

type Response

type Response = fetch.Response

func Request

func Request(cfg *Config, payload *Payload) (*Response, error)

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