Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetNumber ¶ added in v1.1.0
GetNumber returns the number value for the given key.
returns the default value if:
- the library was not initiated;
- the key was not found;
- the key value is empty;
- the key value is not a boolean.
func GetString ¶ added in v1.1.0
GetString returns the string value for the given key.
returns the default value if:
- the library was not initiated;
- the key was not found;
- the key value is empty.
func IsEnabled ¶
IsEnabled checks if given feature key is enabled in redis DB.
returns the default value if:
- the library was not initiated;
- the key was not found;
- the key value is empty;
- the key value is not a boolean.
func IsEnabledByPercent ¶ added in v1.1.0
IsEnabledByPercent checks the redis key value for a percentage number (between 0 and 100), calculates an random number (also between 0 and 100), and returns true or false depending whether the calculated number is within the found percentage.
returns false if:
- the library was not initiated;
- the key was not found;
- the key value is empty;
- the key value is not a percentage (number between 0 and 100);
- the random number greater than the found percentage.