Documentation ¶
Index ¶
- func CompareHash(hash []byte, password []byte) error
- func CreateEmailVerficationToken()
- func Find(slice []string, val string) (int, bool)
- func GenerateDigits(max int) string
- func GenerateJWTToken(privateKeydata []byte, claim TokenClaims, expireOffsetHour int64) (string, error)
- func GetFilesContents(files ...string) map[string][]byte
- func GetIPAdress(r *http.Request) string
- func GetInterfaceType(input interface{}) string
- func GetInterfaceTypeLower(input interface{}) string
- func GetPrettyURL() string
- func GetPrettyURLf(url string) string
- func GetType(s string) string
- func GetTypeLowerFirst(s string) string
- func Hash(text string) ([]byte, error)
- func IsTimeExpired(timestamp int64, offsetInSeconds float64) bool
- func IsTimeExpiredInTime(tt time.Time, offsetInSeconds float64) bool
- func LowerFirst(s string) string
- func MarshalError(code string, message string) []byte
- func MomentToTime(moment string) (time.Time, error)
- func ParseHtmlBytesTemplate(templateFilePath string, data interface{}) ([]byte, error)
- func ParseHtmlTemplate(templateFilePath string, data interface{}) (string, error)
- func ReadSecret(key string) (string, error)
- func TimeUnix(inputTime time.Time) int64
- func UTCNowUnix() int64
- func UTCUnixToTime(timestamp int64) time.Time
- func ValidateToken(keydata []byte, token string) (jwt.MapClaims, error)
- type Email
- type ErrorCodeMessage
- type PhoneClient
- type Recaptcha
- type RecaptchaResponse
- type Request
- type TelarError
- type TokenClaims
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CompareHash ¶
CompareHash if hash and plan are equal
func CreateEmailVerficationToken ¶
func CreateEmailVerficationToken()
func Find ¶ added in v0.1.4
Find takes a slice and looks for an element in it. If found it will return it's key, otherwise it will return -1 and a bool of false.
func GenerateDigits ¶
GenerateDigits generate fix length of digits
func GenerateJWTToken ¶
func GenerateJWTToken(privateKeydata []byte, claim TokenClaims, expireOffsetHour int64) (string, error)
GenerateJWTToken
func GetFilesContents ¶
func GetIPAdress ¶
GetIPAdress get request source ip address
func GetInterfaceType ¶
func GetInterfaceType(input interface{}) string
GetInterfaceType get inteface type
func GetInterfaceTypeLower ¶
func GetInterfaceTypeLower(input interface{}) string
GetInterfaceType get inteface type
func GetPrettyURLf ¶
GetPrettyURL formats according to pretty URL from (baseFunctionURL+url) and returns the resulting string.
func GetTypeLowerFirst ¶
GetTypeLowerFirst get inteface type without package name with lowercase first character
func IsTimeExpired ¶
IsTimeExpired check time expiration in unix
func IsTimeExpiredInTime ¶
IsTimeExpired check time expiration in golang time
func LowerFirst ¶
LowerFirst lower case the first character of string
func MarshalError ¶
func MomentToTime ¶
MomentToTime Covert moment unix to time.Time
func ParseHtmlBytesTemplate ¶
ParseHtmlBytesTemplate parse html template return in []byte
func ParseHtmlTemplate ¶
ParseHtmlTemplate parse html template return in string
func ReadSecret ¶
ReadSecret reads a secret from /var/openfaas/secrets or from env-var 'secret_mount_path' if set.
func UTCUnixToTime ¶
UTCUnixToTime Get UTC unix time in go time
func ValidateToken ¶
ValidateToken
Types ¶
type ErrorCodeMessage ¶ added in v0.1.11
type PhoneClient ¶
type PhoneClient struct {
// contains filtered or unexported fields
}
type Recaptcha ¶
type Recaptcha struct {
// contains filtered or unexported fields
}
func NewRecaptha ¶
Init allows the webserver or code evaluating the reCaptcha form input to set the reCaptcha private key (string) value, which will be different for every domain.
type RecaptchaResponse ¶
type Request ¶
type Request struct {
// contains filtered or unexported fields
}
Request struct
func NewEmailRequest ¶
type TelarError ¶ added in v0.1.11
type TelarError struct {
Error ErrorCodeMessage `json:"error"`
}
func Error ¶ added in v0.1.11
func Error(code string, message string) TelarError
type TokenClaims ¶
type TokenClaims struct { // Meta data Claim interface{} `json:"claim"` // Inherit from standard claims jwt.StandardClaims }