Documentation ¶
Index ¶
- Constants
- func CalculateDroneWeightLimit(model dto.DroneModel) float64
- func Checksum(algorithm string, data []byte) (checksum string, err error)
- func ComputeDID(data string) (string, error)
- func ConcatenateBytes(data ...[]byte) []byte
- func Contains(arr []string, elem string) bool
- func DeepCopy(v interface{}) (interface{}, error)
- func FileExists(filename string) (bool, error)
- func GenerateUUIDBytes() []byte
- func GenerateUUIDFormatDate() string
- func GenerateUUIDStr() string
- func GetBoolOrDefault(value string, defaultVal bool) bool
- func GetEnvOrDefault(env, defaultVal string) string
- func GetEnvOrError(key string) string
- func GetFilesByExt(root, ext string) []string
- func GetFilesByName(root, fileNeme string) []string
- func InitValidator()
- func MapToSlice(dMap map[string]string) []string
- func MkAccessToken(data *dto.AccessTokenData, sigKey []byte, tkAge uint8) ([]byte, error)
- func NormalizeString(text string, upper bool) string
- func SliceToMap(slice []string, dMap map[string]string)
- func TrimDoubleQuotes(text string) string
- func Unique(input []interface{}) []interface{}
- func UniqueStrings(input []string) []string
- func UpdateJSON(request interface{}, stateDB interface{}) ([]byte, error)
- func ValidateSerialNumberDrone(serialNumber string) bool
- func ValidateString(data string, regexp string) bool
- func ValidateStringCollection(data []interface{}, regexp string) bool
Constants ¶
const SHA256 = "SHA256"
Variables ¶
This section is empty.
Functions ¶
func CalculateDroneWeightLimit ¶
func CalculateDroneWeightLimit(model dto.DroneModel) float64
func Checksum ¶
Checksum returns the checksum of some data, using a specified algorithm. It only returns an error when an invalid algorithm is used. The valid ones are SHA256
func ComputeDID ¶
func ConcatenateBytes ¶
ConcatenateBytes is useful for combining multiple arrays of bytes, especially for signatures or digests over multiple fields
func FileExists ¶
func GenerateUUIDBytes ¶
func GenerateUUIDBytes() []byte
GenerateUUIDBytes returns a UUID based on RFC 4122 returning the generated bytes
func GenerateUUIDFormatDate ¶
func GenerateUUIDFormatDate() string
func GenerateUUIDStr ¶
func GenerateUUIDStr() string
GenerateUUIDStr returns a UUID based on RFC 4122
func GetBoolOrDefault ¶
GetBoolOrDefault Note that the method returns default value if the string cannot be parsed!
func GetEnvOrDefault ¶
func GetEnvOrError ¶
GetEnvOrError Check environment variable. If the environment variable does not exist, the panic function raised
func GetFilesByExt ¶
GetFilesByExt search recursively into the given root path, to seek the files that match the specified file extension
- root [string] ~ Root path to search in on
- ext [string] ~ File extension to look for
func GetFilesByName ¶
GetFilesByName search recursively into the given root path, to seek the files that match the specified file filename
- root [string] ~ Root path to search in on
- fileNeme [string] ~ File name to look for
func InitValidator ¶
func InitValidator()
InitValidator Activate behavior to require all fields and adding new validators
func MapToSlice ¶
func MkAccessToken ¶
MkAccessToken create a signed JTW token with the specified data. This could be used for authentication purpose by a middleware
func NormalizeString ¶
func SliceToMap ¶
func TrimDoubleQuotes ¶
func UniqueStrings ¶
func UpdateJSON ¶
func ValidateString ¶
ValidateString validate a string given a regular expression
func ValidateStringCollection ¶
ValidateStringCollection validate a string collection given a regular expression
Types ¶
This section is empty.