package
0.0.0-20240826104242-9b15d4d4b6f2
Repository: https://github.com/krishanbhalla/iter.git
Documentation: pkg.go.dev
# Functions
NewContentService initialises a ContentService object with an open connection to the db.
NewServices initialises all services with a single db connection.
NewUserService initialises a UserService object with an open connection to the db.
NewUserValidator initialises a UserService object with an open connection to the db.
WithContent returns a ServicesConfig object that sets content.
WithUser returns a ServicesConfig object that sets a user.
# Constants
ErrEmailAlreadyTaken is returned on Update or Create if an email address is already in use.
ErrEmailRequired is returned when an email is the empty string.
ErrIncorrectPassword is returned when a password does not match the value in the database.
ErrInvalidEmail is returned when a password does not match our email regexp.
ErrInvalidID is returned when an invalid ID is provided to a method like Delete.
ErrNotFound is returned when a resource cannot be found in the database.
ErrPasswordHashRequired is returned when a password hash is not provided.
ErrPasswordRequired is returned when a password is not provided on Create.
ErrPasswordTooShort is returned when a password does not meet length requirements.
ErrRememberHashRequired is returned when a create or update is attempted and a remember token hash is not provided.
ErrRememberTooShort is returned when a password does not meet length requirements.
ErrTitleRequired when title is not provided on create (gallery).
ErrUserIDRequired when user id is not provided on create (gallery).
ErrUserNotFound is returned when a resource cannot be found in the database.
# Structs
Content implements the content table for storing travel content data - this consists of the source URL, the content, and the embedding.
Services contains the services which need db connection.
User implements the User table for storing account data - this consists of the Email and hashed password.
# Interfaces
No description provided by the author
ContentService is a set of methods used to manipulate and work with the content model.
No description provided by the author
UserDB is userd to interact with the users database.
UserService is a set of methods used to manipulate and work with the user model.
UserValidator allows for validation of the User object.
# Type aliases
ServicesConfig allows for dynamic adding of services.