backend

package
v0.0.0-...-cf91c1a Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2018 License: MPL-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Backend

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

Backend ...

func InitializeDB

func InitializeDB(path string) (*Backend, error)

InitializeDB takes the DB configuration and returns a Backend struct which implements the database access models

func (*Backend) DeleteProject

func (b *Backend) DeleteProject(projectid string) error

DeleteProject ...

func (*Backend) DeleteTask

func (b *Backend) DeleteTask(taskid string) error

DeleteTask removes a task from the database by ID

func (*Backend) DeleteUser

func (b *Backend) DeleteUser(userid string) error

DeleteUser removes a User entry from the DB by ID

func (*Backend) GetProjectByID

func (b *Backend) GetProjectByID(projectid string) (*models.Project, error)

GetProjectByID returns a project object by ID

func (*Backend) GetProjects

func (b *Backend) GetProjects() ([]*models.Project, error)

GetProjects is returns an array of all Projects

func (*Backend) GetTaskByID

func (b *Backend) GetTaskByID(taskid string) (*models.Task, error)

GetTaskByID returns a Task by ID

func (*Backend) GetTasks

func (b *Backend) GetTasks() ([]*models.Task, error)

GetTasks is returns an array of all tasks, this may need an accessor method at some point (probably never) based on scale

func (*Backend) GetUserByID

func (b *Backend) GetUserByID(userid string) (*models.User, error)

GetUserByID returns a User object by ID

func (*Backend) GetUsers

func (b *Backend) GetUsers() ([]*models.User, error)

GetUsers returns an array of User objects to the caller

func (*Backend) PutProject

func (b *Backend) PutProject(project *models.Project) (*models.Project, error)

PutProject ...

func (*Backend) PutTask

func (b *Backend) PutTask(task *models.Task) (*models.Task, error)

PutTask will persist a full formed task model

func (*Backend) PutUser

func (b *Backend) PutUser(user *models.User) (*models.User, error)

PutUser stores a fully formed user model into the DB

type Database

type Database interface {
	UserBackend
	TaskBackend
	ProjectBackend
}

Backend interface encapsulates all the functions to put/get domain objects

type ProjectBackend

type ProjectBackend interface {
	GetProjects() ([]*models.Project, error)
	GetProjectByID(projectid string) (*models.Project, error)
	PutProject(project *models.Project) (*models.Project, error)
	DeleteProject(projectid string) error
}

ProjectBackend interface encapsulates all the implementations of the project peristence

type TaskBackend

type TaskBackend interface {
	GetTasks() ([]*models.Task, error)
	GetTaskByID(taskid string) (*models.Task, error)
	PutTask(task *models.Task) (*models.Task, error)
	DeleteTask(taskid string) error
}

TaskBackend interface encapsulates all the implementations of the task peristence

type UserBackend

type UserBackend interface {
	GetUsers() ([]*models.User, error)
	GetUserByID(userid string) (*models.User, error)
	PutUser(user *models.User) (*models.User, error)
	DeleteUser(userid string) error
}

UserBackend interface encapsulates all the implementations of the user peristence

Jump to

Keyboard shortcuts

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