Documentation ¶
Index ¶
- Constants
- Variables
- func BuildTable(of []OutputFormat) (string, error)
- func FormatDurationToTimeString(duration time.Duration) string
- func MatchesFileConvention(fileName string) bool
- func MatchesFilter(n dbtable.Name, schemaRe, tableRe *regexp.Regexp) bool
- func MaybeFormatCDCCursor(testOnly bool, s string) string
- func MaybeFormatDurationForTest(testOnly bool, duration time.Duration) time.Duration
- func MaybeFormatFetchID(testOnly bool, s string) string
- func MaybeFormatID(testOnly bool, s uuid.UUID) uuid.UUID
- func PrettyJSON(v any) string
- func SanitizeExternalStorageURI(path string, extraParams []string) (string, error)
- func SchemaTableString(schema, table tree.Name) string
- type ExtraneousTable
- type FilterConfig
- type FilterString
- type MissingTable
- type OutputFormat
- type Result
Constants ¶
const ( AWSSecretAccessKey = "AWS_SECRET_ACCESS_KEY" GCPCredentials = "CREDENTIALS" )
const DefaultFilterString = ".*"
Variables ¶
var FileConventionRegex = regexp.MustCompile(`part_[\d+]{8}(\.csv|\.tar\.gz)`)
var RedactedQueryParams = map[string]struct{}{}
redactedQueryParams is the set of query parameter names registered by the external storage providers that should be redacted from external storage URIs whenever they are displayed to a user.
Functions ¶
func BuildTable ¶
func BuildTable(of []OutputFormat) (string, error)
BuildTable builds the table from the table header and structured table data and returns a string that can be outputted to the command or stdout.
func MatchesFileConvention ¶
func MaybeFormatCDCCursor ¶
MaybeFormatCDCCursor is to make a deterministic CDC cursor for test.
func MaybeFormatDurationForTest ¶
MaybeFormatDurationForTest is to make a deterministic duration for test.
func MaybeFormatFetchID ¶
MaybeFormatFetchID is to make a deterministic fetch id for test.
func MaybeFormatID ¶
MaybeFormatID is to make a deterministic UUID for test.
func PrettyJSON ¶
func SanitizeExternalStorageURI ¶
SanitizeExternalStorageURI returns the external storage URI with with some secrets redacted, for use when showing these URIs in the UI, to provide some protection from shoulder-surfing. The param is still present -- just redacted -- to make it clearer that that value is indeed persisted interally. extraParams which should be scrubbed -- for params beyond those that the various cloud-storage URIs supported by this package know about -- can be passed allowing this function to be used to scrub other URIs too.
func SchemaTableString ¶
Types ¶
type ExtraneousTable ¶
ExtraneousTable represents a table that is extraneous to a database.
type FilterConfig ¶
type FilterConfig struct { SchemaFilter FilterString TableFilter FilterString }
func DefaultFilterConfig ¶
func DefaultFilterConfig() FilterConfig
type FilterString ¶
type FilterString = string
type MissingTable ¶
MissingTable represents a table that is missing from a database.
type OutputFormat ¶
type Result ¶
type Result struct { Verified [][2]dbtable.DBTable MissingTables []MissingTable ExtraneousTables []ExtraneousTable }
func FilterResult ¶
func FilterResult(cfg FilterConfig, r Result) (Result, error)