store

package
v0.0.0-...-6b4d62a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 5, 2023 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrConnectingToPostgres = errors.New("error connecting to postgres")
View Source
var ErrCreatingPostgresPool = errors.New("error creating postgres pool")
View Source
var ErrInvalidMigrationDirection = errors.New("invalid migration direction passed")

Functions

This section is empty.

Types

type MigrationDirection

type MigrationDirection int
const (
	DirectionNull MigrationDirection = iota
	DirectionUP
	DirectionDown
)

type PostgresStore

type PostgresStore struct {
	// contains filtered or unexported fields
}

func NewPostgresStore

func NewPostgresStore(dbString string, autoMigrate bool) (*PostgresStore, func(), error)

func (*PostgresStore) UserDelete

func (p *PostgresStore) UserDelete(id uuid.UUID) error

func (*PostgresStore) UserInsert

func (p *PostgresStore) UserInsert(email, password string, id uuid.UUID, admin bool) (*store.User, error)

func (*PostgresStore) UserList

func (p *PostgresStore) UserList(userListParmas store.UserListParams) (*store.UsersList, error)

func (*PostgresStore) UserRetrieve

func (p *PostgresStore) UserRetrieve(id uuid.UUID) (*store.User, error)

func (*PostgresStore) UserRetrieveByEmail

func (p *PostgresStore) UserRetrieveByEmail(email string) (*store.User, error)

func (*PostgresStore) UserUpdateAdmin

func (p *PostgresStore) UserUpdateAdmin(id uuid.UUID, newAdminValue bool) error

func (*PostgresStore) UserUpdatePassword

func (p *PostgresStore) UserUpdatePassword(id uuid.UUID, newPassword string) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL