advantages

package
v0.0.0-...-de70ca6 Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConfigSaverUsage

func ConfigSaverUsage()

Usage

func Int

func Int() int

Int returns a non-negative pseudo-random int from the default Source.

func SaveConfig

func SaveConfig(filename string, cfg *Config) error

func SaveConfigInjected

func SaveConfigInjected(writer fileWriter, filename string, cfg *Config) error

func SaveConfigInjectedUsage

func SaveConfigInjectedUsage()

Usage

func SaveConfigPatched

func SaveConfigPatched(filename string, cfg *Config) error

func SaveConfigPatchedUsage

func SaveConfigPatchedUsage()

Usage

Types

type Config

type Config struct {
	Host string
	Port int
}

type ConfigSaver

type ConfigSaver struct {
	FileWriter func(filename string, data []byte, perm os.FileMode) error
}

func (ConfigSaver) Save

func (c ConfigSaver) Save(filename string, cfg *Config) error

type Rand

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

A Rand is a source of random numbers.

func New

func New(src Source) *Rand

New returns a new Rand that uses random values from src to generate other random values.

func (*Rand) Int

func (r *Rand) Int() int

Int returns a non-negative pseudo-random int.

type Source

type Source interface {
	Int63() int64
}

A Source represents a source of uniformly-distributed pseudo-random int64 values in the range [0, 1<<63).

Jump to

Keyboard shortcuts

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