userlandtest

package
v0.0.0-...-8717a1f Latest Latest
Warning

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

Go to latest
Published: Jan 1, 2020 License: GPL-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DefaultSessionUserID     = 1
	DefaultSessionExpiration = security.UserAccessTokenExpiration
)
View Source
var (
	DefaultUserEmail    = "adhitya.ramadhanus@gmail.com"
	DefaultUserPassword = "test123"
)

Functions

func TestCreateSession

func TestCreateSession(t *testing.T, sr userland.SessionRepository, opts ...func(*SessionCreateConfig)) userland.Session

func TestCreateSessions

func TestCreateSessions(t *testing.T, sr userland.SessionRepository, opts ...func(*SessionCreateConfig)) []userland.Session

func TestCreateTFAEnabledUser

func TestCreateTFAEnabledUser(t *testing.T, ur userland.UserRepository, opts ...func(user *userland.User)) *userland.User

func TestCreateUser

func TestCreateUser(t *testing.T, ur userland.UserRepository, opts ...func(user *userland.User)) *userland.User

func Verified

func Verified(verified bool) func(user *userland.User)

func WithExpiration

func WithExpiration(exp time.Duration) func(*SessionCreateConfig)

func WithNumberOfSessions

func WithNumberOfSessions(num int) func(*SessionCreateConfig)

func WithUserEmail

func WithUserEmail(email string) func(user *userland.User)

func WithUserID

func WithUserID(userID int) func(*SessionCreateConfig)

func WithUserPassword

func WithUserPassword(password string) func(user *userland.User)

Types

type SessionCreateConfig

type SessionCreateConfig struct {
	UserID           int
	NumberOfSessions int
	Expiration       time.Duration
}

Jump to

Keyboard shortcuts

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