gol

package
v0.0.0-...-cf68763 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2020 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Actions = map[string]ManagerAction{
	"scan":       scan,
	"load":       scan,
	"next":       next,
	"push":       push,
	"add":        push,
	"pop":        pop,
	"list":       list,
	"detail":     detail,
	"view":       detail,
	"info":       detail,
	"finished":   finished,
	"finish":     finished,
	"remove":     remove,
	"delete":     remove,
	"review":     review,
	"check":      review,
	"find":       search,
	"search":     search,
	"lists":      enumerate,
	"reconsider": reconsider,
	"reorganize": reconsider,
	"rate":       reconsider,
	"sort":       reconsider,
	"reactivate": reactivate,
}

Actions The functions that this program can do.

View Source
var RegisteredTypes = map[string]ListElement{
	"anime":  &AnimeListElement{},
	"movies": &MovieListElement{},
	"games":  &GameListElement{},
	"books":  &BookListElement{},
}

RegisteredTypes Map of all usable types. Returns a pointer to the type

View Source
var Sources = map[string]InfoSource{
	"myanimelist.net":        SourceMyAnimeList,
	"store.steampowered.com": SourceSteamOnline,
	"www.amazon.ca":          SourceAmazonCanada,
	"amazon.com":             SourceAmazonUS,
	"www.metacritic.com":     SourceMetacritic,
}

Functions

func Cleanup

func Cleanup()

func ExtractDomainName

func ExtractDomainName(URL string) string

func PrintAnime

func PrintAnime(object AnimeListElement)

func PrintKnownActions

func PrintKnownActions()

func PrintKnownLists

func PrintKnownLists()

func PrintSetWidth

func PrintSetWidth(text, linePrefix, newlineSeq string, columnWidth int)

func RequestInput

func RequestInput(message string) string

Types

type AnimeListElement

type AnimeListElement struct {
	ID   int
	Base ListElementFields `gorm:"polymorphic:Owner;"`

	NumEpisodes int
	AirTime     time.Time
}

type BookListElement

type BookListElement struct {
	ID   int
	Base ListElementFields `gorm:"polymorphic:Owner;"`

	Pages       int
	Price       float64
	ReleaseDate time.Time
}

type GameListElement

type GameListElement struct {
	ID   int
	Base ListElementFields `gorm:"polymorphic:Owner;"`

	Platform    string
	ReleaseDate time.Time
}

type InfoSource

type InfoSource func(string) ListElement

InfoSource Defines the type signature of an information source that can be used to create and rate new ListElements

type ListElement

type ListElement interface {
	// contains filtered or unexported methods
}

func CreateListElement

func CreateListElement(elementType, url, name, description string, sourceRating float32) ListElement

func SourceAmazonCanada

func SourceAmazonCanada(URL string) ListElement

func SourceAmazonUS

func SourceAmazonUS(URL string) ListElement

func SourceIMDB

func SourceIMDB(URL string) ListElement

func SourceMetacritic

func SourceMetacritic(URL string) ListElement

func SourceMyAnimeList

func SourceMyAnimeList(URL string) ListElement

func SourceNull

func SourceNull(URL string) ListElement

func SourceSteamOnline

func SourceSteamOnline(URL string) ListElement

type ListElementFields

type ListElementFields struct {
	gorm.Model

	URL         string `sql:"unique;not null"`
	Name        string `sql:"unique;not null"`
	Description string
	IsRated     bool
	WasViewed   bool
	WasRemoved  bool

	SourceRating    float32
	HeuristicRating float32

	OwnerId   int
	OwnerType string
}

func CreateListElementFields

func CreateListElementFields(url, name, description string, sourceRating float32) ListElementFields

type ManagerAction

type ManagerAction func([]string) int

ManagerAction Defines a type signature for all the Manager methods

type MovieListElement

type MovieListElement struct {
	ID   int
	Base ListElementFields `gorm:"polymorphic:Owner;"`

	ReviewCount int
	Duration    int
}

type OrderedList

type OrderedList []ListElement

func (OrderedList) Len

func (slice OrderedList) Len() int

func (OrderedList) Less

func (slice OrderedList) Less(i, j int) bool

func (OrderedList) Swap

func (slice OrderedList) Swap(i, j int)

Jump to

Keyboard shortcuts

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