archive

package
v0.0.0-...-b1f2762 Latest Latest
Warning

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

Go to latest
Published: Jan 5, 2023 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrDuplicate = errors.New("record already exists")
)

Functions

func CreateDB

func CreateDB(filename string) (pool *sqlitex.Pool, err error)

Types

type Archive

type Archive interface {
	Migrate(archive *sqlitex.Pool) error
	IsLoaded(archive *sqlitex.Pool, key string) (ok bool, err error)
	SetLoaded(archive *sqlitex.Pool, key string, status bool) error
	Create(archive *sqlitex.Pool, key string, status bool, archiveItem model.ArchiveItem) error
}

type ArchiveEntryStatus

type ArchiveEntryStatus int
const (
	Unknown ArchiveEntryStatus = iota
	NotExists
	NotLoaded
	Loaded
)

type ArchiveRepo

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

func NewRepo

func NewRepo(pool *sqlitex.Pool) (archive *ArchiveRepo, err error)

func (*ArchiveRepo) Create

func (r *ArchiveRepo) Create(key string, status ArchiveEntryStatus, archiveItem model.ArchiveItem) (err error)

func (*ArchiveRepo) IsLoaded

func (r *ArchiveRepo) IsLoaded(key string) (status ArchiveEntryStatus, err error)

func (*ArchiveRepo) Migrate

func (r *ArchiveRepo) Migrate() (err error)

func (*ArchiveRepo) SetStatus

func (r *ArchiveRepo) SetStatus(key string, status ArchiveEntryStatus) (err error)

type HistoryItem

type HistoryItem struct {
	Url string `json:"string"`
}

type Interface

type Interface interface {
	Migrate() error
	IsLoaded(key string) (status ArchiveEntryStatus, err error)
	Create(key string, status ArchiveEntryStatus, archiveItem model.ArchiveItem) (err error)
	SetStatus(key string, status ArchiveEntryStatus) (err error)
}

Jump to

Keyboard shortcuts

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