pgsql

package
v0.0.0-...-32f8f0d Latest Latest
Warning

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

Go to latest
Published: May 28, 2019 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrAlreadyExists = echo.NewHTTPError(http.StatusInternalServerError, "Topic name  already exists.")
)

Custom errors

Functions

This section is empty.

Types

type Topic

type Topic struct{}

Topic represents the client for topic table

func NewTopic

func NewTopic() *Topic

NewTopic returns a new topic database instance

func (*Topic) Create

func (u *Topic) Create(db orm.DB, topicModel model.Topic) (*model.Topic, error)

Create creates a new topic on database

func (*Topic) Delete

func (u *Topic) Delete(db orm.DB, topic *model.Topic) error

Delete sets deleted_at for a topic

func (*Topic) List

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

List returns list of all topics retrievable for the current topic, depending on role

func (*Topic) Update

func (u *Topic) Update(db orm.DB, topic *model.Topic) error

Update updates topic's contact info

func (*Topic) View

func (u *Topic) View(db orm.DB, id int) (*model.Topic, error)

View returns single topic by ID

Jump to

Keyboard shortcuts

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