db

package
v0.0.0-...-3099d22 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2022 License: AGPL-3.0 Imports: 9 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(assets ...asset.Asset) error
	Read(symbols ...string) ([]asset.Asset, error)
	Update(assets ...asset.Asset) error
	Delete(assets ...asset.Asset) error
}

type CandlestickService

type CandlestickService interface {
	Create(cs *candlestick.List) error
	Read(cs *candlestick.List, start, end timestamp.Timestamp, limit uint) 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(exchanges ...exchange.Exchange) error
	Read(names ...string) ([]exchange.Exchange, error)
	Update(exchanges ...exchange.Exchange) error
	Delete(exchanges ...exchange.Exchange) error

	GetAndSetLockedExpiration(fn func(time.Time) (*time.Time, error)) error
	SetPairs(exchangeName string, pairs []pair.Pair) error
}

type PairService

type PairService interface {
	Create(pairs ...pair.Pair) error
	Read(pairs ...pair.Pair) ([]pair.Pair, error)
	Update(pairs ...pair.Pair) error
	Delete(pairs ...pair.Pair) error

	ReadPerExchange(exchangeName string) ([]pair.Pair, error)
}

type PeriodService

type PeriodService interface {
	Create(periods ...period.Period) error
	Read(names ...string) ([]period.Period, error)
	Update(periods ...period.Period) error
	Delete(periods ...period.Period) error
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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