Documentation
¶
Index ¶
- Variables
- func CategoryDirpath(subdir string, cat string) string
- func CategoryFpath(subdir string, category string, fname string) string
- func Check(e error)
- func Compress(data []byte) []byte
- func ConvertPngToCow(sourceDirpath string, sourceFpath string, destDirpath string, extraPadding int) (string, error)
- func CreateCategoryStruct(rootDir string, metadata []PokemonMetadata, debug bool) []string
- func Decompress(data []byte) []byte
- func EntryFpath(subdir string, idx int) string
- func FindFiles(dirpath string, ext string, skip []string) []string
- func GatherMapKeys[T any](m map[string]T) []string
- func MetadataFpath(subdir string, idx int) string
- func ReadIntFromBytes(bs []byte) int
- func ReadNames(fpath string) map[string]PokemonName
- func ReadPokemonCow(embeddedData embed.FS, fpath string) []byte
- func ReadStructFromBytes[T any](data []byte) T
- func StructToJSON(obj interface{}, indentation ...int) string
- func WriteBytesToFile(data []byte, fpath string, compress bool)
- func WriteIntToFile(n int, fpath string)
- func WriteStructToFile(obj interface{}, fpath string)
- func WriteToCowfile(data string, destDirpath string, destFpath string)
- type DataEntry
- type PokemonEntryMapping
- type PokemonMetadata
- func CreateNameMetadata(idx string, key string, name PokemonName, rootDir string, fpaths []string) *PokemonMetadata
- func NewMetadata(idx string, name string, japaneseName string, japanesePhonetic string, ...) *PokemonMetadata
- func ReadMetadataFromBytes(data []byte) PokemonMetadata
- func ReadMetadataFromEmbedded(embeddedData embed.FS, fpath string) PokemonMetadata
- func ReadMetadataFromFile(fpath string) PokemonMetadata
- type PokemonName
Constants ¶
This section is empty.
Variables ¶
View Source
var (
COLOUR_RESET string = fmt.Sprintf("%s[%dm\n", "\x1b", 39)
)
Functions ¶
func CategoryDirpath ¶ added in v0.11.3
func CategoryFpath ¶ added in v0.11.3
func ConvertPngToCow ¶
func CreateCategoryStruct ¶ added in v0.10.0
func CreateCategoryStruct(rootDir string, metadata []PokemonMetadata, debug bool) []string
func Decompress ¶
func EntryFpath ¶
func GatherMapKeys ¶ added in v0.11.3
func MetadataFpath ¶
func ReadIntFromBytes ¶ added in v0.11.0
func ReadNames ¶ added in v0.10.0
func ReadNames(fpath string) map[string]PokemonName
func ReadPokemonCow ¶ added in v0.11.0
func ReadStructFromBytes ¶ added in v0.11.0
func StructToJSON ¶ added in v0.11.0
func WriteBytesToFile ¶
func WriteIntToFile ¶ added in v0.11.0
func WriteStructToFile ¶
func WriteStructToFile(obj interface{}, fpath string)
func WriteToCowfile ¶ added in v0.15.1
Types ¶
type DataEntry ¶ added in v0.10.0
type DataEntry struct {
Name struct {
Eng string `json:"eng"`
Jpn string `json:"jpn"`
Jpn_ro string `json:"jpn_ro"`
} `json:"name"`
Slug struct {
Eng string `json:"eng"`
Jpn string `json:"jpn"`
Jpn_ro string `json:"jpn_ro"`
} `json:"slug"`
}
{
"name": { "eng": "Charizard", "chs": "喷火龙", "jpn": "リザードン", "jpn_ro": "Lizardon" }
"slug": { "eng": "charizard", "jpn": "riza-don", "jpn_ro": "lizardon" }
}
Out of all these names, we want the name.jpn, name.jpn_ro, slug.eng,
type PokemonEntryMapping ¶ added in v0.11.2
type PokemonMetadata ¶
type PokemonMetadata struct {
Idx string
Name string
JapaneseName string
JapanesePhonetic string
Entries []PokemonEntryMapping
}
func CreateNameMetadata ¶ added in v0.11.2
func CreateNameMetadata(idx string, key string, name PokemonName, rootDir string, fpaths []string) *PokemonMetadata
func NewMetadata ¶ added in v0.11.0
func ReadMetadataFromBytes ¶
func ReadMetadataFromBytes(data []byte) PokemonMetadata
func ReadMetadataFromEmbedded ¶ added in v0.11.0
func ReadMetadataFromEmbedded(embeddedData embed.FS, fpath string) PokemonMetadata
func ReadMetadataFromFile ¶ added in v0.11.3
func ReadMetadataFromFile(fpath string) PokemonMetadata
type PokemonName ¶ added in v0.10.0
func NewPokemonName ¶ added in v0.10.0
func NewPokemonName(entry DataEntry) *PokemonName
Click to show internal directories.
Click to hide internal directories.