postgres

package
v0.0.0-...-62de7c0 Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2019 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewStore

func NewStore(dsn string, logger *logrus.Logger) (store.Store, error)

NewStore returns a new instance of a postgres store

Types

type Store

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

Store is an implementation of Store to interact with a postgres compatible backend

func (*Store) Create

func (s *Store) Create(user *types.User) error

Create inserts a new user into the store

func (*Store) Delete

func (s *Store) Delete(user *types.User) error

Delete marks a user in the store as deleted

func (*Store) GetAll

func (s *Store) GetAll() ([]types.User, error)

GetAll loads all users from the store

func (*Store) GetByEmail

func (s *Store) GetByEmail(email string) (*types.User, error)

GetByEmail loads a user from the store by their email

func (*Store) GetByID

func (s *Store) GetByID(id string) (*types.User, error)

GetByID loads a user from the store by their ID

func (*Store) Migrate

func (s *Store) Migrate() error

Migrate brings the database up to the latest version

func (*Store) Update

func (s *Store) Update(user *types.User) error

Update saves an existing user into the database with any modifications

Directories

Path Synopsis
Code generated for package migrations by go-bindata DO NOT EDIT.
Code generated for package migrations by go-bindata DO NOT EDIT.

Jump to

Keyboard shortcuts

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