database

package
v2026.1121.0 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2026 License: MIT Imports: 17 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AcquireMaintenance

func AcquireMaintenance(ctx context.Context, home string) (func() error, error)

func AppendLog

func AppendLog(ctx context.Context, db *sql.DB, event LogEvent) (string, error)

func Backup

func Backup(ctx context.Context, db *sql.DB, destination string) (err error)

func BackupExisting

func BackupExisting(ctx context.Context, source, destination string) error

func CaptureText

func CaptureText(ctx context.Context, db *sql.DB, path string) ([]byte, error)

func CollectArtifacts

func CollectArtifacts(ctx context.Context, home string) (int, error)

func HasText

func HasText(ctx context.Context, db *sql.DB, path string) (bool, error)

func Open

func Open(ctx context.Context, home string, kind Kind) (*sql.DB, error)

func OpenReadOnly

func OpenReadOnly(ctx context.Context, path string) (*sql.DB, error)

func Path

func Path(home string, kind Kind) (string, error)

func ReadArtifact

func ReadArtifact(home, id string) ([]byte, error)

func ReleaseDataPool

func ReleaseDataPool(home string) error

func RestoreBackup

func RestoreBackup(ctx context.Context, destination, source string) error

func RestoreText

func RestoreText(ctx context.Context, db *sql.DB, path string) error

func RunArtifactCollection

func RunArtifactCollection(ctx context.Context, home string)

func StoreArtifact

func StoreArtifact(home string, content []byte) (string, error)

Types

type Kind

type Kind string
const (
	Data Kind = "data"
	Logs Kind = "logs"
)

type Lease

type Lease struct {
	*sql.DB
	// contains filtered or unexported fields
}

func BorrowData

func BorrowData(ctx context.Context, home string) (*Lease, error)

func (*Lease) Close

func (lease *Lease) Close() error

type LogEvent

type LogEvent struct {
	Time           time.Time
	Source         string
	Level          string
	Message        string
	CorrelationKey string
}

Jump to

Keyboard shortcuts

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