snapshot

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2026 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	StatusRequested  = Status("requested")
	StatusInProgress = Status("in progress")
	StatusCompleted  = Status("completed")
)
View Source
const (
	RequestModeData       = RequestMode("data")
	RequestModeSchemaOnly = RequestMode("schema-only")
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Errors

type Errors map[string]*SchemaErrors

func NewErrors

func NewErrors(schema string, err error) Errors

func (Errors) AddError added in v0.6.6

func (e Errors) AddError(schema string, err error)

func (Errors) Error

func (e Errors) Error() string

func (Errors) GetSchemaErrors added in v0.6.6

func (e Errors) GetSchemaErrors(schema string) *SchemaErrors

type Request

type Request struct {
	Schema string
	Tables []string
	Status Status
	Mode   RequestMode
	Errors *SchemaErrors
}

func (*Request) GetMode added in v1.2.0

func (r *Request) GetMode() RequestMode

GetMode returns the request mode, defaulting to data mode for requests recorded before the mode was tracked.

func (*Request) HasFailed

func (r *Request) HasFailed() bool

func (*Request) HasFailedForTable

func (r *Request) HasFailedForTable(table string) bool

func (*Request) IsPending

func (r *Request) IsPending() bool

func (*Request) MarkCompleted

func (r *Request) MarkCompleted(schema string, err error)

func (*Request) MarkInProgress

func (r *Request) MarkInProgress()

type RequestMode added in v1.2.0

type RequestMode string

RequestMode captures what a snapshot request replicated to the target: schema and data (data mode), or schema only.

type SchemaErrors added in v0.6.6

type SchemaErrors struct {
	Schema       string            `json:"schema,omitempty"`
	GlobalErrors []string          `json:"snapshot,omitempty"`
	TableErrors  map[string]string `json:"tables,omitempty"`
}

func NewSchemaErrors added in v0.6.6

func NewSchemaErrors(schema string, err error) *SchemaErrors

func (*SchemaErrors) AddGlobalError added in v0.6.6

func (e *SchemaErrors) AddGlobalError(err error)

func (*SchemaErrors) AddTableError added in v0.6.6

func (e *SchemaErrors) AddTableError(table string, err error)

func (*SchemaErrors) Error added in v0.6.6

func (e *SchemaErrors) Error() string

func (*SchemaErrors) GetFailedTables added in v0.6.6

func (e *SchemaErrors) GetFailedTables() []string

func (*SchemaErrors) IsGlobalError added in v0.6.6

func (e *SchemaErrors) IsGlobalError() bool

func (*SchemaErrors) IsTableError added in v0.6.6

func (e *SchemaErrors) IsTableError(table string) bool

type Snapshot

type Snapshot struct {
	SchemaTables         map[string][]string
	SchemaExcludedTables map[string][]string
	// SchemaOnlyTables are part of the schema snapshot scope, but their data
	// is not copied. SchemaTables entries listed by exact name (no wildcards)
	// take precedence over a schema-only wildcard match, and
	// SchemaExcludedTables take precedence over the schema-only list.
	SchemaOnlyTables map[string][]string
}

func (*Snapshot) GetSchemas added in v0.6.6

func (s *Snapshot) GetSchemas() []string

func (*Snapshot) GetTables added in v0.6.6

func (s *Snapshot) GetTables() []string

func (*Snapshot) HasSchemaOnlyTables added in v1.2.0

func (s *Snapshot) HasSchemaOnlyTables() bool

func (*Snapshot) HasTables added in v0.6.6

func (s *Snapshot) HasTables() bool

type Status

type Status string

Jump to

Keyboard shortcuts

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