Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Reflector ¶
type Reflector struct {
// contains filtered or unexported fields
}
Reflector represents a fully materialized reflector, which polls an upstream database's ledger table for DML statements and applies them to a local SQLite database (LDB).
func ReflectorFromConfig ¶
func ReflectorFromConfig(config ReflectorConfig) (*Reflector, error)
ReflectorFromConfig instantiates a Reflector instance using the configuration specified by a ReflectorConfig instance
type ReflectorConfig ¶
type ReflectorConfig struct {
LDBPath string
ChangelogPath string
ChangelogSize int
Upstream UpstreamConfig
BootstrapURL string
LedgerHealth ledger.HealthConfig
IsSupervisor bool
LDBWriteCallback ldbwriter.LDBWriteCallback // optional
BootstrapRegion string // optional
}
ReflectorConfig is used to configure a Reflector instance that is instantiated by ReflectorFromConfig
func (ReflectorConfig) Printable ¶
func (c ReflectorConfig) Printable() string
Printable returns a "pretty" stringified version of the config
type ReflectorCtl ¶
type ReflectorCtl struct {
// contains filtered or unexported fields
}
reflectorCtl controls starting and stopping the reflector for the purposes of a supervisor being able to perform a snapshot of the ldb without the reflector running concurrently. When the snapshot must be made, it will stop the reflector, perform the snapshot, and then start the reflector again.
func NewReflectorCtl ¶
func NewReflectorCtl(reflector ReflectorI) *ReflectorCtl
func (*ReflectorCtl) Close ¶
func (r *ReflectorCtl) Close() error
func (*ReflectorCtl) Start ¶
func (r *ReflectorCtl) Start(ctx context.Context)
Start sends a start msg to the lifecycle goroutine. The lifecycle goroutine manages the state machine of the reflector. Since the lifecycle is a single goroutine it is last-write-wins.
func (*ReflectorCtl) Stop ¶
func (r *ReflectorCtl) Stop(ctx context.Context)
Stop sends a start msg to the lifecycle goroutine. The lifecycle goroutine manages the state machine of the reflector. Since the lifecycle is a single goroutine it is last-write-wins.
type S3Downloader ¶
type S3Downloader struct {
Region string // optional
Bucket string
Key string
S3Client S3Client
StartOverOnNotFound bool // whether or not we should rebuild LDB if snapshot not found
}
func (*S3Downloader) DownloadTo ¶
func (d *S3Downloader) DownloadTo(w io.Writer) (n int64, err error)