config

package
v0.0.0-...-25a9806 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2021 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Path = filepath.FromSlash("./flipconfig.json")

	DefaultConfig = Config{
		Initialized: false,
		State: State{
			TestType:         "iteration",
			TestCounter:      0,
			Iterations:       0,
			VariablesChanged: 0,
			Duration:         time.Duration(0),
			StartTime:        time.Now().Unix(),
			RateIndex:        0,
			ErrorRates:       "0.1",
		},
		Server: Server{
			Post: false,
			Host: "http://localhost:5000",
		},
	}
)

Functions

func AtoF64Arr

func AtoF64Arr(params ...string) ([]float64, error)

params[0] would be the array and params[1] a number to avoid

func RunConfig

func RunConfig()

func WriteConfig

func WriteConfig(cfg Config) error

Types

type Config

type Config struct {
	Initialized bool   `json:"initialized"`
	State       State  `json:"state_variables"`
	Server      Server `json:"server"`
}

func ReadConfig

func ReadConfig() (Config, error)

type Server

type Server struct {
	Post bool   `json:"post"`
	Host string `json:"host"`
}

type State

type State struct {
	TestType         string        `json:"test_type"`
	TestCounter      int           `json:"test_counter"`
	Iterations       int           `json:"iterations"`
	VariablesChanged int           `json:"variables_changed"`
	Duration         time.Duration `json:"duration"`
	StartTime        int64         `json:"start_time"`
	RateIndex        int           `json:"rate_index"`
	ErrorRates       string        `json:"error_rates"`
}

Jump to

Keyboard shortcuts

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