helpers

package
v0.0.0-...-2d54f71 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 26, 2020 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Query = map[string]string{
	"login":    "SELECT * FROM users WHERE username = ?",
	"register": "INSERT INTO users (username, password) VALUES (?, ?)",
}

Functions

func CheckPasswordHash

func CheckPasswordHash(password, hash string) bool

func Connect

func Connect() (*sql.DB, error)

func HashPassword

func HashPassword(password string) (string, error)

func Headers

func Headers(w *http.ResponseWriter)

func InitCache

func InitCache() redis.Conn

Types

type Response

type Response struct {
	Status bool        `json:"status"`
	Body   interface{} `json:"body"`
}

func ResponseMsg

func ResponseMsg(status bool, body interface{}) *Response

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL