common

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2023 License: BSD-3-Clause Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DoCacheTests

func DoCacheTests(t *testing.T, cache Cache)

func DoDatabaseTests

func DoDatabaseTests(t *testing.T, db Database)

Types

type Cache

type Cache interface {
	Set(key string, value any, options ...store.Option) error
	Get(key string, value any) error
	Del(key string) error
	Clear(context context.Context)
	Close()
}

type Database

type Database interface {
	InsertCandles(candles []*source.Candle) error
	SelectCandles(symbol string, resolution source.Resolution, from, to time.Time) ([]*source.Candle, error)
	Close()
}

type SQLDatabase

type SQLDatabase struct {
	Conn *gorm.DB
}

func (*SQLDatabase) Close

func (sqlDB *SQLDatabase) Close()

func (*SQLDatabase) InsertCandles

func (sqlDB *SQLDatabase) InsertCandles(candles []*source.Candle) error

func (*SQLDatabase) SelectCandles

func (sqlDB *SQLDatabase) SelectCandles(symbol string, resolution source.Resolution, from, to time.Time) ([]*source.Candle, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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