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 uses the logr.Logger from the provided context, reads in a Config, validates it and sets up os signal handling before starting the instance.
The Gate is shutdown when the context is canceled or on occurrence of any significant error like severe configuration error or unable to bind to a port.
Config validation warnings are logged but ignored.
Types ¶
type Gate ¶
type Gate struct {
// contains filtered or unexported fields
}
Gate is the root holder of various child processes.
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)
StartOption is an option for Start.
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.