apiClient

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2017 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNoServerAvailable = errors.New("no server available")

ErrNoServerAvailable occurred when no server available in the pool

Functions

This section is empty.

Types

type Config

type Config struct {
	Addresses       []string
	WatcherTickTime time.Duration
}

Config handles APIClient parameters

type Instance

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

Instance handles internal client representation and settings

func New

func New(config Config) *Instance

New API client instance

func (*Instance) GET

func (client *Instance) GET() (statusCode int, body []byte, err error)

GET sends a request with GET method

func (*Instance) GetJSON

func (client *Instance) GetJSON(v interface{}) (statusCode int, err error)

GetJSON sends a GET request and deserializes response in a provided variable

func (*Instance) Handler

func (client *Instance) Handler() func(*gramework.Context) error

Handler returns gramework handler

func (*Instance) WSHandler

func (client *Instance) WSHandler() func(*gramework.Context) error

WSHandler returns gramework handler

Jump to

Keyboard shortcuts

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