Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Project ¶
type Project struct { ID string `json:"id"` Name string `json:"name"` CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` Status Status `json:"status"` }
Project the representation of model Project
type Repository ¶
type Repository interface { FindAll() ([]*Project, error) FindByName(name string) (Project, error) FindByID(ID string) (Project, error) Persist(project *Project) error Remove(ID string) error }
Repository provides access a Project store.
type Service ¶
type Service interface { // CreateProject this function creates a new project based on the name passed by parameter CreateProject(name string) (Project, error) // ModifyProjectName First of all searching into a repository if there any project with the name to change // if is not, search by ID the project and when found it then change the name and Persists the changes ModifyProjectName(ID string, newName string) (Project, error) // DeactivateProject First look for a project by its ID, if it finds it then it deactivates it DeactivateProject(ID string) error // ActivateProject First look for a project by its ID, if it finds it then it activates it ActivateProject(ID string) error // RemoveProject Remove a project from the face of the earth RemoveProject(ID string) error // FindProjects Fetch all projects on store FindProjects() ([]*Project, error) }
Service the interface used for encapsulate the business logic of the project
func NewService ¶
func NewService(repository Repository) Service
NewService Initialize the service Project
Click to show internal directories.
Click to hide internal directories.