{"modulePath":"github.com/cloudquery/plugin-sdk/v2","version":"v2.5.4","isLatest":false,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package specs\n\nPackage specs specs for source and destination plugins including parsers and readers.\n\n## Variables\n\n```go\nvar AllBackendNames = [...]string{\n\tBackendNone:  \"none\",\n\tBackendLocal: \"local\",\n}\n```\n\n```go\nvar AllBackends = Backends{BackendNone, BackendLocal}\n```\n\n```go\nvar AllSchedulerNames = [...]string{\n\tSchedulerDFS:        \"dfs\",\n\tSchedulerRoundRobin: \"round-robin\",\n}\n```\n\n```go\nvar AllSchedulers = Schedulers{SchedulerDFS, SchedulerRoundRobin}\n```\n\n## Functions\n\n```go\nfunc SpecUnmarshalYamlStrict(b []byte, spec *Spec) error\n```\n\n```go\nfunc UnmarshalJSONStrict(b []byte, out any) error\n```\n\n## Types\n\n```go\ntype Backend int\n```\n\n```go\nconst (\n\tBackendNone Backend = iota\n\tBackendLocal\n)\n```\n\n```go\nfunc BackendFromString(s string) (Backend, error)\n```\n\n```go\nfunc (s Backend) MarshalJSON() ([]byte, error)\n```\n\n```go\nfunc (s Backend) String() string\n```\n\n```go\nfunc (s *Backend) UnmarshalJSON(data []byte) (err error)\n```\n\n```go\ntype Backends []Backend\n```\n\n```go\nfunc (s Backends) String() string\n```\n\n```go\ntype Destination struct {\n\tName           string      `json:\"name,omitempty\"`\n\tVersion        string      `json:\"version,omitempty\"`\n\tPath           string      `json:\"path,omitempty\"`\n\tRegistry       Registry    `json:\"registry,omitempty\"`\n\tWriteMode      WriteMode   `json:\"write_mode,omitempty\"`\n\tMigrateMode    MigrateMode `json:\"migrate_mode,omitempty\"`\n\tBatchSize      int         `json:\"batch_size,omitempty\"`\n\tBatchSizeBytes int         `json:\"batch_size_bytes,omitempty\"`\n\tSpec           any         `json:\"spec,omitempty\"`\n\tPKMode         PKMode      `json:\"pk_mode,omitempty\"`\n}\n```\n\n```go\nfunc (d *Destination) SetDefaults(defaultBatchSize, defaultBatchSizeBytes int)\n```\n\n```go\nfunc (d *Destination) UnmarshalSpec(out any) error\n```\n\n```go\nfunc (d *Destination) Validate() error\n```\n\n```go\nfunc (d Destination) VersionString() string\n```\n\n```go\ntype Kind int\n```\n\n```go\nconst (\n\tKindSource Kind = iota\n\tKindDestination\n)\n```\n\n```go\nfunc KindFromString(s string) (Kind, error)\n```\n\n```go\nfunc (k Kind) MarshalJSON() ([]byte, error)\n```\n\n```go\nfunc (k Kind) String() string\n```\n\n```go\nfunc (k *Kind) UnmarshalJSON(data []byte) (err error)\n```\n\n```go\ntype MigrateMode int\n```\n\n```go\nconst (\n\tMigrateModeSafe MigrateMode = iota\n\tMigrateModeForced\n)\n```\n\n```go\nfunc MigrateModeFromString(s string) (MigrateMode, error)\n```\n\n```go\nfunc (m MigrateMode) MarshalJSON() ([]byte, error)\n```\n\n```go\nfunc (m MigrateMode) String() string\n```\n\n```go\nfunc (m *MigrateMode) UnmarshalJSON(data []byte) (err error)\n```\n\n```go\ntype PKMode int\n```\n\n```go\nconst (\n\tPKModeDefaultKeys PKMode = iota\n\tPKModeCQID\n)\n```\n\n```go\nfunc PKModeFromString(s string) (PKMode, error)\n```\n\n```go\nfunc (m PKMode) MarshalJSON() ([]byte, error)\n```\n\n```go\nfunc (m PKMode) String() string\n```\n\n```go\nfunc (m *PKMode) UnmarshalJSON(data []byte) (err error)\n```\n\n```go\ntype Registry int\n```\n\n```go\nconst (\n\tRegistryGithub Registry = iota\n\tRegistryLocal\n\tRegistryGrpc\n)\n```\n\n```go\nfunc RegistryFromString(s string) (Registry, error)\n```\n\n```go\nfunc (r Registry) MarshalJSON() ([]byte, error)\n```\n\n```go\nfunc (r Registry) String() string\n```\n\n```go\nfunc (r *Registry) UnmarshalJSON(data []byte) (err error)\n```\n\n```go\ntype Scheduler int\n```\n\n```go\nconst (\n\tSchedulerDFS Scheduler = iota\n\tSchedulerRoundRobin\n)\n```\n\n```go\nfunc SchedulerFromString(s string) (Scheduler, error)\n```\n\n```go\nfunc (s Scheduler) MarshalJSON() ([]byte, error)\n```\n\n```go\nfunc (s Scheduler) String() string\n```\n\n```go\nfunc (s *Scheduler) UnmarshalJSON(data []byte) (err error)\n```\n\n```go\ntype Schedulers []Scheduler\n```\n\n```go\nfunc (s Schedulers) String() string\n```\n\n```go\ntype Source struct {\n\t// Name of the source plugin to use\n\tName string `json:\"name,omitempty\"`\n\t// Version of the source plugin to use\n\tVersion string `json:\"version,omitempty\"`\n\t// Path is the canonical path to the source plugin in a given registry\n\t// For example:\n\t// in github the path will be: org/repo\n\t// For the local registry the path will be the path to the binary: ./path/to/binary\n\t// For the gRPC registry the path will be the address of the gRPC server: host:port\n\tPath string `json:\"path,omitempty\"`\n\t// Registry can be github,local,grpc.\n\tRegistry            Registry `json:\"registry,omitempty\"`\n\tConcurrency         uint64   `json:\"concurrency,omitempty\"`\n\tTableConcurrency    uint64   `json:\"table_concurrency,omitempty\"`    // deprecated: use Concurrency instead\n\tResourceConcurrency uint64   `json:\"resource_concurrency,omitempty\"` // deprecated: use Concurrency instead\n\t// Tables to sync from the source plugin\n\tTables []string `json:\"tables,omitempty\"`\n\t// SkipTables defines tables to skip when syncing data. Useful if a glob pattern is used in Tables\n\tSkipTables []string `json:\"skip_tables,omitempty\"`\n\t// 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.\n\tSkipDependentTables bool `json:\"skip_dependent_tables,omitempty\"`\n\t// Destinations are the names of destination plugins to send sync data to\n\tDestinations []string `json:\"destinations,omitempty\"`\n\n\t// Backend is the name of the state backend to use\n\tBackend Backend `json:\"backend,omitempty\"`\n\t// BackendSpec contains any backend-specific configuration\n\tBackendSpec any `json:\"backend_spec,omitempty\"`\n\t// Scheduler defines the scheduling algorithm that should be used to sync data\n\tScheduler Scheduler `json:\"scheduler,omitempty\"`\n\t// Spec defines plugin specific configuration\n\t// This is different in every source plugin.\n\tSpec any `json:\"spec,omitempty\"`\n\n\t// DeterministicCQID is a flag that indicates whether the source plugin should generate a random UUID as the value of _cq_id\n\t// or whether it should calculate a UUID that is a hash of the primary keys (if they exist) or the entire resource.\n\tDeterministicCQID bool `json:\"deterministic_cq_id,omitempty\"`\n}\n```\nSource is the spec for a source plugin\n\n```go\nfunc (s *Source) SetDefaults()\n```\n\n```go\nfunc (s *Source) UnmarshalBackendSpec(out any) error\n```\nUnmarshalBackendSpec unmarshals the backend spec into the given interface\n\n```go\nfunc (s *Source) UnmarshalSpec(out any) error\n```\nUnmarshalSpec unmarshals the internal spec into the given interface\n\n```go\nfunc (s *Source) Validate() error\n```\n\n```go\nfunc (s Source) VersionString() string\n```\n\n```go\ntype Spec struct {\n\tKind Kind `json:\"kind\"`\n\tSpec any  `json:\"spec\"`\n}\n```\n\n```go\nfunc (s *Spec) UnmarshalJSON(data []byte) error\n```\n\n```go\ntype SpecReader struct {\n\tSources      []*Source\n\tDestinations []*Destination\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc NewSpecReader(paths []string) (*SpecReader, error)\n```\n\n```go\nfunc (r *SpecReader) GetDestinationByName(name string) *Destination\n```\n\n```go\nfunc (r *SpecReader) GetSourceByName(name string) *Source\n```\n\n```go\ntype WriteMode int\n```\n\n```go\nconst (\n\tWriteModeOverwriteDeleteStale WriteMode = iota\n\tWriteModeOverwrite\n\tWriteModeAppend\n)\n```\n\n```go\nfunc WriteModeFromString(s string) (WriteMode, error)\n```\n\n```go\nfunc (m WriteMode) MarshalJSON() ([]byte, error)\n```\n\n```go\nfunc (m WriteMode) String() string\n```\n\n```go\nfunc (m *WriteMode) UnmarshalJSON(data []byte) (err error)\n```\n\n","path":"github.com/cloudquery/plugin-sdk/v2/specs","name":"specs","synopsis":"Package specs specs for source and destination plugins including parsers and readers.","isRedistributable":true}
