gmoji

package
v0.3.6 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2025 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LangEN = "en"
	LangZH = "zh-CN"
)

languages

Variables

This section is empty.

Functions

This section is empty.

Types

type Emoji

type Emoji struct {
	Name string
	Code string

	Emoji  string
	Entity string
	Semver string

	Description string
}

Emoji struct

func (*Emoji) ID

func (e *Emoji) ID() string

ID name

type EmojiMap

type EmojiMap map[string]*Emoji

EmojiMap data. key is code name: Emoji.ID()

func Emojis

func Emojis(lang string) (EmojiMap, error)

Emojis for given language

func MustEmojis

func MustEmojis(lang string) EmojiMap

MustEmojis load and get

func (EmojiMap) CodeToEmoji

func (em EmojiMap) CodeToEmoji(code string) string

CodeToEmoji convert

func (EmojiMap) FindOne

func (em EmojiMap) FindOne(keywords ...string) *Emoji

FindOne by keywords

func (EmojiMap) First

func (em EmojiMap) First() *Emoji

First emoji get

func (EmojiMap) Get

func (em EmojiMap) Get(name string) *Emoji

Get by code name

func (EmojiMap) Len

func (em EmojiMap) Len() int

Len of map

func (EmojiMap) Lookup

func (em EmojiMap) Lookup(name string) (*Emoji, bool)

Lookup by code name

func (EmojiMap) NameToEmoji

func (em EmojiMap) NameToEmoji(name string) string

NameToEmoji convert

func (EmojiMap) RenderCodes

func (em EmojiMap) RenderCodes(text string) string

RenderCodes to emojis

func (EmojiMap) Search

func (em EmojiMap) Search(keywords []string, limit int) EmojiMap

Search by keywords, will match name and description

func (EmojiMap) String

func (em EmojiMap) String() string

String format

Jump to

Keyboard shortcuts

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