domain

package
v0.0.0-...-a20f1a3 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2020 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Issue

type Issue struct {
	ID          int64    `db:"id"`
	Title       string   `db:"title"`
	Description string   `db:"description"`
	ProjectID   int64    `db:"project_id"`
	OwnerID     int64    `db:"owner_id"`
	Status      Status   `db:"status"`
	Priority    Priority `db:"priority"`
}

Issue represents a Project task

type IssueRepository

type IssueRepository interface {
	GetById(id int64) (*Issue, error)
	All() ([]*Issue, error)
	Create(issue *Issue) error
	Delete(id int64) error
}

IssueRepository contains methods to handles issue database operations

type IssueService

type IssueService interface {
	Issue(id int64) (*Issue, error)
	Issues() ([]*Issue, error)
	Create(issue *Issue) error
	Delete(id int64) error
}

IssueService contains methods do Handle issue model

type Priority

type Priority string

Priority represents an issue importance

var (
	PriorityLow    Priority = "Low"
	PriorityMedium Priority = "Medium"
	PriorityHigh   Priority = "High"
)

Types of priorities

type Project

type Project struct {
	ID          int64
	Name        string
	OwnerID     int64
	Description string
}

Project represents a top level collection of related issues

type ProjectRepository

type ProjectRepository interface {
	GetByID(id int64) (*Project, error)
	All() ([]*Project, error)
	Create(p *Project) error
	Delete(id int64) error
}

ProjectRepository is a repository which interact with the database layer

type ProjectService

type ProjectService interface {
	Project(id int64) (*Project, error)
	Projects() ([]*Project, error)
	Create(p *Project) error
	Delete(id int64) error
}

ProjectService is an interface to handle projects

type Status

type Status string

Status represents an issue status type

var (
	StatusTodo       Status = "Todo"
	StatusInProgress Status = "In Progress"
	StatusDone       Status = "Done"
)

Type of status

type User

type User struct {
	ID      int64
	Name    string
	Surname string
	Email   string
}

User represents a user in the System

type UserRepository

type UserRepository interface {
	GetByID(id int64) (*User, error)
	All() ([]*User, error)
	Create(u *User) error
	Delete(id int64) error
}

UserRepository is an interface which interacts with the database layer

type UserService

type UserService interface {
	User(id int64) (*User, error)
	Users() ([]*User, error)
	Create(u *User) error
	Delete(id int64) error
}

UserService is an inteface which interacts with the repository

Jump to

Keyboard shortcuts

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