ticker

package module
v0.0.0-...-0302d8d Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2018 License: MIT Imports: 3 Imported by: 0

README

go-exchange-api

A GoLang API for popular crypto-currency exchanges and a set of command line utilities.

[work in progress]

Documentation

Overview

Package ticker defines common interfaces, constants and utility functions for all exchange clients

Package ticker defines common interfaces, constants and utility functions for all exchange clients

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Command

type Command byte

type Connector

type Connector interface {
	GetURL() string
	GetName() string
	GetStatus() Status
	Connect(key string) (<-chan Status, error)
	Disconnect() error
}

type Exchanger

type Exchanger interface {
	Connector
	Ticker
	Trader
}

type State

type State byte
const (
	// states
	DISCONNECTED State = iota
	CONNECTING
	CONNECTED
	WAITING
)

func (State) String

func (s State) String() string

type Status

type Status struct {
	State State
	Error error
}

type Ticker

type Ticker interface {
	Subscribe([]string) (<-chan *Trade, error)
	Unsubscribe([]string) error
}

type Trade

type Trade struct {
	Time   time.Time
	Pair   string
	Type   TradeType
	Amount float64
	Price  float64
}

type TradeType

type TradeType byte
const (
	UNK_TRADE TradeType = 0
	BID       TradeType = 1
	SELL      TradeType = 1
	ASK       TradeType = 2
	BUY       TradeType = 2
)

func ParseTradeType

func ParseTradeType(typ string) (TradeType, error)

func (TradeType) String

func (typ TradeType) String() string

type Trader

type Trader interface {
}

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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