pgsql

package
Version: v2.1.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2018 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrAlreadyExists = echo.NewHTTPError(http.StatusInternalServerError, "Username or email already exists.")
)

Custom errors

Functions

This section is empty.

Types

type User

type User struct{}

User represents the client for user table

func NewUser

func NewUser() *User

NewUser returns a new user database instance

func (*User) Create

func (u *User) Create(db orm.DB, usr gorsk.User) (*gorsk.User, error)

Create creates a new user on database

func (*User) Delete

func (u *User) Delete(db orm.DB, user *gorsk.User) error

Delete sets deleted_at for a user

func (*User) List

func (u *User) List(db orm.DB, qp *gorsk.ListQuery, p *gorsk.Pagination) ([]gorsk.User, error)

List returns list of all users retrievable for the current user, depending on role

func (*User) Update

func (u *User) Update(db orm.DB, user *gorsk.User) error

Update updates user's contact info

func (*User) View

func (u *User) View(db orm.DB, id int) (*gorsk.User, error)

View returns single user by ID

Source Files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto