tf

package
v1.9.4 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2022 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrMeNo  = errors.New("no readme chosen")
	ErrMeUnk = errors.New("unknown readme")
	ErrMeNF  = errors.New("readme not found in archive")
	ErrPNG   = errors.New("no such png file")
)

Functions

This section is empty.

Types

type TextFile

type TextFile struct {
	ID       uint           // MySQL auto increment Id.
	UUID     string         // Unique Id.
	Name     string         // Filename.
	Ext      string         // File extension.
	Platform string         // Platform classification of the file.
	Size     int            // Size of the file in bytes.
	NoReadme sql.NullBool   // Disable the display of a readme on the site.
	Readme   sql.NullString // Filename of a readme or NFO textfile to display on the site.
}

TextFile is a text file object.

func (*TextFile) Archive

func (t *TextFile) Archive() bool

Archive confirms that the named file is a known archive.

func (*TextFile) Exist

func (t *TextFile) Exist(dir *directories.Dir) (bool, error)

Exist checks that [UUID].png exists in both thumbnail subdirectories.

func (*TextFile) Extract

func (t *TextFile) Extract(dir *directories.Dir) error

Extract a textfile readme from an archive.

func (*TextFile) ExtractedImgs

func (t *TextFile) ExtractedImgs(dir string) error

ExtractedImgs generates PNG and Webp image assets from a textfile extracted from an archive.

func (*TextFile) String

func (t *TextFile) String() string

func (*TextFile) TextPng

func (t *TextFile) TextPng(c int, dir string) error

TextPng generates PNG format image assets from a textfile.

func (*TextFile) WebP

func (t *TextFile) WebP(c int, imgDir string) (int, error)

WebP finds and generates missing WebP format images.

Jump to

Keyboard shortcuts

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