profile

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: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	EventChangeEmailRequest = "user.profile.change_email_request"
	EventChangeEmail        = "user.profile.change_email"
	EventChangePassword     = "user.profile.change_password"
	EventEnableTFA          = "user.profile.enable_tfa"
	EventDisableTFA         = "user.profile.disable_tfa"

	ErrEmailAlreadyUsed  = errors.New("Email is already used")
	ErrWrongPassword     = errors.New("Wrong password")
	ErrTFAAlreadyEnabled = errors.New("TFA already enabled")
	ErrWrongOTP          = errors.New("Wrong OTP")
)
View Source
var (
	MetricKeys = []string{"method"}
)

Functions

func WithKeyValueService

func WithKeyValueService(keyValueService userland.KeyValueService) func(service *service)

func WithMailingClient

func WithMailingClient(mailingClient mailing.Client) func(service *service)

func WithObjectStorageService

func WithObjectStorageService(objectStorageService userland.ObjectStorageService) func(service *service)

func WithUserRepository

func WithUserRepository(userRepository userland.UserRepository) func(service *service)

Types

type Service

type Service interface {
	ProfileByEmail(email string) (userland.User, error)
	Profile(userID int) (userland.User, error)
	SetProfile(user userland.User) error
	SetProfilePicture(user userland.User, image io.Reader) error
	RequestChangeEmail(user userland.User, newEmail string) (verificationID string, err error)
	ChangeEmail(user userland.User, verificationID string) error
	ChangePassword(user userland.User, oldPassword, newPassword string) error
	EnrollTFA(user userland.User) (secret string, qrcodeImageBase64 string, err error)
	ActivateTFA(user userland.User, secret string, code string) ([]string, error)
	RemoveTFA(user userland.User, currPassword string) error
	DeleteAccount(user userland.User, currPassword string) error
}

Service provide an interface to story domain service

func NewInstrumentorService

func NewInstrumentorService(latency metrics.Histogram, s Service) Service

func NewService

func NewService(options ...func(*service)) Service

Jump to

Keyboard shortcuts

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