emos

package module
Version: v0.0.0-...-8ed9696 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2021 License: MIT Imports: 13 Imported by: 0

README

I wrote this program because emoji search on https://discordemoji.com/ is pretty slow and i want to be annoying in our work chat more often.

The CLI caches the emojis and builds an index to make it faster to search.

Usage

$ emos '*snug'
MonkaSnug - https://discordemoji.com/assets/emoji/MonkaSnug.png

$ emos -link r
https://discordemoji.com/assets/emoji/r.png

$ emos -md pepehug
pepehug - /md ![](https://discordemoji.com/assets/emoji/pepehug.png)

$ emos -md -link -lucky monkaHmm
/md ![](https://discordemoji.com/assets/emoji/pepehug.png)

My usual usage is

$ emos -md -link -lucky cry | pbcopy

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewIndex

func NewIndex(loc string) (*index, error)

func NewMemIndex

func NewMemIndex() (*index, error)

func OpenIndex

func OpenIndex(loc string) (*index, error)

Types

type Emoji

type Emoji struct {
	Title       string
	Image       string
	Description string
	Category    string
	Width       int
	Height      int
}

type EmojiSearch

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

func NewEmojiSearch

func NewEmojiSearch(cacheLoc, indexLoc string) (*EmojiSearch, error)

func (*EmojiSearch) Close

func (es *EmojiSearch) Close()

Close closes the search

func (*EmojiSearch) IsIndexEmpty

func (es *EmojiSearch) IsIndexEmpty() bool

func (*EmojiSearch) RefreshIndex

func (es *EmojiSearch) RefreshIndex()

RefreshIndex updates the index

func (*EmojiSearch) Search

func (es *EmojiSearch) Search(input string) *SearchResultIter

func (*EmojiSearch) UpdateEmojis

func (es *EmojiSearch) UpdateEmojis() error

UpdateEmojis refreshes the local cache of emojis

type SearchResultIter

type SearchResultIter struct {
	Query string
	// contains filtered or unexported fields
}

func (*SearchResultIter) Next

func (si *SearchResultIter) Next() (*Emoji, error)

Directories

Path Synopsis
cmd
internal

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