database

package
v0.3.3 Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2021 License: GPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DateFormat string = "20060102"
)
View Source
const (
	GetLatestRedditMaxLookback = 10
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Connection

type Connection struct {
	// contains filtered or unexported fields
}
var SharedConnection Connection

func Connect

func Connect(input ConnectionInput) (conn Connection, err error)

func (*Connection) GetEtlResultsRecord

func (c *Connection) GetEtlResultsRecord(input EtlResultsQueryInput) (record []EtlResultsRecord, err error)

func (*Connection) GetLatestEtlResultsRecord

func (c *Connection) GetLatestEtlResultsRecord(input EtlResultsQueryInput) (record EtlResultsRecord, err error)

func (*Connection) GetRedditPostArchiveRecord

func (c *Connection) GetRedditPostArchiveRecord(input RedditPostArchiveQueryInput) (record RedditPostArchiveRecord, err error)

func (*Connection) ListRedditPostArchiveRecord

func (c *Connection) ListRedditPostArchiveRecord(input RedditPostArchiveListInput) (keys []string, err error)

func (*Connection) PutEtlResultsRecord

func (c *Connection) PutEtlResultsRecord(record EtlResultsRecord) (err error)

func (*Connection) PutRedditPostArchiveRecord

func (c *Connection) PutRedditPostArchiveRecord(record RedditPostArchiveRecord) (err error)

type ConnectionInput

type ConnectionInput struct {
	Session *session.Session

	// All the fields below are currently ignored
	EtlResultsTable        string
	YahooTrendingTable     string
	RedditPostArchiveTable string
	UserTable              string
}

type EtlResultsQueryInput

type EtlResultsQueryInput struct {
	Subreddit string
	Date      time.Time
}

type EtlResultsRecord

type EtlResultsRecord struct {
	Id   string               `json:"id"`
	Hour int                  `json:"hour"`
	Data []report.StockReport `json:"data"`
}

func NewEtlResultsRecord

func NewEtlResultsRecord(sr []report.StockReport, sub string, t time.Time) (e EtlResultsRecord)

type RedditPostArchiveListInput

type RedditPostArchiveListInput struct {
	Subreddit string
	Date      time.Time
}

type RedditPostArchiveQueryInput

type RedditPostArchiveQueryInput struct {
	Key string
}

type RedditPostArchiveRecord

type RedditPostArchiveRecord struct {
	Key       string      `json:"key"`
	Hour      int         `json:"hour"`
	Permalink string      `json:"permalink,omitempty"`
	Post      reddit.Post `json:"data"`
}

func NewRedditPostArchiveRecord

func NewRedditPostArchiveRecord(p reddit.Post, sub string, t time.Time) (r RedditPostArchiveRecord)

Jump to

Keyboard shortcuts

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