users

package
v0.16.3 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2022 License: BSD-3-Clause Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrProgressEntryNotExist = errors.New("entry does not exist")

Functions

This section is empty.

Types

type CatalogProgress

type CatalogProgress struct {
	Data map[string]SeriesProgress
}

func NewCatalogProgress

func NewCatalogProgress() CatalogProgress

func UnmarshalCatalogProgress

func UnmarshalCatalogProgress(data []byte) CatalogProgress

func (*CatalogProgress) AddSeries

func (p *CatalogProgress) AddSeries(sid string, sp SeriesProgress)

func (*CatalogProgress) DeleteSeries

func (p *CatalogProgress) DeleteSeries(sid string)

func (*CatalogProgress) GetSeries

func (p *CatalogProgress) GetSeries(sid string) SeriesProgress

func (*CatalogProgress) HasSeries added in v0.16.1

func (p *CatalogProgress) HasSeries(sid string) bool

func (*CatalogProgress) SetSeries added in v0.12.1

func (p *CatalogProgress) SetSeries(sid string, sp SeriesProgress)

type EntryProgress

type EntryProgress struct {
	Title   string
	Current int `json:"current"`
	Total   int `json:"total"`
}

func NewEntryProgress

func NewEntryProgress(total int, title string) EntryProgress

func (EntryProgress) Percent

func (ep EntryProgress) Percent() float64

func (*EntryProgress) Set

func (ep *EntryProgress) Set(n int)

func (*EntryProgress) SetRead

func (ep *EntryProgress) SetRead()

func (*EntryProgress) SetUnread

func (ep *EntryProgress) SetUnread()

func (EntryProgress) String

func (ep EntryProgress) String() string

type SeriesProgress

type SeriesProgress struct {
	Title   string
	Entries map[string]EntryProgress `json:"tracker"`
}

func NewSeriesProgress

func NewSeriesProgress(entries int, title string) SeriesProgress

func (*SeriesProgress) DeleteEntry

func (p *SeriesProgress) DeleteEntry(eid string)

func (*SeriesProgress) Empty added in v0.16.1

func (p *SeriesProgress) Empty() bool

func (*SeriesProgress) GetEntry added in v0.16.1

func (p *SeriesProgress) GetEntry(eid string) (EntryProgress, error)

func (*SeriesProgress) HasEntry added in v0.16.1

func (p *SeriesProgress) HasEntry(eid string) bool

func (*SeriesProgress) SetAllRead

func (p *SeriesProgress) SetAllRead()

func (*SeriesProgress) SetAllUnread

func (p *SeriesProgress) SetAllUnread()

func (*SeriesProgress) SetEntry added in v0.16.1

func (p *SeriesProgress) SetEntry(eid string, e EntryProgress)

type Type

type Type string
const (
	Admin    Type = "admin"
	Standard Type = "standard"
)

func UnmarshalType

func UnmarshalType(data []byte) Type

type User

type User struct {
	Hash     string          `json:"hash"`
	Name     string          `json:"name"`
	Pass     string          `json:"pass"`
	Type     Type            `json:"type"`
	Progress CatalogProgress `json:"progress"`
}

func NewUser

func NewUser(name, pass string, t Type) *User

NewUser expects username and unhashed password along with the users permission

Jump to

Keyboard shortcuts

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