util

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Add

func Add(file string, content []byte)

Add a file content to box

func Get

func Get(file string) ([]byte, bool)

Get a file from box

func GetAllOrbits

func GetAllOrbits() map[string]map[string]map[string][]int

GetAllOrbits Stellar orbits

func GetSatelliteOrbits

func GetSatelliteOrbits() map[string]map[string]int

GetSatelliteOrbits Get the satellite orbits tables

func Has

func Has(file string) bool

Has a file in box

func Interface2Int

func Interface2Int(intf interface{}) int

Interface2Int Convert interface{} to integer

func Intersect

func Intersect(a map[int]interface{}, b map[int]interface{}) map[int]interface{}

Intersect Get the intersection of 2 maps

func Logger

func Logger() *zerolog.Logger

func LookUpOrbit

func LookUpOrbit(dg *DiceGenerator, ring bool) int

LookUpOrbit Lookup the satellite orbits

func MaxInt

func MaxInt(nums ...int) int

MaxInt get the maximum integer value

func MinInt

func MinInt(nums ...int) int

MinInt get the minimum integer value

func ProcessError

func ProcessError(err error)

ProcessError Fatal errors

Types

type Config

type Config struct {
	LogLevel string `yaml:"loglevel" envconfig:"LOG_LEVEL"`
	Database string `yaml:"database" envconfig:"DATABASE"`
	Username string `yaml:"username" envconfig:"DBUSERNAME"`
	Password string `yaml:"password" envconfig:"DBPASSWORD"`
	Seed     string `yaml:"seed" envconfig:"RNG_SEED"`
}

Config Basic application configuration

func GetConfig

func GetConfig() Config

GetConfig Load App configuration

type DiceGenerator

type DiceGenerator struct {
	// contains filtered or unexported fields
}

DiceGenerator allows for rolling dice

func NewDiceGenerator

func NewDiceGenerator(seed string) DiceGenerator

NewDiceGenerator Create new DiceGenerator

func (*DiceGenerator) Roll

func (dg *DiceGenerator) Roll() int

Roll 2d6

func (*DiceGenerator) RollDice

func (dg *DiceGenerator) RollDice(dice int) int

RollDice Roll a specified number of dice

func (*DiceGenerator) RollDiceWithModifier

func (dg *DiceGenerator) RollDiceWithModifier(dice int, mod int) int

RollDiceWithModifier Roll an arbitrary number of d6 with a modifer at the end.

func (*DiceGenerator) Select

func (dg *DiceGenerator) Select(numElements int) int

Jump to

Keyboard shortcuts

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