data

package
v0.0.0-...-5bbd4bc Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CalcHash

func CalcHash(s string) []byte

func CheckPasswords

func CheckPasswords(password, hashedPassword string) bool

Types

type Cache

type Cache struct {
	// contains filtered or unexported fields
}

func NewCache

func NewCache() *Cache

func (*Cache) DeleteUserSession

func (cache *Cache) DeleteUserSession(cookie string) bool

func (*Cache) GetUserSession

func (cache *Cache) GetUserSession(cookie string) (*objects.User, bool)

func (*Cache) NewUserSession

func (cache *Cache) NewUserSession(user *objects.User) string

type Connection

type Connection struct {
	DB    Database
	Cache *Cache
}

func NewConnection

func NewConnection(database Database) *Connection

type Database

type Database interface {
	Login(email, password string) (user *objects.User, succeed bool, err error)
	Register(user *objects.User) (succeed bool, err error)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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