Documentation ¶
Index ¶
Constants ¶
const ( File = "file" Yaml = "yaml" Properties = "properties" Ini = "ini" Json = "json" Xml = "xml" )
The file parsing options that are available for a server configuration file.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConfigurationFile ¶
type ConfigurationFile struct { FileName string `json:"file"` Parser ConfigurationParser `json:"parser"` Replace []ConfigurationFileReplacement `json:"replace"` // contains filtered or unexported fields }
Defines a configuration file for the server startup. These will be looped over and modified before the server finishes booting.
func (*ConfigurationFile) IterateOverJson ¶
func (f *ConfigurationFile) IterateOverJson(data []byte) (*gabs.Container, error)
Iterate over an unstructured JSON/YAML/etc. interface and set all of the required key/value pairs for the configuration file.
We need to support wildcard characters in key searches, this allows you to make modifications to multiple keys at once, especially useful for games with multiple configurations per-world (such as Spigot and Bungeecord) where we'll need to make adjustments to the bind address for the user.
This does not currently support nested matches. container.*.foo.*.bar will not work.
func (*ConfigurationFile) LookupConfigurationValue ¶
func (f *ConfigurationFile) LookupConfigurationValue(cfr ConfigurationFileReplacement) ([]byte, jsonparser.ValueType, error)
Looks up a configuration value on the Daemon given a dot-notated syntax.
type ConfigurationFileReplacement ¶
type ConfigurationFileReplacement struct { Match string `json:"match"` Value string `json:"value"` ValueType jsonparser.ValueType `json:"-"` }
Defines a single find/replace instance for a given server configuration file.
func (*ConfigurationFileReplacement) UnmarshalJSON ¶
func (cfr *ConfigurationFileReplacement) UnmarshalJSON(data []byte) error
type ConfigurationParser ¶
type ConfigurationParser string