database

package
v0.0.0-...-ede1b7c Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2018 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Database

type Database interface {
	// Projects
	AddProject(project models.Project) error
	GetProject(id string) (models.Project, error)
	// TODO: UpdateProject - models.Project could probably be removed
	// and the project passed in returned since no internal changes
	// are happening
	UpdateProject(project models.Project) error
	RemoveProject(id string) error

	// Accounts
	CreateAccount(account models.Account) error
	GetAccountByUsername(username string) (models.Account, error)
	GetAccountByEmail(email string) (models.Account, error)
	UpdateAccount(account models.Account) error
	RemoveAccount(username, email string) error

	// Sessions
	StoreSession(session models.Session) error
	GetSession(sessionToken string) (models.Session, error)
	GetAllSessions() ([]models.Session, error)
	RemoveSession(sessionToken string) error
}

Database is an interface to our database needs

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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