package
0.0.0-20210302114855-3975a26f6022
Repository: https://github.com/swithek/httpflow.git
Documentation: pkg.go.dev

# Packages

Package postgres provides functionality for interaction with postgres database.

# Functions

CheckEmail determines whether the provided email address is of correct format or not.
CheckFilterKey determines whether the filter key is valid or not.
CheckPassword determines whether the provided password is of correct format or not.
CheckSortKey determines whether the sort key is valid or not.
DefaultCreator creates a new user with only core data fields from the provided input.
DefaultDeleteCheck does nothing, just fills the space and contemplates life.
DefaultLoginCheck checks whether the user has to be activated before authentication or not.
DefaultParser marshals incoming request's body into a core input data structure.
FromFullToken extracts token value and user's ID from the combined token form.
NewCore initializes all the values, user specified and default, needed for user's core to be usable and returns it.
NewHandler creates a new handler instance with the options provided.
SetCreator sets a function that will be used to construct a new user.
SetDeleteCheck sets a function that will be called before user deletion.
SetLoginCheck sets a function that will be called before user auth.
SetParser sets a function that will be used to parse user's request input.
SetRecoveryLifetime sets token time values for recovery process.
SetSessionDuration sets the duration of persistent sessions.
SetupLinks creates a link string map that should be used for email sending, etc.
SetVerificationLifetime sets token time values for verification process.

# Variables

ErrInvalidCredentials is returned when login credentials are determined to be incorrect.
ErrInvalidEmail is returned when email is determined to be invalid.
ErrInvalidPassword is returned when password is determined to be invalid.
ErrInvalidToken is returned when the provided token is incorrect or already expired.
ErrNotActivated is returned when an action which is allowed only by activated users is performed.
ErrTooManyTokens is returned when too many requests for new tokens have been received.
RecovLifetime is the default / recommended recovery token lifetime value.
nolint:gochecknoglobals // used as a constant.
VerifLifetime is the default / recommended verification token lifetime value.

# Structs

Core holds core fields needed for user data types.
CoreInput holds core fields needed for every user's ApplyInput call.
CoreStats holds core user statistics.
CoreSummary holds core fields' information which determines whether they were modified or not.
Handler holds dependencies required for user management.go:generate moq -out ./mock_test.go .
Token is a temporary password-type data structure used for account verification and recovery.
TokenLifetime holds data related to token expiration and next generation times.

# Interfaces

DB is an interface which should be implemented by the user data store layer.
EmailSender is an interface which should be implemented by email sending service.
Inputer is an interface which should be implemented by every user input data type.
Stats is an interface which should be implemented by every user statistics data type.
Summary is an interface which should be implemented by every user data type describing modifications during updates.
User is an interface every user data type should implement.

# Type aliases

Creator is a function that should be used for custom user creation.
DeleteCheck is function that should be used for custom account checks before user deletion (e.g.
LoginCheck is a function that should be used for custom user data checks before authentication.
Parser is a function that should be used for custom input parsing.