list

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2021 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Action      = "Action"
	Drama       = "Drama"
	Comedy      = "Comedy"
	Romance     = "Romance"
	SciFi       = "SciFi"
	Fantasy     = "Fantasy"
	Documentary = "Documentary"
)

Variables

View Source
var CategoriesList = []string{
	Action,
	Drama,
	Comedy,
	Romance,
	SciFi,
	Fantasy,
	Documentary,
}
View Source
var Movies = []Movie{
	{
		"Blade Runner",
		Categories{}.Add(Action).Add(Drama).Add(Romance).Add(SciFi),
	},
	{
		"Apocolypse Now",
		Categories{}.Add(Action).Add(Drama),
	},
	{
		"Ace Ventura, Pet Detective",
		Categories{}.Add(Action).Add(Comedy).Add(Fantasy),
	},
	{
		"Love Actually",
		Categories{}.Add(Action).Add(Comedy).Add(Drama).Add(Romance),
	},
	{
		"Enron, The Smarest Men in the Room",
		Categories{}.Add(Documentary),
	},
	{
		"Star Trek: The Wrath of Khan",
		Categories{}.Add(Action).Add(SciFi).Add(Drama),
	},
}

Functions

func New

func New(name string, filters Filters, options ...component.Option) (*component.Gear, error)

New constructs a new component that shows a list of categories that are selectable.

Types

type Categories

type Categories map[string]bool

func (Categories) Add

func (c Categories) Add(s string) Categories

func (Categories) Has

func (c Categories) Has(category string) bool

func (Categories) String

func (c Categories) String() string

type Filters

type Filters []string

type Movie

type Movie struct {
	Name       string
	Categories Categories
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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