stores

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2024 License: MIT Imports: 34 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cos added in v0.5.1

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

Cos define tencent cos store

func NewCos added in v0.5.1

func NewCos(client *cos.Client) *Cos

NewCos create tencent cos store

func (Cos) Close added in v0.5.1

func (s Cos) Close() error

Close close store

func (Cos) Delete added in v0.6.4

func (s Cos) Delete(exchange exchanges.Exchange, date time.Time) error

Delete delete exchange daily quote

func (Cos) Exists added in v0.5.1

func (s Cos) Exists(exchange exchanges.Exchange, date time.Time) (bool, error)

Exists check quote exists

func (Cos) Load added in v0.5.1

func (s Cos) Load(exchange exchanges.Exchange, date time.Time) (*quotes.ExchangeDailyQuote, error)

Load load exchange daily quote

func (Cos) Save added in v0.5.1

func (s Cos) Save(exchange exchanges.Exchange, date time.Time, edq *quotes.ExchangeDailyQuote) error

Save save exchange daily quote

type FileSystem

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

FileSystem define file system store

func NewFileSystem

func NewFileSystem(root string) *FileSystem

NewFileSystem create file system store

func (FileSystem) Close added in v0.3.1

func (s FileSystem) Close() error

Close close store

func (FileSystem) Delete added in v0.6.4

func (s FileSystem) Delete(exchange exchanges.Exchange, date time.Time) error

Delete delete exchange daily quote

func (FileSystem) Exists

func (s FileSystem) Exists(exchange exchanges.Exchange, date time.Time) (bool, error)

Exists check quote exists

func (FileSystem) Load

func (s FileSystem) Load(exchange exchanges.Exchange, date time.Time) (*quotes.ExchangeDailyQuote, error)

Load load exchange daily quote

func (FileSystem) Save

func (s FileSystem) Save(exchange exchanges.Exchange, date time.Time, edq *quotes.ExchangeDailyQuote) error

Save save exchange daily quote

type InfluxDB added in v0.6.3

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

InfluxDB influxdb store

func NewInfluxDB added in v0.6.3

func NewInfluxDB(address, db string) *InfluxDB

NewInfluxDB create new influxdb store

func (InfluxDB) Close added in v0.6.3

func (s InfluxDB) Close() error

Close close store

func (InfluxDB) Delete added in v0.6.4

func (s InfluxDB) Delete(exchange exchanges.Exchange, date time.Time) error

Delete delete exchange daily quote

func (InfluxDB) Exists added in v0.6.3

func (s InfluxDB) Exists(exchange exchanges.Exchange, date time.Time) (bool, error)

Exists check quote exists

func (InfluxDB) Load added in v0.6.3

func (s InfluxDB) Load(exchange exchanges.Exchange, date time.Time) (*quotes.ExchangeDailyQuote, error)

Load load exchange daily quote

func (InfluxDB) Save added in v0.6.3

func (s InfluxDB) Save(exchange exchanges.Exchange, date time.Time, edq *quotes.ExchangeDailyQuote) error

Save save exchange daily quote

type KV added in v0.4.3

type KV struct {
	Key   string
	Value string
}

KV key value pair

type LevelDB added in v0.3.1

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

LevelDB level db store

func NewLevelDB added in v0.3.1

func NewLevelDB(root string) *LevelDB

NewLevelDB create level db store

func (LevelDB) Close added in v0.3.1

func (s LevelDB) Close() error

Close close level db store

func (LevelDB) Delete added in v0.6.4

func (s LevelDB) Delete(exchange exchanges.Exchange, date time.Time) error

Delete delete exchange daily quote

func (LevelDB) Exists added in v0.3.1

func (s LevelDB) Exists(exchange exchanges.Exchange, date time.Time) (bool, error)

Exists check quote exists

func (LevelDB) Load added in v0.3.1

func (s LevelDB) Load(exchange exchanges.Exchange, date time.Time) (*quotes.ExchangeDailyQuote, error)

Load load exchange daily quote

func (LevelDB) Save added in v0.3.1

func (s LevelDB) Save(exchange exchanges.Exchange, date time.Time, edq *quotes.ExchangeDailyQuote) error

Save save exchange daily quote

type Redis added in v0.4.2

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

Redis define redis store

func NewRedis added in v0.4.2

func NewRedis(address, password string) *Redis

NewRedis create redis store

func (Redis) Close added in v0.4.2

func (s Redis) Close() error

Close close redis store

func (Redis) Delete added in v0.6.4

func (s Redis) Delete(exchange exchanges.Exchange, date time.Time) error

Delete delete exchange daily quote

func (Redis) Exists added in v0.4.2

func (s Redis) Exists(exchange exchanges.Exchange, date time.Time) (bool, error)

Exists check quote exists

func (Redis) Load added in v0.4.2

func (s Redis) Load(exchange exchanges.Exchange, date time.Time) (*quotes.ExchangeDailyQuote, error)

Load load exchange daily quote

func (Redis) Save added in v0.4.2

func (s Redis) Save(exchange exchanges.Exchange, date time.Time, edq *quotes.ExchangeDailyQuote) error

Save save exchange daily quote

type S3 added in v0.6.5

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

S3 define tencent cos store

func NewS3 added in v0.6.5

func NewS3(config *S3Config) *S3

NewS3 create tencent cos store

func (S3) Close added in v0.6.5

func (s S3) Close() error

Close close store

func (S3) Delete added in v0.6.5

func (s S3) Delete(exchange exchanges.Exchange, date time.Time) error

Delete delete exchange daily quote

func (S3) Exists added in v0.6.5

func (s S3) Exists(exchange exchanges.Exchange, date time.Time) (bool, error)

Exists check quote exists

func (S3) Load added in v0.6.5

func (s S3) Load(exchange exchanges.Exchange, date time.Time) (*quotes.ExchangeDailyQuote, error)

Load load exchange daily quote

func (S3) Save added in v0.6.5

func (s S3) Save(exchange exchanges.Exchange, date time.Time, edq *quotes.ExchangeDailyQuote) error

Save save exchange daily quote

type S3Config added in v0.6.5

type S3Config struct {
	AccessKeyID     string `yaml:"id"`
	SecretAccessKey string `yaml:"secret"`
	Region          string `yaml:"region"`
	Bucket          string `yaml:"bucket"`
}

S3Config aws s3 store config

type Store

type Store interface {
	// Exists exchange daily quote exists
	Exists(exchanges.Exchange, time.Time) (bool, error)
	// Save save exchange daily quote
	Save(exchanges.Exchange, time.Time, *quotes.ExchangeDailyQuote) error
	// Load load exchange daily quote
	Load(exchanges.Exchange, time.Time) (*quotes.ExchangeDailyQuote, error)
	// Delete delete exchange daily quote
	Delete(exchanges.Exchange, time.Time) error
	// Close close exchange daily quote store
	Close() error
}

Store define exchange daily quote store

func Parse

func Parse(arg string) (Store, error)

Parse parse command argument

type TDEngine added in v0.7.0

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

TDEngine tdengine store tables: nasdaq_raw_1m_done done flag nasdaq_company companies nasdaq_aapl_pre_raw_1m pre nasdaq_aapl_regular_raw_1m regular nasdaq_aapl_post_raw_1m post nasdaq_aapl_dividend dividend nasdaq_aapl_split split

func NewTDEngine added in v0.7.0

func NewTDEngine(address string) (*TDEngine, error)

NewTDEngine create new tdengine store

func (TDEngine) Close added in v0.7.0

func (s TDEngine) Close() error

Close close store

func (TDEngine) Delete added in v0.7.0

func (s TDEngine) Delete(exchange exchanges.Exchange, date time.Time) error

Delete delete exchange daily quote

func (TDEngine) Exists added in v0.7.0

func (s TDEngine) Exists(exchange exchanges.Exchange, date time.Time) (bool, error)

Exists check quote exists

func (TDEngine) Load added in v0.7.0

func (s TDEngine) Load(exchange exchanges.Exchange, date time.Time) (*quotes.ExchangeDailyQuote, error)

Load load exchange daily quote

func (TDEngine) Save added in v0.7.0

func (s TDEngine) Save(exchange exchanges.Exchange, date time.Time, edq *quotes.ExchangeDailyQuote) error

Save save exchange daily quote

Jump to

Keyboard shortcuts

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