writer

package
v4.1.14 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2022 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BarWriter

type BarWriter interface {
	Write(symbol string, bars []v1.Bar) error
}

BarWriter is an interface to write chart data to the marketstore.

type BarWriterImpl

type BarWriterImpl struct {
	MarketStoreWriter MarketStoreWriter
	Timeframe         string
	// BarWriterImpl writes data with the timezone
	Timezone *time.Location
}

BarWriterImpl is an implementation of the BarWriter interface.

func (BarWriterImpl) Write

func (b BarWriterImpl) Write(symbol string, bars []v1.Bar) error

Write converts the Response of the ListBars API to a ColumnSeriesMap and write it to the local marketstore server.

type MarketStoreWriter

type MarketStoreWriter interface {
	Write(csm io.ColumnSeriesMap) error
}

MarketStoreWriter is an interface to write data to marketstore. this interface is necessary for writing unit tests of Alpaca Broker API Feeder without actually saving data to the marketstore.

type MarketStoreWriterImpl

type MarketStoreWriterImpl struct{}

MarketStoreWriterImpl writes the column series map data to the local marketstore data.

func (*MarketStoreWriterImpl) Write

type SnapshotWriter

type SnapshotWriter interface {
	Write(snapshots map[string]*api.Snapshot) error
}

SnapshotWriter is an interface to write the realtime stock data to the marketstore.

type SnapshotWriterImpl

type SnapshotWriterImpl struct {
	MarketStoreWriter MarketStoreWriter
	Timeframe         string
	// SnapshotWriterImpl writes data with the timezone
	Timezone *time.Location
}

SnapshotWriterImpl is an implementation of the SnapshotWriter interface.

func (SnapshotWriterImpl) Write

func (q SnapshotWriterImpl) Write(snapshots map[string]*api.Snapshot) error

Write converts the map(key:symbol, value:snapshot) to a ColumnSeriesMap and write it to the local marketstore server.

Jump to

Keyboard shortcuts

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