cache

package
v1.4.9 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2024 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CustomJSONDir string = pathname.ExpandPath(
	"~/.config/arTTY/" + jsonDir,
)

CustomJSONDir is the location where custom JSON files generated by the user are saved.

Functions

This section is empty.

Types

type ArtCache

type ArtCache struct {
	jsoncfg.JSONCfg
	// contains filtered or unexported fields
}

ArtCache is a struct inheriting from jsoncfg.JSONCfg and containing a version string.

func New

func New(version string) *ArtCache

New will return a new ArtCache struct pointer with the specified version.

func (*ArtCache) GetFileOf

func (c *ArtCache) GetFileOf(name string) string

GetFileOf will return the cached filename for the specified art.

func (*ArtCache) GetHeightOf

func (c *ArtCache) GetHeightOf(name string) int

GetHeightOf will return the cached height for the specified art.

func (*ArtCache) GetWidthOf

func (c *ArtCache) GetWidthOf(name string) int

GetWidthOf will return the cached width for the specified art.

func (*ArtCache) List

func (c *ArtCache) List() []string

List will return a list of names for any cached art files.

func (*ArtCache) Refresh

func (c *ArtCache) Refresh() error

Refresh will read any found JSON files and update the art cache.

func (*ArtCache) Update

func (c *ArtCache) Update() error

Update will download the newest art files from github.com and refresh the local cache.

Jump to

Keyboard shortcuts

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