util

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BooleanValueOr

func BooleanValueOr(ptr *bool, varName, defaultVal string) bool

BooleanValueOr returns a de-referenced boolean pointer, an environment variable, or a fallback

func GetEnv

func GetEnv(varName, defaultVal string) string

GetEnv looks up an environment with a fallback default

func IPMonitored added in v0.8.0

func IPMonitored(publicIP string, allowed, blocked []string) bool

IPMonitored considers configured allowed and blocked ip addresses and inspects a clients public ip address to determine if it should be used for speed and connectivity testing

func PublicIP added in v0.8.0

func PublicIP() (string, error)

PublicIP uses an open api to retrieve the clients public ip address

func ValueOr

func ValueOr(ptr *string, varName, defaultVal string) string

ValueOr returns a de-referenced string pointer, an environment variable, or a fallback

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳