Documentation ¶
Index ¶
- Constants
- func CheckEnv(lookupFunc func(key string) (string, bool)) (err error)
- func GetPort(lookupFunc func(key string) (string, bool)) string
- func MiredToTemp(mired uint16) uint16
- func RedisPing(client radix.Client) (string, error)
- func TempToMired(temp uint16) uint16
- func ValidateColorArray(ca []int) bool
- func ValidateColorString(cs string) bool
Constants ¶
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 ¶
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 ¶
GetPort either reads the port from the environment variable called PORT or returns a default, which is 8080
func MiredToTemp ¶
MiredToTemp converts a mired value to a color temperature
func RedisPing ¶
RedisPing determines if there is a redis server sitting and listening at the address provided by the REDIS_URL environment variable.
func TempToMired ¶
TempToMired converts a color temperature to a mired value that Hue will accept
func ValidateColorArray ¶
ValidateColorArray returns true for a valid 3-pair array of octets representing RGB values
func ValidateColorString ¶
ValidateColorString returns true for valid hex color strings that start with # and have 6 hex digits
Types ¶
This section is empty.