client

package
v0.0.0-...-c5373b1 Latest Latest
Warning

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

Go to latest
Published: May 22, 2019 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RequestBuffer

func RequestBuffer(req interface{}) (*bytes.Reader, error)

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

func NewClient

func NewClient(gateway string) *Client

func (*Client) Get

func (this *Client) Get(endPoint string) ([]byte, error)

func (*Client) Post

func (this *Client) Post(endPoint string, req interface{}) ([]byte, error)

type Error

type Error struct {
	Code ErrorCode `json:"code,omitempty"`
	Msg  string    `json:"message,omitempty"`
}

func (Error) Error

func (this Error) Error() string

type ErrorCode

type ErrorCode = int
const (
	BADREQUEST_ERROR            ErrorCode = 400
	INTERNAL_ERROR              ErrorCode = 500
	NOTFOUND_ERROR              ErrorCode = 404
	UNAUTHORIZED_ERROR          ErrorCode = 401
	FEATURE_NOT_AVAILABLE_ERROR ErrorCode = 402
)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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