datastructure

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2020 License: AGPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ItemTypeBook    ItemType = "book"
	ItemTypeFilm             = "film"
	ItemTypeTvserie          = "tvserie"
	ItemTypeUnkown           = "unknown"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Book added in v0.4.0

type Book struct {
	Id           string
	Uri          string
	Source       []Source
	Cover        string
	Authors      []string
	Year         int64
	Title        string
	SerieUri     string
	SerieName    string
	PartInSerie  string
	Genres       []string
	Article      string
	Description  string
	IsOnWantList bool
	Experiences  []time.Time
}

func (Book) GetArticle added in v0.4.0

func (b Book) GetArticle() string

func (*Book) GetItemInfo added in v0.4.0

func (b *Book) GetItemInfo() ItemInfo

func (*Book) GetItemType added in v0.4.0

func (b *Book) GetItemType() ItemType

func (Book) GetLastExperience added in v0.4.0

func (b Book) GetLastExperience(strings i18n.Translation, timezone string) string

func (Book) GetLastExperienceFull added in v0.4.0

func (b Book) GetLastExperienceFull(strings i18n.Translation) string

func (*Book) SetDescription added in v0.4.0

func (b *Book) SetDescription(description string)

func (*Book) SetOnWantList added in v0.4.0

func (b *Book) SetOnWantList(isOnList bool)

type Experiences

type Experiences struct {
	List  []ExperiencesEntry
	Page  int
	Pages int
	Query string
}

func (Experiences) NextPage

func (e Experiences) NextPage() int

func (Experiences) PrevPage

func (e Experiences) PrevPage() int

type ExperiencesEntry

type ExperiencesEntry struct {
	ItemInfo
	Type     string
	Id       string
	Code     string
	Datetime time.Time
}

func (ExperiencesEntry) FormatDatetime

func (e ExperiencesEntry) FormatDatetime(strings i18n.Translation) string

type Item

type Item interface {
	GetItemInfo() ItemInfo
	GetItemType() ItemType
	SetOnWantList(isOnList bool)
}

type ItemInfo

type ItemInfo struct {
	Cover      string
	Status     string
	Title      string
	YearStart  int
	YearEnd    int
	BasedOn    string
	Genres     string
	Runtime    int
	Collection int
	Part       int
	Episodes   int
}

func (ItemInfo) GetGenres

func (i ItemInfo) GetGenres(genres map[int]string) string

func (ItemInfo) IsUnreleased

func (i ItemInfo) IsUnreleased(itemType ItemType) bool

type ItemType

type ItemType string

type List

type List interface {
	SetGenres(map[int]string)
	GetType() ItemType
}

type Readlist added in v0.4.0

type Readlist struct {
	List   []ReadlistEntry
	Page   int
	Pages  int
	Genres map[int]string
	Query  string
}

func (*Readlist) GetType added in v0.4.0

func (w *Readlist) GetType() ItemType

func (Readlist) NextPage added in v0.4.0

func (w Readlist) NextPage() int

func (Readlist) PrevPage added in v0.4.0

func (w Readlist) PrevPage() int

func (*Readlist) SetGenres added in v0.4.0

func (w *Readlist) SetGenres(m map[int]string)

type ReadlistEntry added in v0.4.0

type ReadlistEntry struct {
	ItemInfo
	Id          string
	HasPrevious bool
}

type Source added in v0.4.0

type Source struct {
	Url  string
	Name string
}

type TvQueue

type TvQueue struct {
	List   []TvQueueEntry
	Page   int
	Pages  int
	Genres map[int]string
	Query  string
}

func (*TvQueue) GetType

func (q *TvQueue) GetType() ItemType

func (TvQueue) NextPage

func (q TvQueue) NextPage() int

func (TvQueue) PrevPage

func (q TvQueue) PrevPage() int

func (*TvQueue) SetGenres

func (q *TvQueue) SetGenres(m map[int]string)

type TvQueueEntry

type TvQueueEntry struct {
	ItemInfo
	Id              string
	HasPrevious     bool
	WatchedEpisodes int
	SkippedEpisodes int
}

func (TvQueueEntry) CalculateProgress

func (e TvQueueEntry) CalculateProgress() int

func (TvQueueEntry) GetYears

func (e TvQueueEntry) GetYears() string

type ValueError

type ValueError struct {
	Message string
}

func (ValueError) Error

func (e ValueError) Error() string

type Watchlist

type Watchlist struct {
	List   []WatchlistEntry
	Page   int
	Pages  int
	Genres map[int]string
	Query  string
}

func (*Watchlist) GetType

func (w *Watchlist) GetType() ItemType

func (Watchlist) NextPage

func (w Watchlist) NextPage() int

func (Watchlist) PrevPage

func (w Watchlist) PrevPage() int

func (*Watchlist) SetGenres

func (w *Watchlist) SetGenres(m map[int]string)

type WatchlistEntry

type WatchlistEntry struct {
	ItemInfo
	Id          string
	HasPrevious bool
}

type Work added in v0.4.0

type Work interface {
	GetArticle() string
	SetDescription(description string)
}

Jump to

Keyboard shortcuts

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