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 ¶
func UnmarshalJSONStrict ¶
Types ¶
type Backend ¶
type Backend int
func BackendFromString ¶
func (Backend) MarshalJSON ¶
func (*Backend) UnmarshalJSON ¶
type Destination ¶
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 ¶
func (d *Destination) SetDefaults(defaultBatchSize, defaultBatchSizeBytes int)
func (*Destination) UnmarshalSpec ¶
func (d *Destination) UnmarshalSpec(out any) error
func (*Destination) Validate ¶
func (d *Destination) Validate() error
func (Destination) VersionString ¶
func (d Destination) VersionString() string
type Kind ¶
type Kind int
func KindFromString ¶
func (Kind) MarshalJSON ¶
func (*Kind) UnmarshalJSON ¶
type MigrateMode ¶
type MigrateMode int
const ( MigrateModeSafe MigrateMode = iota MigrateModeForced )
func MigrateModeFromString ¶
func MigrateModeFromString(s string) (MigrateMode, error)
func (MigrateMode) MarshalJSON ¶
func (m MigrateMode) MarshalJSON() ([]byte, error)
func (MigrateMode) String ¶
func (m MigrateMode) String() string
func (*MigrateMode) UnmarshalJSON ¶
func (m *MigrateMode) UnmarshalJSON(data []byte) (err error)
type PKMode ¶
type PKMode int
func PKModeFromString ¶
func (PKMode) MarshalJSON ¶
func (*PKMode) UnmarshalJSON ¶
type Registry ¶
type Registry int
func RegistryFromString ¶
func (Registry) MarshalJSON ¶
func (*Registry) UnmarshalJSON ¶
type Scheduler ¶
type Scheduler int
func SchedulerFromString ¶
func (Scheduler) MarshalJSON ¶
func (*Scheduler) UnmarshalJSON ¶
type Schedulers ¶
type Schedulers []Scheduler
func (Schedulers) String ¶
func (s Schedulers) String() string
type Source ¶
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 ¶
func (s *Source) SetDefaults()
func (*Source) UnmarshalBackendSpec ¶
UnmarshalBackendSpec unmarshals the backend spec into the given interface
func (*Source) UnmarshalSpec ¶
UnmarshalSpec unmarshals the internal spec into the given interface
func (Source) VersionString ¶
type Spec ¶
func (*Spec) UnmarshalJSON ¶
type WriteMode ¶
type WriteMode int
func WriteModeFromString ¶
func (WriteMode) MarshalJSON ¶
func (*WriteMode) UnmarshalJSON ¶
Click to show internal directories.
Click to hide internal directories.