data

package
v0.0.0-...-41ec502 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2017 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const DATABASE_NAME = "sftbot.db"

Variables

View Source
var BUCKET_NAMES = []string{
	"accounts",
	"transactions",
}
View Source
var CURRENCIES = []string{
	"BTC",
	"ETH",
	"LTC",
	"XRP",
	"STEEM",
	"ZEC",
	"BTS",
	"ETC",
	"SC",
	"DASH",
	"GNT",
	"DGB",
	"FCT",
	"XMR",
	"MAID",
}

Functions

func InitSchema

func InitSchema() error

Types

type Account

type Account struct {
	Name    string
	Balance float64
}

type ChartData

type ChartData struct {
	Date            int64
	High            float64
	Low             float64
	Open            float64
	Close           float64
	Volume          float64
	QuoteVolume     float64
	WeightedAverage float64
}

type Store

type Store struct {
	*bolt.DB
}

func OpenDB

func OpenDB() (*Store, error)

NOTE: expects caller to close the database (e.g. `defer db.Close()`)

func (*Store) DecodeValue

func (db *Store) DecodeValue(data []byte, out interface{})

func (*Store) EncodeKey

func (db *Store) EncodeKey(data interface{}) []byte

func (*Store) EncodeValue

func (db *Store) EncodeValue(data interface{}) []byte

func (*Store) ForEachPeriod

func (db *Store) ForEachPeriod(currencyPair string, callback func(chartData *ChartData)) error

func (*Store) Write

func (db *Store) Write(bucketName string, key interface{}, value interface{}) error

Jump to

Keyboard shortcuts

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