database

package
v0.0.20 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2022 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNoSuchRecord = errors.New("No Such Record")
)

Functions

func NextId

func NextId() int64

Types

type InMemory

type InMemory struct {
	sync.RWMutex
	AccountId         map[string]int64
	AccountEmail      map[string]string
	AccountUsername   map[string]string
	AccountPassword   map[string][]byte
	AccountVerified   map[string]bool
	AccountCreated    map[string]time.Time
	AccountDeleted    map[string]time.Time
	SignupToken       map[string]bool
	SignupCreated     map[string]time.Time
	SignupEmail       map[string]string
	SignupUsername    map[string]string
	SignupReferrer    map[string]string
	SignupChallenge   map[string]string
	SignupError       map[string]string
	SigninToken       map[string]bool
	SigninCreated     map[string]time.Time
	SigninUsername    map[string]string
	SigninAuth        map[string]bool
	SigninError       map[string]string
	ResetToken        map[string]bool
	ResetCreated      map[string]time.Time
	ResetUsername     map[string]string
	ResetError        map[string]string
	RecoveryToken     map[string]bool
	RecoveryCreated   map[string]time.Time
	RecoveryEmail     map[string]string
	RecoveryUsername  map[string]string
	RecoveryChallenge map[string]string
	RecoveryError     map[string]string
}

func NewInMemory

func NewInMemory() *InMemory

func (*InMemory) ChangePassword

func (db *InMemory) ChangePassword(username string, password []byte) (int64, error)

func (*InMemory) Close

func (db *InMemory) Close() error

func (*InMemory) CreateAccountPasswordSession

func (db *InMemory) CreateAccountPasswordSession(token string, username string, created time.Time) (int64, error)

func (*InMemory) CreateAccountRecoverySession

func (db *InMemory) CreateAccountRecoverySession(token string, created time.Time) (int64, error)

func (*InMemory) CreateSignInSession

func (db *InMemory) CreateSignInSession(token string, username string, authenticated bool, created time.Time) (int64, error)

func (*InMemory) CreateSignUpSession

func (db *InMemory) CreateSignUpSession(token string, created time.Time) (int64, error)

func (*InMemory) CreateUser

func (db *InMemory) CreateUser(email, username string, password []byte, created time.Time) (int64, error)

func (*InMemory) DeactivateUser added in v0.0.16

func (db *InMemory) DeactivateUser(username string, deleted time.Time) (int64, error)

func (*InMemory) IsEmailVerified

func (db *InMemory) IsEmailVerified(email string) (bool, error)

func (*InMemory) Ping

func (db *InMemory) Ping() error

func (*InMemory) SelectAccountPasswordSession

func (db *InMemory) SelectAccountPasswordSession(token string) (string, string, time.Time, error)

func (*InMemory) SelectAccountRecoverySession

func (db *InMemory) SelectAccountRecoverySession(token string) (string, string, string, string, time.Time, error)

func (*InMemory) SelectSignInSession

func (db *InMemory) SelectSignInSession(token string) (string, string, time.Time, bool, error)

func (*InMemory) SelectSignUpSession

func (db *InMemory) SelectSignUpSession(token string) (string, string, string, string, string, time.Time, error)

func (*InMemory) SelectUser

func (db *InMemory) SelectUser(username string) (int64, string, []byte, time.Time, error)

func (*InMemory) SelectUsernameByEmail added in v0.0.8

func (db *InMemory) SelectUsernameByEmail(email string) (string, error)

func (*InMemory) SetEmailVerified

func (db *InMemory) SetEmailVerified(email string, verified bool) (int64, error)

func (*InMemory) UpdateAccountPasswordSessionError

func (db *InMemory) UpdateAccountPasswordSessionError(token, errmsg string) (int64, error)

func (*InMemory) UpdateAccountRecoverySessionChallenge

func (db *InMemory) UpdateAccountRecoverySessionChallenge(token, challenge string) (int64, error)

func (*InMemory) UpdateAccountRecoverySessionEmail

func (db *InMemory) UpdateAccountRecoverySessionEmail(token, email string) (int64, error)

func (*InMemory) UpdateAccountRecoverySessionError

func (db *InMemory) UpdateAccountRecoverySessionError(token, errmsg string) (int64, error)

func (*InMemory) UpdateAccountRecoverySessionUsername

func (db *InMemory) UpdateAccountRecoverySessionUsername(token, username string) (int64, error)

func (*InMemory) UpdateSignInSessionAuthenticated

func (db *InMemory) UpdateSignInSessionAuthenticated(token string, authenticated bool) (int64, error)

func (*InMemory) UpdateSignInSessionError

func (db *InMemory) UpdateSignInSessionError(token, errmsg string) (int64, error)

func (*InMemory) UpdateSignInSessionUsername

func (db *InMemory) UpdateSignInSessionUsername(token, username string) (int64, error)

func (*InMemory) UpdateSignUpSessionChallenge

func (db *InMemory) UpdateSignUpSessionChallenge(token, challenge string) (int64, error)

func (*InMemory) UpdateSignUpSessionError

func (db *InMemory) UpdateSignUpSessionError(token string, errmsg string) (int64, error)

func (*InMemory) UpdateSignUpSessionIdentity

func (db *InMemory) UpdateSignUpSessionIdentity(token, email, username string) (int64, error)

func (*InMemory) UpdateSignUpSessionReferrer added in v0.0.14

func (db *InMemory) UpdateSignUpSessionReferrer(token, referrer string) (int64, error)

Jump to

Keyboard shortcuts

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