Documentation ¶
Overview ¶
Package postgres provides functionality for interaction with postgres database.
Index ¶
- type Store
- func (s *Store) CreateUser(ctx context.Context, usr user.User) error
- func (s *Store) DeleteUserByID(ctx context.Context, id xid.ID) error
- func (s *Store) FetchManyUsers(ctx context.Context, qr httpflow.Query) ([]user.User, int, error)
- func (s *Store) FetchUserByEmail(ctx context.Context, eml string) (user.User, error)
- func (s *Store) FetchUserByID(ctx context.Context, id xid.ID) (user.User, error)
- func (s *Store) UpdateUser(ctx context.Context, usr user.User) error
- func (s *Store) UserStats(ctx context.Context) (user.Stats, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store contains dependencies needed for direct communication with the postgres data store.
func NewStore ¶
NewStore creates a fresh instance of the store. Last parameter specifies how often should the inactive users' cleanup operation execute. 0 disables cleanup.
func (*Store) CreateUser ¶
CreateUser inserts the freshly created user into the underlying data store.
func (*Store) DeleteUserByID ¶
DeleteUserByID deletes the user from the underlying data store by their ID.
func (*Store) FetchManyUsers ¶
FetchManyUsers retrieves multiple users from the underlying data store by the provided query. Int return value specifies the total page count.
func (*Store) FetchUserByEmail ¶
FetchUserByEmail retrieves a user from the underlying data store by their email address.
func (*Store) FetchUserByID ¶
FetchUserByID retrieves a user from the underlying data store by their ID.
func (*Store) UpdateUser ¶
UpdateUser updates user's data in the underlying data store.