sslr

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2020 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	SourceConnection     string   `json:"source"`
	TargetConnection     string   `json:"target"`
	SourceTables         []string `json:"tables"`
	FilteredSourceTables map[string]struct {
		Where  string   `json:"where"`
		Wheres []string `json:"wheres"`
		Uses   []string `json:"uses"`
	} `json:"filteredTables"`
	UpdateChunkSize      uint32        `json:"updateChunkSize"`
	DeleteChunkSize      uint32        `json:"deleteChunkSize"`
	MinDeleteChunkSize   uint32        `json:"minDeleteChunkSize"`
	ThrottlePercentage   float64       `json:"throttlePercentage"`
	StateTableName       string        `json:"stateTable"`
	SyncUpdates          bool          `json:"syncUpdates"`
	SyncDeletes          bool          `json:"syncDeletes"`
	ResyncOnSchemaChange bool          `json:"resyncOnSchemaChange"`
	FullCopyThreshold    float64       `json:"fullCopyThreshold"`
	WaitBetweenJobs      time.Duration `json:"waitBetweenJobs"`
}

Config is the main configuration for SSLR

func LoadConfig

func LoadConfig(fileName string) (Config, error)

LoadConfig reads a JSON - formatted config file into a Config. The loaded JSON is validated against the expected fields.

type Job

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

Job represents an active sync job

func NewJob

func NewJob(ctx context.Context, config Config) (*Job, error)

NewJob creates a new job from a config

func (*Job) Run

func (job *Job) Run() error

Run performs a full sync operation according to the job's configuration

type PrimaryKey added in v1.1.0

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

PrimaryKey wraps integer and string valued keys

func (*PrimaryKey) Scan added in v1.1.0

func (pk *PrimaryKey) Scan(value interface{}) error

Scan implements Scanner interface

func (PrimaryKey) String added in v1.1.0

func (pk PrimaryKey) String() string

func (*PrimaryKey) Value added in v1.1.0

func (pk *PrimaryKey) Value() (driver.Value, error)

Value implements Valuer interface

type PrimaryKeySet added in v1.1.0

type PrimaryKeySet []PrimaryKey

PrimaryKeySet is a list of primary key values for a single row

func (PrimaryKeySet) Equals added in v1.1.0

func (pks PrimaryKeySet) Equals(other PrimaryKeySet) bool

Equals compares two keysets

type PrimaryKeySetSlice added in v1.1.0

type PrimaryKeySetSlice []PrimaryKeySet

PrimaryKeySetSlice wraps a slice of PrimaryKeySet for easy conversion

func (PrimaryKeySetSlice) Transposed added in v1.1.0

func (rows PrimaryKeySetSlice) Transposed() []interface{}

Transposed converts a slice of PrimaryKey slices to a slice of string slices. Or - converts N rows of M primary key values into M columns of N single-valued key values. The result is returned as a []interface{} for easy inclusion in queries.

type ValidationStatus added in v1.1.0

type ValidationStatus int

ValidationStatus is used to track current table validation status

Jump to

Keyboard shortcuts

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