repository

package
v0.0.0-...-9243632 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const AssetTable = `CREATE TABLE IF NOT EXISTS asset (
symbol text primary key,
name text);
`
View Source
const OHLCTable = `` /* 183-byte string literal not displayed */

Variables

This section is empty.

Functions

func CreateTables

func CreateTables(ctx context.Context, conn *pgxpool.Pool) error

func Recreate

func Recreate(ctx context.Context, conn *pgxpool.Pool) error

Types

type Asset

type Asset struct {
	Conn postgres.Query
}

func (*Asset) Delete

func (db *Asset) Delete(ctx context.Context, symbol string) error

func (*Asset) Get

func (db *Asset) Get(ctx context.Context, symbol string) (*pb.Asset, error)

func (*Asset) List

func (db *Asset) List(ctx context.Context) ([]*pb.Asset, error)

func (*Asset) ListBySymbols

func (db *Asset) ListBySymbols(ctx context.Context, symbols []string) ([]*pb.Asset, error)

func (*Asset) Store

func (db *Asset) Store(ctx context.Context, symbol, name string) error

type OHLC

type OHLC struct {
	Conn postgres.Query
}

func (*OHLC) Exists

func (db *OHLC) Exists(ctx context.Context, symbols []string, start, end *pb.Date) (bool, error)

func (*OHLC) MinMax

func (db *OHLC) MinMax(ctx context.Context) (*pb.Date, *pb.Date, error)

func (*OHLC) Store

func (db *OHLC) Store(ctx context.Context, symbol string, t time.Time, o, h, l, c float64, v int) error

Jump to

Keyboard shortcuts

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