Documentation ¶
Index ¶
- func MustNewDevelopmentDB(ddlConnStr, migrationDir string) (*sqlx.DB, func())
- func RandString(n int) string
- type Storage
- func (s *Storage) Commit(ctx context.Context) error
- func (s *Storage) CreateUser(ctx context.Context, user storage.User) (string, error)
- func (s *Storage) CreateUserInformation(ctx context.Context, ui storage.UserInformation) (string, error)
- func (s *Storage) CreateUserInformationValidation(ctx context.Context, req storage.UserInformation) error
- func (s *Storage) DeleteUser(ctx context.Context, u storage.User) error
- func (s *Storage) DeleteUserInformation(ctx context.Context, userID, deletedBy string) error
- func (s Storage) DeleteUserInformationPermanently(ctx context.Context) error
- func (s *Storage) DeleteUserInformationValidation(ctx context.Context, req string) error
- func (s Storage) GetUserByEmail(ctx context.Context, email string) (*storage.User, error)
- func (s Storage) GetUserByID(ctx context.Context, id string) (*storage.User, error)
- func (s Storage) GetUserByUsername(ctx context.Context, username string) (*storage.User, error)
- func (s *Storage) GetUserInformation(ctx context.Context, userID string) (*storage.UserInformation, error)
- func (s *Storage) ListUsers(ctx context.Context, f storage.FilterUser) ([]storage.User, error)
- func (s *Storage) Login(ctx context.Context, user storage.User) (*storage.User, error)
- func (s *Storage) NewTransacton(ctx context.Context) (context.Context, error)
- func (s *Storage) Rollback(ctx context.Context) error
- func (s *Storage) RunMigration(dir string) error
- func (s *Storage) UpdateUser(ctx context.Context, u storage.User) (*storage.User, error)
- func (s *Storage) UpdateUserInformation(ctx context.Context, ui storage.UserInformation) (*storage.UserInformation, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MustNewDevelopmentDB ¶
MustNewDevelopmentDB creates a new isolated database for the use of a package test The checking of dbconn is expected to be done in the package test using this
func RandString ¶
Types ¶
type Storage ¶
type Storage struct {
// contains filtered or unexported fields
}
func NewStorage ¶
NewStorage returns a new Storage from the provides psql databse string
func NewStorageDB ¶
func NewTestStorage ¶
NewTestStorage returns a Storage that uses an isolated database for testing purposes and a teardown function
func (*Storage) CreateUser ¶
func (*Storage) CreateUserInformation ¶
func (*Storage) CreateUserInformationValidation ¶
func (*Storage) DeleteUser ¶
func (*Storage) DeleteUserInformation ¶
func (Storage) DeleteUserInformationPermanently ¶
func (*Storage) DeleteUserInformationValidation ¶
func (Storage) GetUserByEmail ¶
func (Storage) GetUserByID ¶
func (Storage) GetUserByUsername ¶
func (*Storage) GetUserInformation ¶
func (*Storage) NewTransacton ¶
func (*Storage) RunMigration ¶
RunMigration runs the migrations in the dir using the goose package
func (*Storage) UpdateUser ¶
func (*Storage) UpdateUserInformation ¶
func (s *Storage) UpdateUserInformation(ctx context.Context, ui storage.UserInformation) (*storage.UserInformation, error)
Click to show internal directories.
Click to hide internal directories.