postgres

package
v0.0.0-...-ab49fd9 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const AssetTable = `CREATE TABLE IF NOT EXISTS asset (
symbol text primary key, 
name text,
title text,
asset_type text
);
`
View Source
const OHLCTable = `` /* 184-byte string literal not displayed */
View Source
const OrderTable = `` /* 197-byte string literal not displayed */
View Source
const PositionTable = `` /* 207-byte string literal not displayed */

Variables

This section is empty.

Functions

This section is empty.

Types

type AssetPostgres

type AssetPostgres struct {
	Connection *pgxpool.Pool
}

func (*AssetPostgres) Delete

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

Delete Delete asset

func (*AssetPostgres) Get

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

Get Get a asset based on asset symbol

func (*AssetPostgres) List

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

List List all assets stored

func (*AssetPostgres) Store

func (db *AssetPostgres) Store(ctx context.Context, i *storage.Asset) error

Create Create a new asset

type OHLCPostgres

type OHLCPostgres struct {
	Connection *pgxpool.Pool
}

func (*OHLCPostgres) Store

func (db *OHLCPostgres) Store(ctx context.Context, symbol string, ohlc *storage.OHLC) error

Create Create new End-of-day entry, based on instrument and session

type OrderPostgres

type OrderPostgres struct {
	Connection *pgxpool.Pool
}

func (*OrderPostgres) List

func (db *OrderPostgres) List(ctx context.Context, execution string) ([]*storage.Order, error)

List Lists all orders of a session

func (*OrderPostgres) Store

func (db *OrderPostgres) Store(ctx context.Context, execution string, order *storage.Order) error

Store Saves a new order

type PositionPostgres

type PositionPostgres struct {
	Connection *pgxpool.Pool
}

func (*PositionPostgres) List

func (db *PositionPostgres) List(ctx context.Context, execution string, period *time.Time) ([]*storage.Position, error)

func (*PositionPostgres) Store

func (db *PositionPostgres) Store(ctx context.Context, execution string, p *storage.Position) error

Jump to

Keyboard shortcuts

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