utils

package
v0.0.0-...-05c6c3e Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConstrainValue

func ConstrainValue(input int, minimumValue int, maximumValue int) int

func FetchOutboundIP

func FetchOutboundIP() (net.IP, error)

Get preferred outbound ip of this machine

func Makedir

func Makedir(folder string) string

Create a folder on disk if it does not already exsist

func MapAndConstrainValueCeil

func MapAndConstrainValueCeil(x int, in_min int, in_max int, out_min int, out_max int) int

func MapValueCeil

func MapValueCeil(x int, in_min int, in_max int, out_min int, out_max int) int

func ReadJson

func ReadJson(data interface{}, fileName string)

Reads the JSON file into data and creates a new file if not found

func ReadResourceFile

func ReadResourceFile(fileName string) []byte

Read contents from embedded file

func TrimExplode

func TrimExplode(str string, token string) []string

func UpdateJson

func UpdateJson(data interface{}, fileName string)

updates the Json

Types

This section is empty.

Jump to

Keyboard shortcuts

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