datastore

package
v0.0.0-...-5d765df Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2015 License: GPL-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Project

type Project struct {
	ID          int
	Identifier  string
	Title       string
	Description string

	CreatedAt time.Time
	UpdatedAt time.Time
	DeletedAt *time.Time
}

Project is the struct for projects

type ProjectStore

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

ProjectStore provides the repository for Projects

func NewProjectStore

func NewProjectStore(db *gorm.DB) *ProjectStore

func (*ProjectStore) Create

func (p *ProjectStore) Create(project *Project) (*Project, error)

Create will attempt to create a new Project

func (*ProjectStore) Delete

func (p *ProjectStore) Delete(project *Project) (*Project, error)

Delete will destroy an existing Project based on its given id

func (*ProjectStore) Get

func (p *ProjectStore) Get(id int) (*Project, error)

Get will return a single Project based on an id given

func (*ProjectStore) List

func (p *ProjectStore) List() ([]*Project, error)

List will provide all projects the sotre can find

func (ProjectStore) Update

func (p ProjectStore) Update(project *Project) (*Project, error)

Update will provide new Data for the fields of a Project

type ProjectStorer

type ProjectStorer interface {
	Get(int) (*Project, error)
	List() ([]*Project, error)
	Create(*Project) (*Project, error)
	Delete(*Project) (*Project, error)
	Update(*Project) (*Project, error)
}

ProjectStorer defines an interface for ProjectDataStorers

type Ticket

type Ticket struct {
	ID          int
	Subject     string
	Description string
	Project     Project

	CreatedAt time.Time
	UpdatedAt time.Time
	DeletedAt *time.Time
}

Ticket is the struct for Tickets

type TicketStore

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

TicketStore provides the repository for Tickets

func NewTicketStore

func NewTicketStore(db *gorm.DB) *TicketStore

func (*TicketStore) Create

func (p *TicketStore) Create(ticket *Ticket) (*Ticket, error)

Create will attempt to create a new Ticket

func (*TicketStore) Delete

func (p *TicketStore) Delete(ticket *Ticket) (*Ticket, error)

Delete will destroy an existing Ticket based on its given id

func (*TicketStore) Get

func (p *TicketStore) Get(id int) (*Ticket, error)

Get will return a single Ticket based on an id given

func (*TicketStore) List

func (p *TicketStore) List() ([]*Ticket, error)

List will provide all Tickets the store can find

func (*TicketStore) Update

func (p *TicketStore) Update(ticket *Ticket) (*Ticket, error)

Update will provide new Data for the fields of a Ticket

type TicketStorer

type TicketStorer interface {
	Get(int) (*Ticket, error)
	List() ([]*Ticket, error)
	Create(*Ticket) (*Ticket, error)
	Delete(*Ticket) (*Ticket, error)
	Update(*Ticket) (*Ticket, error)
}

TicketStorer defines an interface for TicketDataStorers

Jump to

Keyboard shortcuts

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