emojipedia

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: 11 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Lexicon

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

Lexicon returns the internal lexicon.Lexicon pointer to be consumed by a shared function.

func Make

func Make(document *goquery.Document)

Make builds Emoji dependencies from HTML scraped from unicode.org.

func Remove

func Remove() error

Remove deletes all Emoji data stored in the dependencies folder.

Types

type Emojipedia

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

Emojipedia is a map-like struct with methods used to perform traversal and retrieval of emoji.Emoji pointers.

func Get

func Get() *Emojipedia

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

func New

func New() *Emojipedia

New instantiates a new empty Emojipedia pointer.

func NewEmojipedia

func NewEmojipedia(emoji ...*emoji.Emoji) *Emojipedia

NewEmojipedia creates a new Emojipedia pointer, accepting zero or more emoji.Emoji pointers as arguments.

func Open

func Open() (*Emojipedia, error)

Open attempts to open all Emoji data from the emojipedia/emoji folder.

func (*Emojipedia) Add

func (pointer *Emojipedia) Add(emoji *emoji.Emoji) *Emojipedia

Add method adds one emoji.Emoji to the Emojipedia using the emoji.Emoji.Name as the key reference.

func (*Emojipedia) Each

func (pointer *Emojipedia) Each(f func(key string, emoji *emoji.Emoji)) *Emojipedia

Each method executes a provided function once for each emoji.Emoji pointer.

func (*Emojipedia) Fetch

func (pointer *Emojipedia) Fetch(key string) *emoji.Emoji

Fetch retrieves the emoji.Emoji pointer held by the argument key. Panics if key does not exist.

func (*Emojipedia) Get

func (pointer *Emojipedia) Get(key string) (*emoji.Emoji, bool)

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

func (*Emojipedia) Has

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

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

func (*Emojipedia) Keys

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

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

func (*Emojipedia) Len

func (pointer *Emojipedia) Len() int

Len method returns the number of elements in the Emojipedia.

func (*Emojipedia) Remove

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

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

func (*Emojipedia) Values

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

Values method returns a Slice of a given Emojipedia'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