user

package
v0.0.0-...-500edce Latest Latest
Warning

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

Go to latest
Published: Jun 22, 2020 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	AllowSignup              bool
	LockOutTimeMinutes       time.Duration
	NLoginAttempts           int
	PasswordResetTimeMinutes time.Duration
}

type Service

type Service interface {
	GetUserForName(name string) (core.User, error)
	SearchUsers(prefix string) ([]core.User, error)
	GetUserForID(id int) (core.User, error)

	AuthenticateUser(username, password string) (int, error)
	ChangePassword(userid int, oldPassword, newPassword string) error
	UpdateOnlineTimestamp(userCtx int) error

	DeleteAccount(userID int) error
	CreateAccount(newUser core.User, password, serverAddr string) error
	ConfirmAccount(token string) (string, error)

	ResetPassword(recoveryUUID, newPassword string) (string, error)
	SendPasswordResetMail(emailAddress, baseURL, language string) error

	SaveAvatar(userID int, pathPrefix, fileType string, buffer []byte) error
	DeleteAvatar(pathPrefix string, userID int) error
	GetAvatar(userID int, pathPrefix string, nodefault bool) (string, time.Time, error)
}

func NewLoggingService

func NewLoggingService(logger log.Logger, s Service, verbose bool) Service

func NewService

func NewService(repo core.UserRepo, mailing core.MailingService, cfg Config) Service

NewService creates a new user managment service.

Jump to

Keyboard shortcuts

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