sql

package
v0.0.0-...-e7652ed Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2023 License: AGPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DefaultGormConfig = &gorm.Config{
		Logger: logger.Default.LogMode(logger.Silent),
	}
)
View Source
var (
	ErrInvalidConfig = errors.New("invalid sql config")
)

Functions

This section is empty.

Types

type Config

type Config struct {
	User     string
	Password string
	Host     string
	Port     int
	Database string
}

func (*Config) Load

func (c *Config) Load() *Config

func (Config) URL

func (c Config) URL() string

func (Config) Validate

func (c Config) Validate() error

type DB

type DB struct {
	// contains filtered or unexported fields
}

func New

func New() (*DB, error)

func (*DB) CreateCandlesticks

func (d *DB) CreateCandlesticks(ctx context.Context, cs *candlestick.List) error

func (*DB) DeleteCandlesticks

func (d *DB) DeleteCandlesticks(ctx context.Context, cs *candlestick.List) error

func (*DB) ReadCandlesticks

func (d *DB) ReadCandlesticks(ctx context.Context, cs *candlestick.List, start, end time.Time, limit uint) error

func (*DB) Reset

func (d *DB) Reset() error

func (*DB) UpdateCandlesticks

func (d *DB) UpdateCandlesticks(ctx context.Context, cs *candlestick.List) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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