gitmoji

package
v1.1.5 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const GitmojiDirName string = ".gitmoji"

GitmojiDirName is the name of the directory under the user's home directory to store the gitmoji list.

View Source
const GitmojiFileName string = "gitmojis.json"

GitmojiFileName is the name of the file to store the list of gitmoji.

View Source
const GitmojiURL string = "https://raw.githubusercontent.com/carloscuesta/gitmoji/master/packages/gitmojis/src/gitmojis.json"

GitmojiURL is the address from which to download the list of gitmoji.

Variables

This section is empty.

Functions

func UpdateCache

func UpdateCache() error

UpdateCache checks the default URL for new gitmoji and updates the cache file in local storage if it is stale.

Types

type Cache

type Cache struct {
	CacheFile string
	// contains filtered or unexported fields
}

Cache is a local file cache for storing gitmoji.

func NewCache

func NewCache() (Cache, error)

NewCache returns a gitmoji cache using the default URL and local storage.

func NewCacheWithURLAndCacheFile

func NewCacheWithURLAndCacheFile(url string, cacheFile string) (Cache, error)

NewCacheWithURLAndCacheFile returns a gitmoji cache of a custom URL and local storage location. This method is intended to be used for testing only.

func (*Cache) GetGitmoji

func (cache *Cache) GetGitmoji() ([]Gitmoji, error)

GetGitmoji gets the gitmoji list from a local file cache if available; otherwise, downloads the latest gitmoji list from github.com.

type Gitmoji

type Gitmoji struct {
	Emoji       string
	Entity      string
	Code        string
	Description string
	Name        string
}

Gitmoji is a structure with the information about a single gitmoji.

Jump to

Keyboard shortcuts

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