postgres

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2017 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HealthCheckService

type HealthCheckService struct {
	DB *sql.DB
}

HealthCheckService is a simple general purpose health check service

func (HealthCheckService) IsDatabaseOnline

func (svc HealthCheckService) IsDatabaseOnline() bool

IsDatabaseOnline checks if database is online

type IdeaService

type IdeaService struct {
	DB *sql.DB
}

IdeaService contains read and write operations for ideas

func (IdeaService) AddComment

func (svc IdeaService) AddComment(userID, ideaID int, content string) (int, error)

AddComment places a new comment on an idea

func (IdeaService) GetAll

func (svc IdeaService) GetAll(tenantID int) ([]*feedback.Idea, error)

GetAll returns all tenant ideas

func (IdeaService) GetByID

func (svc IdeaService) GetByID(tenantID, ideaID int) (*feedback.Idea, error)

GetByID returns idea by given id

func (IdeaService) GetCommentsByIdeaID

func (svc IdeaService) GetCommentsByIdeaID(tenantID, ideaID int) ([]*feedback.Comment, error)

GetCommentsByIdeaID returns all coments from given idea

func (IdeaService) Save

func (svc IdeaService) Save(tenantID, userID int, title, description string) (*feedback.Idea, error)

Save a new idea in the database

type TenantService

type TenantService struct {
	DB *sql.DB
}

TenantService contains read and write operations for tenants

func (TenantService) GetByDomain

func (svc TenantService) GetByDomain(domain string) (*app.Tenant, error)

GetByDomain returns a tenant based on its domain

type UserService

type UserService struct {
	DB *sql.DB
}

UserService is used for user operations using a Postgres database

func (UserService) GetByEmail

func (svc UserService) GetByEmail(email string) (*app.User, error)

GetByEmail returns a user based on given email

func (UserService) Register

func (svc UserService) Register(user *app.User) error

Register creates a new user based on given information

Jump to

Keyboard shortcuts

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