sqlite

package
v2.0.0-...-cdd4e73 Latest Latest
Warning

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

Go to latest
Published: May 1, 2024 License: AGPL-3.0-or-later Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Store

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

func New

func New(path string, optimizeForLitestream bool) Store

func NewWithChunkSize

func NewWithChunkSize(path string, chunkSize int, optimizeForLitestream bool) Store

NewWithChunkSize creates a SQLite-based datastore with the user-specified chunk size for writing files. Most callers should just use New().

func (Store) DeleteEntry

func (s Store) DeleteEntry(id picoshare.EntryID) error
func (s Store) DeleteGuestLink(id picoshare.GuestLinkID) error

func (Store) GetEntriesMetadata

func (s Store) GetEntriesMetadata() ([]picoshare.UploadMetadata, error)

func (Store) GetEntry

func (s Store) GetEntry(id picoshare.EntryID) (picoshare.UploadEntry, error)

func (Store) GetEntryDownloads

func (s Store) GetEntryDownloads(id picoshare.EntryID) ([]picoshare.DownloadRecord, error)

func (Store) GetEntryMetadata

func (s Store) GetEntryMetadata(id picoshare.EntryID) (picoshare.UploadMetadata, error)
func (s Store) GetGuestLink(id picoshare.GuestLinkID) (picoshare.GuestLink, error)
func (s Store) GetGuestLinks() ([]picoshare.GuestLink, error)

func (Store) InsertEntry

func (s Store) InsertEntry(reader io.Reader, metadata picoshare.UploadMetadata) error

func (Store) InsertEntryDownload

func (s Store) InsertEntryDownload(id picoshare.EntryID, r picoshare.DownloadRecord) error
func (s *Store) InsertGuestLink(guestLink picoshare.GuestLink) error

func (Store) Purge

func (s Store) Purge() error

Purge deletes expired entries and clears orphaned rows from the database.

func (Store) ReadSettings

func (s Store) ReadSettings() (picoshare.Settings, error)

func (Store) UpdateEntryMetadata

func (s Store) UpdateEntryMetadata(id picoshare.EntryID, metadata picoshare.UploadMetadata) error

func (Store) UpdateSettings

func (s Store) UpdateSettings(settings picoshare.Settings) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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