Documentation ¶
Index ¶
- type Account
- type BasinProvider
- type BasinStreamer
- type BasinUploader
- type CacheDuration
- type Column
- type CreateVaultParams
- type DBManager
- func (dbm *DBManager) Close() error
- func (dbm *DBManager) Export(ctx context.Context, exportPath string) error
- func (dbm *DBManager) NewDB(ctx context.Context) error
- func (dbm *DBManager) Replay(ctx context.Context, tx *pgrepl.Tx) error
- func (dbm *DBManager) UploadAll(ctx context.Context) error
- func (dbm *DBManager) UploadAt(ctx context.Context, exportPath string) error
- type EventInfo
- type ListVaultEventsParams
- type ListVaultsParams
- type Replicator
- type Signer
- type Timestamp
- type Vault
- type WriteVaultEventParams
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Account ¶
type Account struct {
// contains filtered or unexported fields
}
Account represents an account.
func NewAccount ¶
NewAccount creates a new account.
type BasinProvider ¶
type BasinProvider interface { CreateVault(context.Context, CreateVaultParams) error ListVaults(context.Context, ListVaultsParams) ([]Vault, error) ListVaultEvents(context.Context, ListVaultEventsParams) ([]EventInfo, error) WriteVaultEvent(context.Context, WriteVaultEventParams) error }
BasinProvider ...
type BasinStreamer ¶
type BasinStreamer struct {
// contains filtered or unexported fields
}
BasinStreamer contains logic of streaming Postgres changes to Basin Provider.
func NewBasinStreamer ¶
func NewBasinStreamer(ns string, r Replicator, dbm *DBManager) *BasinStreamer
NewBasinStreamer creates new streamer.
type BasinUploader ¶
type BasinUploader struct {
// contains filtered or unexported fields
}
BasinUploader contains logic of uploading Parquet files to Basin Provider.
func NewBasinUploader ¶
func NewBasinUploader( ns string, rel string, bp BasinProvider, pk *ecdsa.PrivateKey, ) *BasinUploader
NewBasinUploader creates new uploader.
type CacheDuration ¶
type CacheDuration uint32
CacheDuration how long data stays in cache in minutes.
type CreateVaultParams ¶
type CreateVaultParams struct { Vault Vault Account *Account CacheDuration CacheDuration }
CreateVaultParams ...
type DBManager ¶
type DBManager struct {
// contains filtered or unexported fields
}
DBManager manages a duckdb database.
func NewDBManager ¶
func NewDBManager(dbDir, table string, cols []Column, winSize time.Duration, uploader *BasinUploader) *DBManager
NewDBManager creates a new DBManager.
func (*DBManager) Replay ¶
Replay replays a WAL record onto the current db. If the window has passed, it replaces the current db with a new one. The current db is exported and uploaded before new db is ready to be used.
type EventInfo ¶
type EventInfo struct { CID string `json:"cid"` Timestamp int64 `json:"timestamp"` Size uint32 `json:"size"` IsArchived bool `json:"is_archived"` CacheExpiry string `json:"cache_expiry"` }
EventInfo represents information about a deal.
type ListVaultEventsParams ¶
type ListVaultEventsParams struct { Vault Vault Limit uint32 Offset uint32 Before Timestamp After Timestamp }
ListVaultEventsParams ...
type Replicator ¶
type Replicator interface { StartReplication(ctx context.Context) (chan *pgrepl.Tx, string, error) Commit(ctx context.Context, lsn pglogrepl.LSN) error Shutdown() }
Replicator replicates Postgres txs into a channel.
type Signer ¶
type Signer struct {
// contains filtered or unexported fields
}
Signer allows you to sign a big stream of bytes by calling Sum multiple times, then Sign.
type Timestamp ¶
type Timestamp struct {
// contains filtered or unexported fields
}
Timestamp represents a time a file was uploaded.
func ParseTimestamp ¶
ParseTimestamp parses a string and returns a time.Time object as UTC. It accepts 3 kinds of formats: - Integers: that will be parsed as seconds - Date Only format (e.g. 2006-01-02) - RFC3339 (e.g. 2006-01-02T15:04:05Z07:00).