client

package
v0.0.0-...-2aee7ef Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2016 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MaxIdleConnections int = 20
	RequestTimeout     int = 5
)

Variables

This section is empty.

Functions

This section is empty.

Types

type BalanceRecord

type BalanceRecord struct {
	UserID int64
	Value  int64
}

type GetBalanceResponse

type GetBalanceResponse struct {
	Error    string          `json:"error"`
	Response []BalanceRecord `json:"response"`
}

type HttpApiClient

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

func NewHttpApiClient

func NewHttpApiClient(baseUrl string) *HttpApiClient

func (*HttpApiClient) GetBalances

func (c *HttpApiClient) GetBalances() ([]BalanceRecord, error)

func (*HttpApiClient) PostTransaction

func (c *HttpApiClient) PostTransaction(userID int64, amount int64) (int64, error)

type PostTransactionRequest

type PostTransactionRequest struct {
	UserID int64
	Value  int64
}

type PostTransactionResponse

type PostTransactionResponse struct {
	Error    string `json:"error"`
	Response struct {
		UserID int64
		Value  int64
	} `json:"response"`
}

Jump to

Keyboard shortcuts

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