Documentation ¶
Index ¶
- func Lexicon() (*lexicon.Lexicon, error)
- func Make(document *goquery.Document)
- func Remove() error
- type Categories
- func (pointer *Categories) Add(category *category.Category) *Categories
- func (pointer *Categories) Each(f func(category *category.Category)) *Categories
- func (pointer *Categories) Fetch(key string) *category.Category
- func (pointer *Categories) Get(key string) (*category.Category, bool)
- func (pointer *Categories) Has(key string) bool
- func (pointer *Categories) Keys() *slice.Slice
- func (pointer *Categories) Len() int
- func (pointer *Categories) Remove(key string) bool
- func (pointer *Categories) Values() *slice.Slice
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
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 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.