gate

package
v0.12.1 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2021 License: Apache-2.0 Imports: 17 Imported by: 1

Documentation

Overview

Package Gate is the main package for running one or more Minecraft proxy editions.

Index

Constants

This section is empty.

Variables

View Source
var Viper = viper.New()

Viper is a viper instance initialized with defaults for the Config struct. It can be used to load in config files.

Functions

func Start

func Start(stop <-chan struct{}) (err error)

Start is a convenience function to setup 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).

func New

func New(options Options) (gate *Gate, err error)

New returns a new Gate instance. The given Options requires a validated Config.

func (*Gate) Bedrock

func (g *Gate) Bedrock() *bproxy.Proxy

Bedrock returns the Bedrock edition proxy, or nil if none.

func (*Gate) Java

func (g *Gate) Java() *jproxy.Proxy

Java returns the Java edition proxy, or nil if none.

func (*Gate) Start

func (g *Gate) Start(stop chan struct{}) error

Start starts the Gate instance and all potential sub-components.

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
	// Logger is the logger used for Gate
	// and potential sub-components.
	// If not set, no logging is done.
	Logger logr.Logger
}

Options are Gate options.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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