Documentation ¶
Overview ¶
Package specs specs for source and destination plugins including parsers and readers.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var AllBackendNames = [...]string{ BackendNone: "none", BackendLocal: "local", }
View Source
var AllBackends = Backends{BackendNone, BackendLocal}
View Source
var AllSchedulerNames = [...]string{ SchedulerDFS: "dfs", SchedulerRoundRobin: "round-robin", }
View Source
var AllSchedulers = Schedulers{SchedulerDFS, SchedulerRoundRobin}
Functions ¶
func SpecUnmarshalYamlStrict ¶ added in v0.0.4
func UnmarshalJSONStrict ¶ added in v0.5.0
Types ¶
type Backend ¶ added in v1.24.0
type Backend int
func BackendFromString ¶ added in v1.24.0
func (Backend) MarshalJSON ¶ added in v1.24.0
func (*Backend) UnmarshalJSON ¶ added in v1.24.0
type Destination ¶ added in v0.0.4
type Destination struct { Name string `json:"name,omitempty"` Version string `json:"version,omitempty"` Path string `json:"path,omitempty"` Registry Registry `json:"registry,omitempty"` WriteMode WriteMode `json:"write_mode,omitempty"` MigrateMode MigrateMode `json:"migrate_mode,omitempty"` BatchSize int `json:"batch_size,omitempty"` BatchSizeBytes int `json:"batch_size_bytes,omitempty"` Spec any `json:"spec,omitempty"` PKMode PKMode `json:"pk_mode,omitempty"` }
func (*Destination) SetDefaults ¶ added in v0.0.4
func (d *Destination) SetDefaults(defaultBatchSize, defaultBatchSizeBytes int)
func (*Destination) UnmarshalSpec ¶ added in v0.0.4
func (d *Destination) UnmarshalSpec(out any) error
func (*Destination) Validate ¶ added in v0.9.2
func (d *Destination) Validate() error
func (Destination) VersionString ¶ added in v1.27.0
func (d Destination) VersionString() string
type Kind ¶ added in v0.0.4
type Kind int
func KindFromString ¶ added in v0.0.4
func (Kind) MarshalJSON ¶ added in v0.0.4
func (*Kind) UnmarshalJSON ¶ added in v0.0.4
type MigrateMode ¶ added in v1.26.0
type MigrateMode int
const ( MigrateModeSafe MigrateMode = iota MigrateModeForced )
func MigrateModeFromString ¶ added in v1.26.0
func MigrateModeFromString(s string) (MigrateMode, error)
func (MigrateMode) MarshalJSON ¶ added in v1.26.0
func (m MigrateMode) MarshalJSON() ([]byte, error)
func (MigrateMode) String ¶ added in v1.26.0
func (m MigrateMode) String() string
func (*MigrateMode) UnmarshalJSON ¶ added in v1.26.0
func (m *MigrateMode) UnmarshalJSON(data []byte) (err error)
type PKMode ¶ added in v1.44.0
type PKMode int
func PKModeFromString ¶ added in v1.44.0
func (PKMode) MarshalJSON ¶ added in v1.44.0
func (*PKMode) UnmarshalJSON ¶ added in v1.44.0
type Registry ¶ added in v0.0.4
type Registry int
func RegistryFromString ¶ added in v0.0.4
func (Registry) MarshalJSON ¶ added in v0.0.4
func (*Registry) UnmarshalJSON ¶ added in v0.0.4
type Scheduler ¶ added in v1.19.0
type Scheduler int
func SchedulerFromString ¶ added in v1.19.0
func (Scheduler) MarshalJSON ¶ added in v1.19.0
func (*Scheduler) UnmarshalJSON ¶ added in v1.19.0
type Schedulers ¶ added in v1.19.0
type Schedulers []Scheduler
func (Schedulers) String ¶ added in v1.19.0
func (s Schedulers) String() string
type Source ¶ added in v0.0.4
type Source struct { // Name of the source plugin to use Name string `json:"name,omitempty"` // Version of the source plugin to use Version string `json:"version,omitempty"` // Path is the canonical path to the source plugin in a given registry // For example: // in github the path will be: org/repo // For the local registry the path will be the path to the binary: ./path/to/binary // For the gRPC registry the path will be the address of the gRPC server: host:port Path string `json:"path,omitempty"` // Registry can be github,local,grpc. Registry Registry `json:"registry,omitempty"` Concurrency uint64 `json:"concurrency,omitempty"` TableConcurrency uint64 `json:"table_concurrency,omitempty"` // deprecated: use Concurrency instead ResourceConcurrency uint64 `json:"resource_concurrency,omitempty"` // deprecated: use Concurrency instead // Tables to sync from the source plugin Tables []string `json:"tables,omitempty"` // SkipTables defines tables to skip when syncing data. Useful if a glob pattern is used in Tables SkipTables []string `json:"skip_tables,omitempty"` // SkipDependentTables changes the matching behavior with regard to dependent tables. If set to true, dependent tables will not be synced unless they are explicitly matched by Tables. SkipDependentTables bool `json:"skip_dependent_tables,omitempty"` // Destinations are the names of destination plugins to send sync data to Destinations []string `json:"destinations,omitempty"` // Backend is the name of the state backend to use Backend Backend `json:"backend,omitempty"` // BackendSpec contains any backend-specific configuration BackendSpec any `json:"backend_spec,omitempty"` // Scheduler defines the scheduling algorithm that should be used to sync data Scheduler Scheduler `json:"scheduler,omitempty"` // Spec defines plugin specific configuration // This is different in every source plugin. Spec any `json:"spec,omitempty"` // DeterministicCQID is a flag that indicates whether the source plugin should generate a random UUID as the value of _cq_id // or whether it should calculate a UUID that is a hash of the primary keys (if they exist) or the entire resource. DeterministicCQID bool `json:"deterministic_cq_id,omitempty"` }
Source is the spec for a source plugin
func (*Source) SetDefaults ¶ added in v0.0.4
func (s *Source) SetDefaults()
func (*Source) UnmarshalBackendSpec ¶ added in v1.24.0
UnmarshalBackendSpec unmarshals the backend spec into the given interface
func (*Source) UnmarshalSpec ¶ added in v0.0.4
UnmarshalSpec unmarshals the internal spec into the given interface
func (Source) VersionString ¶ added in v1.27.0
type Spec ¶
func (*Spec) UnmarshalJSON ¶ added in v0.0.4
type SpecReader ¶
type SpecReader struct { Sources []*Source Destinations []*Destination // contains filtered or unexported fields }
func NewSpecReader ¶
func NewSpecReader(paths []string) (*SpecReader, error)
func (*SpecReader) GetDestinationByName ¶ added in v0.2.3
func (r *SpecReader) GetDestinationByName(name string) *Destination
func (*SpecReader) GetSourceByName ¶
func (r *SpecReader) GetSourceByName(name string) *Source
type WriteMode ¶ added in v0.0.4
type WriteMode int
func WriteModeFromString ¶ added in v0.0.4
func (WriteMode) MarshalJSON ¶ added in v0.0.4
func (*WriteMode) UnmarshalJSON ¶ added in v0.0.4
Click to show internal directories.
Click to hide internal directories.