util

package
v2.0.0 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2023 License: GPL-3.0 Imports: 10 Imported by: 1

Documentation

Index

Constants

View Source
const (
	EnvVarBotTeam         = "BOT_TEAM"
	EnvVarBotNumber       = "BOT_NUMBER"
	EnvVarBotGrpcUrl      = "BOT_GRPC_URL"
	EnvVarBotGrpcInsecure = "BOT_GRPC_INSECURE"
	EnvVarBotToken        = "BOT_TOKEN"
)

Variables

This section is empty.

Functions

func DefaultLogger

func DefaultLogger(config Config) (*zap.SugaredLogger, error)

DefaultLogger creates a logger that is compatible with the lugo4go.Handler expected logger. The bots are NOT obligated to use this logger though. You may implement your own logger.

Types

type Config

type Config struct {
	// Full url to the gRPC server
	GRPCAddress     string          `json:"grpc_address"`
	Insecure        bool            `json:"insecure"`
	Token           string          `json:"token"`
	TeamSide        proto.Team_Side `json:"-"`
	Number          uint32          `json:"-"`
	InitialPosition *proto.Point    `json:"-"`
	// contains filtered or unexported fields
}

Config is the set of values expected as a initial configuration of the player

func DefaultInitBundle

func DefaultInitBundle() (Config, *zap.SugaredLogger, error)

DefaultInitBundle created a basic configuration that may be used by the client to connect to the server. It also creates a logger that is compatible with the lugo4go.Handler.

func (*Config) LoadConfig

func (c *Config) LoadConfig(args []string) error

Jump to

Keyboard shortcuts

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