pkg

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

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

Go to latest
Published: May 21, 2021 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckResponseStatus

func CheckResponseStatus(statusCode int) error

func InitAppE

func InitAppE(app **Application) func(cmd *cobra.Command, args []string) error

func RequestAndDeserialize

func RequestAndDeserialize(httpMethod string, path string, body io.Reader, into interface{}) (*http.Response, error)

func SprintResponse

func SprintResponse(res *http.Response) string

Types

type Application

type Application struct {
	Config Config
	Client *http.Client
}
var App *Application

App stores an instance

func NewApp

func NewApp(creds Credentials, client *http.Client) *Application

func (*Application) GetCryptoAccounts

func (a *Application) GetCryptoAccounts() (accounts []*model.Account, res *http.Response, err error)

func (*Application) GetFiatAccounts

func (a *Application) GetFiatAccounts() (accounts []*model.Account, res *http.Response, err error)

func (*Application) GetProduct

func (a *Application) GetProduct(idOrPairCode string) (product *model.Product, res *http.Response, err error)

func (*Application) GetProducts

func (a *Application) GetProducts(perpetual bool) (products []*model.Product, res *http.Response, err error)

func (*Application) Request

func (a *Application) Request(httpMethod string, path string, body io.Reader) (*http.Response, error)

type Config

type Config struct {
	Credentials
}

type Credentials

type Credentials struct {
	ID     string
	Secret string
}

type Provider

type Provider interface {
	GetFiatAccounts() (accounts []*model.Account, res *http.Response, err error)
	GetCryptoAccounts() (accounts []*model.Account, res *http.Response, err error)
	GetProducts(perpetual bool) (products []*model.Product, res *http.Response, err error)
	GetProduct(idOrpairCode string) (product *model.Product, res *http.Response, err error)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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