full

package
v0.0.11 Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2024 License: GPL-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package full is unstable; it serves as a helper to populate things.Things hackily.

Index

Constants

View Source
const (
	FlagItemsOTBPath = PathFlag("items_otb_path")
	FlagItemsXMLPath = PathFlag("items_xml_path")
	FlagTibiaDatPath = PathFlag("tibia_dat_path")
	FlagTibiaSprPath = PathFlag("tibia_spr_path")
)

Variables

This section is empty.

Functions

func FromDefaultPaths

func FromDefaultPaths(withSpr bool) (*things.Things, error)

FromDefaultPaths finds all datafiles supported by things using default filepaths as found by the paths package, and adds them to the Things structure.

spr can be excluded due to its size.

Appropriate for tests or web frontends. Inappropriate for servers or clients where the path should be specifiable by the user on the command line.

func FromFilePathFlags

func FromFilePathFlags() (*things.Things, error)

FromFilePathFlags initializes things.Things populated with files specified by the default flags such as --items_otb_path, --items_xml_path etc. The flags need to be registered and parsed by the time this function is invoked.

func FromPaths

func FromPaths(itemsOTBPath, itemsXMLPath, tibiaDatPath, tibiaSprPath string) (*things.Things, error)

FromPaths populates a things.Things datastructure using datafiles found at passed paths. Any path passed as an empty string will be omitted.

func PathFlagValue

func PathFlagValue(key PathFlag) string

PathFlagValue returns the value for the passed flag path (such as the path to Tibia.dat).

func SetupFilePathFlags

func SetupFilePathFlags()

SetupFilePathFlags registers flags to manually define paths to common files registerable in things.Things. For example, it will currently register --items_otb_path, --items_xml_path, --tibia_dat_path, --tibia_spr_path.

These paths will then be referred to in the FromFilePathFlags function.

Types

type PathFlag

type PathFlag string

Jump to

Keyboard shortcuts

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