Documentation ¶
Overview ¶
Package full is unstable; it serves as a helper to populate things.Things hackily.
Index ¶
- Constants
- func FromDefaultPaths(withSpr bool) (*things.Things, error)
- func FromFilePathFlags() (*things.Things, error)
- func FromPaths(itemsOTBPath, itemsXMLPath, tibiaDatPath, tibiaSprPath string) (*things.Things, error)
- func PathFlagValue(key PathFlag) string
- func SetupFilePathFlags()
- type PathFlag
Constants ¶
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 ¶
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 ¶
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 ¶
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.