storage

package
v0.0.0-...-aa2490a Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2025 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Combined

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

Combined combines transfers from two storages Originally we had our own storage implementation in JSON file. Later libDrop introduced an integrated storage solution, so we migrated to that. But to not lose transfer history when updating the app, we still load transfers from the original file storage.

func NewCombined

func NewCombined(storagePath string, storage fileshare.Storage) *Combined

func (*Combined) Load

func (c *Combined) Load() (map[string]*pb.Transfer, error)

func (*Combined) PurgeTransfersUntil

func (c *Combined) PurgeTransfersUntil(until time.Time) error

type JsonFile

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

JsonFile is a implementation of user's fileshare history storage.

func NewJsonFile

func NewJsonFile(storagePath string) JsonFile

func (JsonFile) Load

func (jf JsonFile) Load() (map[string]*pb.Transfer, error)

Load user's history

func (JsonFile) PurgeTransfersUntil

func (jf JsonFile) PurgeTransfersUntil(until time.Time) error

type Libdrop

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

func NewLibdrop

func NewLibdrop(storage fileshare.Storage) *Libdrop

func (*Libdrop) Load

func (l *Libdrop) Load() (map[string]*pb.Transfer, error)

func (*Libdrop) PurgeTransfersUntil

func (l *Libdrop) PurgeTransfersUntil(until time.Time) error

Jump to

Keyboard shortcuts

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