Documentation ¶
Index ¶
- func ComparePasswordAndHash(password string, hash []byte) bool
- func GenerateRandomString(length int) string
- func HashPassword(pass []byte) ([]byte, error)
- func MustGetEnv(key string) string
- func MustParseEnvKey(env string, size int) []byte
- func NewRequestID(len int) ([]byte, error)
- func ParseSignedPayload(p []byte) (string, []byte, error)
- func ReturnError(w http.ResponseWriter, err types.ResponseError)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ComparePasswordAndHash ¶
ComparePasswordAndHash checks hash of password, returns true if they match, otherwise false
func GenerateRandomString ¶
GenerateRandomString generates random string and returns it
func HashPassword ¶
HashPassword hashes password with bcrypt
func MustParseEnvKey ¶
MustParseEnvKey parses base64 encoded public key, useful when you load it from ENV
Panics when ENV does not exists, or length is invalid
func NewRequestID ¶
NewRequestID creates new random RequestID and returns it
func ParseSignedPayload ¶
ParseSignedPayload parses payload, returns respectively message and signature
func ReturnError ¶
func ReturnError(w http.ResponseWriter, err types.ResponseError)
ReturnError takes http.ResponseWriter and writes err to it
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.