definition

package
Version: v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2020 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Emoji

type Emoji struct {
	// Name is a name of this emoji.
	Name string

	// ShortNames is a shorter representation of this emoji.
	ShortNames []string

	// Unicode is an unicode representation of this emoji.
	Unicode []rune
}

Emoji is a data structure that holds a single emoji.

func NewEmoji

func NewEmoji(name string, unicode []rune, shortNames ...string) Emoji

NewEmoji returns a new Emoji.

func (*Emoji) IsUnicode

func (em *Emoji) IsUnicode() bool

IsUnicode returns true if this emoji is defined in unicode, otherwise false.

type Emojis

type Emojis interface {
	// Get returns (*Emoji, true) if found mapping associated with given short name, otherwise (nil, false).
	Get(shortName string) (*Emoji, bool)

	// Add adds new emojis to this collection.
	Add(Emojis)

	// Clone clones this collection.
	Clone() Emojis
}

Emojis is a collection of emojis.

func Github

func Github(opts ...EmojisOption) Emojis

func NewEmojis

func NewEmojis(es ...Emoji) Emojis

NewEmojis returns a new Emojis.

type EmojisOption

type EmojisOption func(Emojis)

EmojisOption sets options for Emojis.

func WithEmojis

func WithEmojis(emojis ...Emoji) EmojisOption

WithEmojis is an EmojisOption that adds emojis to the Emojis.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL