check

package
v0.1.0-prerelease Latest Latest
Warning

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

Go to latest
Published: May 24, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Overview

Package check provides various configuration and health checks that can be run against a sql.DB connection.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RunChecks

func RunChecks(ctx context.Context, r Resources, logger loggers.Advanced, scope ScopeFlag) error

RunChecks runs all checks that are registered for the given scope

Types

type Resources

type Resources struct {
	DB              *sql.DB
	Replica         *sql.DB
	Table           *table.TableInfo
	Alter           string
	TargetChunkTime time.Duration
	Threads         int
	ReplicaMaxLag   time.Duration
	// The following resources are only used by the
	// pre-run checks
	Host     string
	Username string
	Password string
}

type ScopeFlag

type ScopeFlag uint8

ScopeFlag scopes a check

const (
	ScopeNone        ScopeFlag = 0
	ScopePreRun      ScopeFlag = 1 << 0
	ScopePreflight   ScopeFlag = 1 << 1
	ScopePostSetup   ScopeFlag = 1 << 2
	ScopeCutover     ScopeFlag = 1 << 3
	ScopePostCutover ScopeFlag = 1 << 4
	ScopeTesting     ScopeFlag = 1 << 5
)

Jump to

Keyboard shortcuts

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