utils

package
v0.0.0-...-065606b Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2020 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EnvHueBridgeAddress  = "HUE_BRIDGE_ADDRESS"
	EnvHueBridgeUsername = "HUE_BRIDGE_USERNAME"
	EnvHueRemoteToken    = "HUE_REMOTE_TOKEN"
	EnvRedisURL          = "REDIS_URL"
	EnvPort              = "PORT"
)

Exported constants for the environment variables that this application cares about

Variables

This section is empty.

Functions

func CheckEnv

func CheckEnv(lookupFunc func(key string) (string, bool)) (err error)

CheckEnv checks that the right keys are present in the environment. Optionally takes a lookup function and falls back to os.LookupEnv if one is not provided

func GetPort

func GetPort(lookupFunc func(key string) (string, bool)) string

GetPort either reads the port from the environment variable called PORT or returns a default, which is 8080

func MiredToTemp

func MiredToTemp(mired uint16) uint16

MiredToTemp converts a mired value to a color temperature

func RedisPing

func RedisPing(client radix.Client) (string, error)

RedisPing determines if there is a redis server sitting and listening at the address provided by the REDIS_URL environment variable.

func TempToMired

func TempToMired(temp uint16) uint16

TempToMired converts a color temperature to a mired value that Hue will accept

func ValidateColorArray

func ValidateColorArray(ca []int) bool

ValidateColorArray returns true for a valid 3-pair array of octets representing RGB values

func ValidateColorString

func ValidateColorString(cs string) bool

ValidateColorString returns true for valid hex color strings that start with # and have 6 hex digits

Types

This section is empty.

Jump to

Keyboard shortcuts

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