sqlite

package
v0.0.0-...-a024992 Latest Latest
Warning

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

Go to latest
Published: May 5, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Repository

type Repository struct {
	// contains filtered or unexported fields
}

Repository implements logbuf.Repository

func NewRepository

func NewRepository(db *sql.DB) Repository

func (Repository) DeleteTraces

func (r Repository) DeleteTraces(ctx context.Context, threshold time.Duration) (pruned []trace.TraceID, err error)

DeleteTraces removes all trace.TraceID from the database that are older than the threshold time.Duration (which is calculated from the current time minus this value). It returns a slice of trace.TraceID with all values that are were removed and an error if raised.

func (Repository) InsertTrace

func (r Repository) InsertTrace(ctx context.Context, traceID trace.TraceID) (err error)

InsertTrace adds the input trace.TraceID to the database if it does not yet exist, alongside with the current timestamp (of when it is registered). Returns an error if raised.

func (Repository) Shutdown

func (r Repository) Shutdown(_ context.Context) error

Shutdown gracefully stops the Repository's underlying sql.DB

Jump to

Keyboard shortcuts

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