ivy: robpike.io/ivy/config Index | Files

package config

import "robpike.io/ivy/config"

Index

Package Files

config.go

Variables

var DebugFlags = [...]string{
    "cpu",
    "panic",
    "parse",
    "tokens",
    "types",
}

Order here determines order in the Config.debug array.

type Config Uses

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

A Config holds information about the configuration of the system. The zero value of a Config represents the default values for all settings.

func (*Config) Base Uses

func (c *Config) Base() (inputBase, outputBase int)

Base returns the input and output bases.

func (*Config) BigOrigin Uses

func (c *Config) BigOrigin() *big.Int

BigOrigin returns the index origin as a *big.Int.

func (*Config) CPUTime Uses

func (c *Config) CPUTime() time.Duration

CPUTime returns the duration of the last interactive operation.

func (*Config) Debug Uses

func (c *Config) Debug(flag string) bool

Debug returns the value of the specified boolean debugging flag.

func (*Config) ErrOutput Uses

func (c *Config) ErrOutput() io.Writer

ErrOutput returns the writer to be used for error output.

func (*Config) FloatFormat Uses

func (c *Config) FloatFormat() (verb byte, prec int, ok bool)

FloatFormat returns the parsed information about the format, if it's a floating-point format.

func (*Config) FloatPrec Uses

func (c *Config) FloatPrec() uint

FloatPrec returns the floating-point precision in bits. The exponent size is fixed by math/big.

func (*Config) Format Uses

func (c *Config) Format() string

Format returns the formatting string. If empty, the default formatting is used, as defined by the bases.

func (*Config) InputBase Uses

func (c *Config) InputBase() int

InputBase returns the input base.

func (*Config) MaxBits Uses

func (c *Config) MaxBits() uint

MaxBits returns the maximum integer size to store, in bits.

func (*Config) MaxDigits Uses

func (c *Config) MaxDigits() uint

MaxDigits returns the maximum integer size to print as integer, in digits.

func (*Config) Origin Uses

func (c *Config) Origin() int

Origin returns the index origin, default 1.

func (*Config) Output Uses

func (c *Config) Output() io.Writer

Output returns the writer to be used for program output.

func (*Config) OutputBase Uses

func (c *Config) OutputBase() int

OutputBase returns the output base.

func (*Config) PrintCPUTime Uses

func (c *Config) PrintCPUTime() string

PrintCPUTime returns a nicely formatted version of the CPU time, with 3 decimal places in whatever unit best fits. The default String method for Duration prints too many decimals.

func (*Config) Prompt Uses

func (c *Config) Prompt() string

Prompt returns the interactive prompt.

func (*Config) Random Uses

func (c *Config) Random() *rand.Rand

Random returns the generator for random numbers.

func (*Config) RatFormat Uses

func (c *Config) RatFormat() string

Format returns the formatting string for rationals.

func (*Config) SetBase Uses

func (c *Config) SetBase(inputBase, outputBase int)

SetBase sets the input and output bases.

func (*Config) SetCPUTime Uses

func (c *Config) SetCPUTime(d time.Duration)

SetCPUTime sets the duration of the last interactive operation.

func (*Config) SetDebug Uses

func (c *Config) SetDebug(flag string, state bool) bool

SetDebug sets the value of the specified boolean debugging flag. It returns false if the flag is unknown.

func (*Config) SetErrOutput Uses

func (c *Config) SetErrOutput(output io.Writer)

SetErrOutput sets the writer to which error output is printed; default is os.Stderr.

func (*Config) SetFloatPrec Uses

func (c *Config) SetFloatPrec(prec uint)

SetFloatPrec sets the floating-point precision in bits.

func (*Config) SetFormat Uses

func (c *Config) SetFormat(s string)

SetFormat sets the formatting string. Rational formatting is just this format applied twice with a / in between.

func (*Config) SetMaxBits Uses

func (c *Config) SetMaxBits(digits uint)

MaxBits sets the maximum integer size to store, in bits.

func (*Config) SetMaxDigits Uses

func (c *Config) SetMaxDigits(digits uint)

SetMaxDigits sets the maximum integer size to print as integer, in digits.

func (*Config) SetOrigin Uses

func (c *Config) SetOrigin(origin int)

SetOrigin sets the index origin.

func (*Config) SetOutput Uses

func (c *Config) SetOutput(output io.Writer)

SetOutput sets the writer to which program output is printed; default is os.Stdout.

func (*Config) SetPrompt Uses

func (c *Config) SetPrompt(prompt string)

SetPrompt sets the interactive prompt.

func (*Config) SetRandomSeed Uses

func (c *Config) SetRandomSeed(seed int64)

SetRandomSeed sets the seed for the random number generator.

Package config imports 8 packages (graph) and is imported by 9 packages. Updated 2016-07-17. Refresh now. Tools for package owners.