database

package
v2026.1201.0 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 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)

func WriteFilePosition added in v2026.1201.0

func WriteFilePosition(ctx context.Context, home, projectID, path, view string, position FilePosition) error

func WriteFolderState added in v2026.1201.0

func WriteFolderState(ctx context.Context, home, projectID, panel string, state FolderState) error

func WritePDFPreferences added in v2026.1201.0

func WritePDFPreferences(ctx context.Context, home, projectID string, prefs PDFPreferences) error

Types

type FilePosition added in v2026.1201.0

type FilePosition struct {
	Top          float64  `json:"top"`
	Left         float64  `json:"left"`
	Anchor       int      `json:"anchor"`
	Head         int      `json:"head"`
	ScrollAnchor *int     `json:"scrollAnchor,omitempty"`
	ScrollOffset *float64 `json:"scrollOffset,omitempty"`
	Page         int      `json:"page,omitempty"`
	Layout       string   `json:"layout,omitempty"`
}

func ReadFilePosition added in v2026.1201.0

func ReadFilePosition(ctx context.Context, home, projectID, path, view string) (*FilePosition, error)

type FolderState added in v2026.1201.0

type FolderState struct {
	Expanded      []string `json:"expanded"`
	RootCollapsed bool     `json:"rootCollapsed"`
}

func ReadFolderState added in v2026.1201.0

func ReadFolderState(ctx context.Context, home, projectID, panel string) (*FolderState, error)

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
}

type PDFPreferences added in v2026.1201.0

type PDFPreferences struct {
	Continuous bool    `json:"continuous"`
	Direction  string  `json:"direction"`
	TwoPages   bool    `json:"twoPages"`
	Zoom       float64 `json:"zoom"`
	FitMode    *string `json:"fitMode"`
}

func ReadPDFPreferences added in v2026.1201.0

func ReadPDFPreferences(ctx context.Context, home, projectID string) (*PDFPreferences, error)

Jump to

Keyboard shortcuts

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