Documentation
¶
Index ¶
Constants ¶
View Source
const ( // CreatePostgresTable represents a query to create the Postgres users table. CreatePostgresTable = `` /* 290-byte string literal not displayed */ // CreateSqliteTable represents a query to create the Sqlite users table. CreateSqliteTable = `` /* 264-byte string literal not displayed */ )
View Source
const ( // CreateUserRefreshIndex represents a query to create an // index on the users table for the refresh_token column. CreateUserRefreshIndex = ` CREATE INDEX IF NOT EXISTS users_refresh ON users (refresh_token); ` )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type EngineOpt ¶
type EngineOpt func(*engine) error
EngineOpt represents a configuration option to initialize the database engine for Users.
func WithClient ¶
WithClient sets the gorm.io/gorm client in the database engine for Users.
func WithEncryptionKey ¶
WithEncryptionKey sets the encryption key in the database engine for Users.
func WithLogger ¶
WithLogger sets the github.com/sirupsen/logrus logger in the database engine for Users.
func WithSkipCreation ¶
WithSkipCreation sets the skip creation logic in the database engine for Users.
type UserService ¶
type UserService interface {
// CreateUserIndexes defines a function that creates the indexes for the users table.
CreateUserIndexes() error
// CreateUserTable defines a function that creates the users table.
CreateUserTable(string) error
// CountUsers defines a function that gets the count of all users.
CountUsers() (int64, error)
// CreateUser defines a function that creates a new user.
CreateUser(*library.User) error
// DeleteUser defines a function that deletes an existing user.
DeleteUser(*library.User) error
// GetUser defines a function that gets a user by ID.
GetUser(int64) (*library.User, error)
// GetUserForName defines a function that gets a user by name.
GetUserForName(string) (*library.User, error)
// ListUsers defines a function that gets a list of all users.
ListUsers() ([]*library.User, error)
// ListLiteUsers defines a function that gets a lite list of users.
ListLiteUsers(int, int) ([]*library.User, int64, error)
// UpdateUser defines a function that updates an existing user.
UpdateUser(*library.User) error
}
UserService represents the Vela interface for user functions with the supported Database backends.
Click to show internal directories.
Click to hide internal directories.