params

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2025 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package params reads params from a json file.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetDecimals

func GetDecimals(name string) int

GetDecimals gets the number of decimals for a given parameter.

func GetMax

func GetMax(name string) float64

GetMax gets the maximum value of a given param.

func GetMin

func GetMin(name string) float64

GetMin gets the minimum value of a named param.

func GetParam

func GetParam(name string) (float64, float64, float64)

GetParam gets the min, max and value of a given parameter.

func GetValue

func GetValue(name string) float64

GetValue gets a named param's value.

func List

func List() []string

List lists all parameters.

func LoadParams

func LoadParams(filepath string)

LoadParams loads the params from an external json file.

Types

type Param

type Param struct {
	Min      float64 `json:"min"`
	Max      float64 `json:"max"`
	Value    float64 `json:"value"`
	Decimals int     `json:"decimals"`
}

Param represents a single parameter.

type Params

type Params map[string]*Param

Params is a list of Params.

Jump to

Keyboard shortcuts

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