Documentation ¶
Overview ¶
Package gate is the main package for running one or more Minecraft proxy editions.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var Viper = viper.New()
Viper is the default viper instance used by Start to load in a config.Config.
Functions ¶
func LoadConfig ¶ added in v0.19.0
LoadConfig loads in config.Config from viper. It is used by Start with the packages Viper if no WithConfig option is given.
func Start ¶
func Start(ctx context.Context, opts ...StartOption) error
Start is a convenience function to set up and run a Gate instance.
It sets up a Logger, reads in a Config, validates it and sets up os signal handling before starting the instance.
The Gate is shutdown on stop channel close or on occurrence of any significant error. Config validation warnings are logged but ignored.
Types ¶
type Gate ¶
type Gate struct {
// contains filtered or unexported fields
}
Gate manages one or multiple proxy editions (Bedrock & Java).
type Options ¶
type Options struct { // Config requires a valid Gate configuration. Config *config.Config // The event manager to use. // If none is set, no events are sent. EventMgr event.Manager }
Options are Gate options.
type StartOption ¶ added in v0.19.0
type StartOption func(o *startOptions)
func WithAutoShutdownOnSignal ¶ added in v0.20.3
func WithAutoShutdownOnSignal(enabled bool) StartOption
WithAutoShutdownOnSignal StartOption for Start that automatically shuts down the Gate instance when a shutdown signal is received.
This setting is enabled by default.
func WithConfig ¶ added in v0.19.0
func WithConfig(c config.Config) StartOption
WithConfig StartOption for Start.