db

package
v0.0.0-...-5e10106 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2021 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrRecordNotFound error = gorm.ErrRecordNotFound
)

Functions

func WithContext

func WithContext(parent context.Context, db DB) context.Context

Types

type AssetService

type AssetService interface {
	Create(a asset.Asset) error
	Read(symbol string) (asset.Asset, error)
	Update(a asset.Asset) error
	Delete(a asset.Asset) error
}

type CandlestickService

type CandlestickService interface {
	Create(cs *candlestick.List) error
	Read(cs *candlestick.List, start, end timestamp.Timestamp) error
	Update(cs *candlestick.List) error
	Delete(cs *candlestick.List) error
}

type DB

type DB interface {
	Assets() AssetService
	Candlesticks() CandlestickService
	Periods() PeriodService
	Pairs() PairService
	Exchanges() ExchangeService
}

func FromContext

func FromContext(ctx context.Context) DB

type ExchangeService

type ExchangeService interface {
	Create(e exchange.Exchange) error
	Read(name string) (exchange.Exchange, error)
	Update(e exchange.Exchange) error
	Delete(e exchange.Exchange) error
}

type PairService

type PairService interface {
	Create(p pair.Pair) error
	Read(base, quote string) (pair.Pair, error)
	Update(p pair.Pair) error
	Delete(p pair.Pair) error
}

type PeriodService

type PeriodService interface {
	Create(p period.Period) error
	Read(name string) (period.Period, error)
	Update(p period.Period) error
	Delete(p period.Period) error
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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