config

package
v0.0.0-...-b32a2c2 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2018 License: GPL-3.0 Imports: 10 Imported by: 12

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Base      = home + "/.primes/"
	Directory = Base + "directory.txt"

	LocalConfig   = Config{}
	StartingPrime string
	MaxFilesize   int
	MaxBufferSize int
	ShowFails     bool
	Host          string

	Port                 = "8080"
	Address              string
	AssignmentPoint      = "/"
	ReturnPoint          = "/finished"
	HeavyAssignmentPoint = "/heavy"
	HeavyReturnPoint     = "/heavy/finished"

	Id                 uint64
	LastPrimeGenerated *big.Int

	Logger = log.New(os.Stdout, "", log.LstdFlags)
)

Functions

func EnsureUserWantsNewConfig

func EnsureUserWantsNewConfig()

EnsureUserWantsNewConfig ensures user wants a new config and if so, runs the configurator

func GetUserHome

func GetUserHome() string

GetUserHome returns the current user's home directory

func IsConfigured

func IsConfigured() bool

IsConfigured returns whether the program is configured already

func RunConfigurator

func RunConfigurator()

RunConfigurator generates a program configuration according to user input

Types

type Config

type Config struct {
	Base          string `json:"base"`
	StartingPrime string `json:"startingprime"`
	MaxFilesize   int    `json:"maxfilesize"`
	MaxBufferSize int    `json:"maxbuffersize"`
	ShowFails     bool   `json:"showfails"`
	ServerIP      string `json:"serverip"`
}

func GetUserConfig

func GetUserConfig() Config

GetUserConfig returns a Config object containing the user's configuration

Jump to

Keyboard shortcuts

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