Skip to content

v0.4.0

Choose a tag to compare

@pilcrowonpaper pilcrowonpaper released this 06 Sep 13:56
· 2 commits to main since this release

Overview

  • Using a user server is now optional.

New UserStoreInterface interface

NewServer() takes an UserStoreInterface. This gives you the option to handle user operations directly in the server instead of relying on a separate user server.

type UserStoreInterface interface {
	CreateUser(emailAddress string, passwordHash []byte, passwordHashAlgorithmId string, passwordSalt []byte) (UserStruct, error)
	GetUser(userId string) (UserStruct, error)
	GetUserByEmailAddress(emailAddress string) (UserStruct, error)
	UpdateUserEmailAddress(userId string, emailAddress string, userEmailAddressCounter int32) error
	UpdateUserPasswordHash(userId string, passwordHash []byte, passwordHashAlgorithmId string, passwordSalt []byte, userPasswordHashCounter int32) error
	IncrementUserSessionsCounter(userId string, userSessionsCounter int32) error
	DeleteUser(userId string) error
}

You can use NewUserServerClient() to continue using a user server.

// Implements UserStoreInterface.
userServerClient := faroe.NewUserServerClient()

All Changes