buckets

package
v0.12.2 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2021 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrCatalogNotExist      = errors.New("catalog does not exist")
	ErrCatalogEntryNotExist = errors.New("catalog entry does not exist")
	ErrSeriesNotExist       = errors.New("series does not exist")
)
View Source
var (
	ErrEntryNotExist           = errors.New("entry does not exist")
	ErrEntriesNotExist         = errors.New("entries do not exist")
	ErrEntryMetadataNotExist   = errors.New("entry metadata does not exist")
	ErrEntriesMetadataNotExist = errors.New("entries metadata does not exist")
)
View Source
var (
	ErrUserExists   = errors.New("user already exists")
	ErrUserNotExist = errors.New("user does not exist")
)
View Source
var ErrPageNotExist = errors.New("page does not exist")

Functions

This section is empty.

Types

type CatalogBucket

type CatalogBucket struct {
	*bolt.Bucket
}

func (*CatalogBucket) AddSeries

func (b *CatalogBucket) AddSeries(s *manga.ParsedSeries) error

func (*CatalogBucket) Catalog

func (b *CatalogBucket) Catalog() api.Catalog

func (*CatalogBucket) DeleteSeries

func (b *CatalogBucket) DeleteSeries(sid string) error

func (*CatalogBucket) Entry

func (b *CatalogBucket) Entry(sid, eid string) (*EntryBucket, error)

func (*CatalogBucket) FirstEntry

func (b *CatalogBucket) FirstEntry(sid string) (*EntryBucket, error)

func (*CatalogBucket) ForEachSeries

func (b *CatalogBucket) ForEachSeries(f func(sid string, b *SeriesBucket) error) error

func (*CatalogBucket) ModTime

func (b *CatalogBucket) ModTime() time.Time

func (*CatalogBucket) RegenerateCatalog

func (b *CatalogBucket) RegenerateCatalog() error

func (*CatalogBucket) Series

func (b *CatalogBucket) Series(sid string) (*SeriesBucket, error)

func (*CatalogBucket) SeriesMetadata

func (b *CatalogBucket) SeriesMetadata(sid string) (*api.Series, error)

func (*CatalogBucket) SetCatalog

func (b *CatalogBucket) SetCatalog(c api.Catalog) error

func (*CatalogBucket) SetModTime

func (b *CatalogBucket) SetModTime(t time.Time) error

func (*CatalogBucket) SetSeriesMetadata

func (b *CatalogBucket) SetSeriesMetadata(sid string, s *api.Series) error

type DownloadsBucket

type DownloadsBucket struct {
	*bolt.Bucket
}

func (*DownloadsBucket) AddDownload

func (d *DownloadsBucket) AddDownload(dl *api.Download) error

func (*DownloadsBucket) DeleteDownload

func (d *DownloadsBucket) DeleteDownload(k []byte) error

func (*DownloadsBucket) ForEachDownload

func (d *DownloadsBucket) ForEachDownload(f func(k []byte, dl *api.Download) error) error

func (*DownloadsBucket) GetDownloads

func (d *DownloadsBucket) GetDownloads() []*api.Download

func (*DownloadsBucket) NextID

func (d *DownloadsBucket) NextID() []byte

type EntryBucket

type EntryBucket struct {
	*bolt.Bucket
}

func (*EntryBucket) Archive

func (b *EntryBucket) Archive() *manga.Archive

func (*EntryBucket) Cover

func (b *EntryBucket) Cover() *manga.Cover

func (*EntryBucket) HasThumbnail

func (b *EntryBucket) HasThumbnail() bool

func (*EntryBucket) Metadata

func (b *EntryBucket) Metadata() *manga.EntryMetadata

func (*EntryBucket) Order

func (b *EntryBucket) Order() int

func (*EntryBucket) PagesBucket

func (b *EntryBucket) PagesBucket() *PagesBucket

func (*EntryBucket) SetArchive

func (b *EntryBucket) SetArchive(a *manga.Archive) error

func (*EntryBucket) SetCover

func (b *EntryBucket) SetCover(c *manga.Cover) error

func (*EntryBucket) SetMetadata

func (b *EntryBucket) SetMetadata(d *manga.EntryMetadata) error

func (*EntryBucket) SetOrder

func (b *EntryBucket) SetOrder(o int) error

func (*EntryBucket) SetThumbnail

func (b *EntryBucket) SetThumbnail(thumb []byte) error

func (*EntryBucket) Thumbnail

func (b *EntryBucket) Thumbnail() []byte

type PagesBucket

type PagesBucket struct {
	*bolt.Bucket
}

func (*PagesBucket) GetPage

func (b *PagesBucket) GetPage(num int) (*manga.Page, error)

func (*PagesBucket) Num

func (b *PagesBucket) Num() int

func (*PagesBucket) SetPage

func (b *PagesBucket) SetPage(num int, p *manga.Page) error

type SeriesBucket

type SeriesBucket struct {
	*bolt.Bucket
}

func (*SeriesBucket) AddEntry

func (b *SeriesBucket) AddEntry(e *manga.ParsedEntry, order int) error

func (*SeriesBucket) Cover

func (b *SeriesBucket) Cover() *manga.Cover

func (*SeriesBucket) DeleteEntry

func (b *SeriesBucket) DeleteEntry(eid string) error

func (*SeriesBucket) EntriesMetadata

func (b *SeriesBucket) EntriesMetadata() api.Entries

func (*SeriesBucket) EntryMetadata

func (b *SeriesBucket) EntryMetadata(eid string) (*api.Entry, error)

func (*SeriesBucket) ForEachEntry

func (b *SeriesBucket) ForEachEntry(f func(hash string, b *EntryBucket) error) error

func (*SeriesBucket) HasThumbnail

func (b *SeriesBucket) HasThumbnail() bool

func (*SeriesBucket) Metadata

func (b *SeriesBucket) Metadata() *manga.SeriesMetadata

func (*SeriesBucket) ModTime

func (b *SeriesBucket) ModTime() time.Time

func (*SeriesBucket) Order

func (b *SeriesBucket) Order() int

func (*SeriesBucket) RegenerateEntriesMetadata

func (b *SeriesBucket) RegenerateEntriesMetadata() error

func (*SeriesBucket) SetCover

func (b *SeriesBucket) SetCover(c *manga.Cover) error

func (*SeriesBucket) SetEntriesMetadata

func (b *SeriesBucket) SetEntriesMetadata(d api.Entries) error

func (*SeriesBucket) SetEntryMetadata

func (b *SeriesBucket) SetEntryMetadata(eid string, m *api.Entry) error

func (*SeriesBucket) SetMetadata

func (b *SeriesBucket) SetMetadata(d *manga.SeriesMetadata) error

func (*SeriesBucket) SetModTime

func (b *SeriesBucket) SetModTime(t time.Time) error

func (*SeriesBucket) SetOrder

func (b *SeriesBucket) SetOrder(o int) error

func (*SeriesBucket) SetTags

func (b *SeriesBucket) SetTags(t *sets.Set) error

func (*SeriesBucket) SetThumbnail

func (b *SeriesBucket) SetThumbnail(thumb []byte) error

func (*SeriesBucket) SetTitle

func (b *SeriesBucket) SetTitle(t string) error

func (*SeriesBucket) Tags

func (b *SeriesBucket) Tags() *sets.Set

func (*SeriesBucket) Thumbnail

func (b *SeriesBucket) Thumbnail() []byte

func (*SeriesBucket) Title

func (b *SeriesBucket) Title() string

type UserBucket

type UserBucket struct {
	*bolt.Bucket
}

func (*UserBucket) ChangeName

func (u *UserBucket) ChangeName(name string) error

func (*UserBucket) ChangePassword

func (u *UserBucket) ChangePassword(password string, shouldHash bool) error

func (*UserBucket) ChangeProgress

func (u *UserBucket) ChangeProgress(p *users.CatalogProgress) error

func (*UserBucket) ChangeType

func (u *UserBucket) ChangeType(userType users.Type) error

func (*UserBucket) IsAdmin

func (u *UserBucket) IsAdmin() bool

func (*UserBucket) Name

func (u *UserBucket) Name() string

func (*UserBucket) Password

func (u *UserBucket) Password() string

func (*UserBucket) Progress

func (u *UserBucket) Progress() *users.CatalogProgress

func (*UserBucket) Struct

func (u *UserBucket) Struct() *users.User

func (*UserBucket) Type

func (u *UserBucket) Type() users.Type

func (*UserBucket) ValidPassword

func (u *UserBucket) ValidPassword(unhashedPassword string) bool

type UsersBucket

type UsersBucket struct {
	*bolt.Bucket
}

func (*UsersBucket) AddUser

func (b *UsersBucket) AddUser(u *users.User, overwrite bool) error

func (*UsersBucket) AdminCount

func (b *UsersBucket) AdminCount() int

func (*UsersBucket) DeleteUser

func (b *UsersBucket) DeleteUser(uid string) error

func (*UsersBucket) ForEachUser

func (b *UsersBucket) ForEachUser(f func(ub *UserBucket) error) error

func (*UsersBucket) GetUser

func (b *UsersBucket) GetUser(uid string) (*UserBucket, error)

func (*UsersBucket) HasUser

func (b *UsersBucket) HasUser(uid string) bool

func (*UsersBucket) HasUsers

func (b *UsersBucket) HasUsers() bool

func (*UsersBucket) RenameUser

func (b *UsersBucket) RenameUser(oldUid, newUid string, newUsername string) error

Jump to

Keyboard shortcuts

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