postgres

package
v0.0.0-...-cb2c959 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2018 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(db *sql.DB) user.Service

New creates a new user service.

Types

type Service

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

Service is used for getting information about a user from a postgres database.

func (*Service) Create

func (s *Service) Create(u user.User) error

Create creates a new user in the postgresql database.

func (*Service) Delete

func (s *Service) Delete(username string) error

Delete removes an existing user with a given username from the postgresql database.

func (*Service) Get

func (s *Service) Get(username string) (u user.User, err error)

Get gets a user with a given username from the postgresql database.

func (*Service) GetUsers

func (s *Service) GetUsers() ([]user.User, error)

GetUsers gets all users in the postgresql database.

func (*Service) Update

func (s *Service) Update(username string, nu user.NullableUser) error

Update updates a given user in the postgresql database.

Jump to

Keyboard shortcuts

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