categories

package
v0.0.0-...-3a26ebd Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2019 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Lexicon

func Lexicon() (*lexicon.Lexicon, error)

func Make

func Make(document *goquery.Document)

func Remove

func Remove() error

Remove deletes all Category data stored in the dependencies folder.

Types

type Categories

type Categories struct {
	// contains filtered or unexported fields
}

Categories is a map-like struct with methods used to perform traversal and retrieval of category.Category pointers.

func Get

func Get() *Categories

Get attempts to open all Category data from the emojipedia/categories folder, but panics if an error occurs.

func New

func New() *Categories

New instantiates a new empty Categories pointer.

func NewCategories

func NewCategories(category ...*category.Category) *Categories

NewCategories creates a new Categories pointer, accepting zero or more category.Category pointers as arguments.

func Open

func Open() (*Categories, error)

Open attempts to open all Category data from the emojipedia/categories folder.

func (*Categories) Add

func (pointer *Categories) Add(category *category.Category) *Categories

Add method adds one category.Category to the Categories using the category.Category.Name as the key reference.

func (*Categories) Each

func (pointer *Categories) Each(f func(category *category.Category)) *Categories

Each method executes a provided function once for each category.Category pointer.

func (*Categories) Fetch

func (pointer *Categories) Fetch(key string) *category.Category

Fetch retrieves the category.Category pointer held by the argument key. Panics if key does not exist.

func (*Categories) Get

func (pointer *Categories) Get(key string) (*category.Category, bool)

Get returns the category.Category pointer held by the argument key and a boolean indicating if it was successfully retrieved. Panics if cannot convert to category.Category pointer.

func (*Categories) Has

func (pointer *Categories) Has(key string) bool

Has method checks that a given key exists in the Categories.

func (*Categories) Keys

func (pointer *Categories) Keys() *slice.Slice

Keys method returns a slice.Slice of a given Categories' own property names, in the same order as we get with a normal loop.

func (*Categories) Len

func (pointer *Categories) Len() int

Len method returns the number of elements in the Categories.

func (*Categories) Remove

func (pointer *Categories) Remove(key string) bool

Remove method removes a entry from the Categories if it exists. Returns a boolean to confirm if it succeeded.

func (*Categories) Values

func (pointer *Categories) Values() *slice.Slice

Values method returns a Slice of a given Categories's own enumerable property values, in the same order as that provided by a for...in loop.

Jump to

Keyboard shortcuts

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