dao

package
v0.0.0-...-af16168 Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2018 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AuthDaoInit

func AuthDaoInit(sqlSelectFieldsAccount string)

func GenerateRandomBytes

func GenerateRandomBytes(n int) ([]byte, error)

func GenerateRandomString

func GenerateRandomString(s int) (string, error)

GenerateRandomString returns a URL-safe, base64 encoded securely generated random string. It will return an error if the system's secure random number generator fails to function correctly, in which case the caller should not continue.

Types

type Auth

type Auth struct {
	Model models.Session
	// contains filtered or unexported fields
}
var AuthDao *Auth

func (*Auth) Authentication

func (s *Auth) Authentication(w http.ResponseWriter, r *http.Request) (*entity.Account, string)

func (*Auth) Cryptcode

func (s *Auth) Cryptcode(text string) string

func (*Auth) DeleteSession

func (s *Auth) DeleteSession(sessionId string, w http.ResponseWriter)

func (*Auth) Generate_password

func (s *Auth) Generate_password() string

func (*Auth) Generate_pinCode

func (s *Auth) Generate_pinCode() string

func (*Auth) GetCookie

func (s *Auth) GetCookie(cookieName string, r *http.Request) string

func (*Auth) GetIP

func (s *Auth) GetIP(r *http.Request) string

func (*Auth) Rand_char

func (s *Auth) Rand_char(length int, chars []byte) string

func (*Auth) SendEmail

func (s *Auth) SendEmail(subject, to, body string)

func (*Auth) SetSession

func (s *Auth) SetSession(account *entity.Account, r *http.Request, w http.ResponseWriter)

Jump to

Keyboard shortcuts

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