Documentation
¶
Overview ¶
Package business implements different business services required by the project service
Package business implements different business services required by the project service ¶
Package business implements different business services required by the project service ¶
Package business implements different business services required by the project service
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BusinessContract ¶
type BusinessContract interface { // CreateProject creates a new project. // ctx: Mandatory The reference to the context // request: Mandatory. The request to create a new project // Returns either the result of creating new project or error if something goes wrong. CreateProject( ctx context.Context, request *CreateProjectRequest) (*CreateProjectResponse, error) // ReadProject read an existing project // ctx: Mandatory The reference to the context // request: Mandatory. The request to read an existing project // Returns either the result of reading an existing project or error if something goes wrong. ReadProject( ctx context.Context, request *ReadProjectRequest) (*ReadProjectResponse, error) // UpdateProject update an existing project // ctx: Mandatory The reference to the context // request: Mandatory. The request to update an existing project // Returns either the result of updateing an existing project or error if something goes wrong. UpdateProject( ctx context.Context, request *UpdateProjectRequest) (*UpdateProjectResponse, error) // DeleteProject delete an existing project // ctx: Mandatory The reference to the context // request: Mandatory. The request to delete an existing project // Returns either the result of deleting an existing project or error if something goes wrong. DeleteProject( ctx context.Context, request *DeleteProjectRequest) (*DeleteProjectResponse, error) // ListProjects returns the list of projects that matched the criteria // ctx: Mandatory The reference to the context // request: Mandatory. The request contains the search criteria // Returns the list of projects that matched the criteria ListProjects( ctx context.Context, request *ListProjectsRequest) (*ListProjectsResponse, error) }
BusinessContract declares the service that can create new project, read, update and delete existing projects.
func NewBusinessService ¶
func NewBusinessService( repositoryService repository.RepositoryContract) (BusinessContract, error)
NewBusinessService creates new instance of the BusinessService, setting up all dependencies and returns the instance repositoryService: Mandatory. Reference to the repository service that can persist the project related data Returns the new service or error if something goes wrong
type CreateProjectRequest ¶
CreateProjectRequest contains the request to create a new project
func (CreateProjectRequest) Validate ¶
func (val CreateProjectRequest) Validate() error
Validate validates the CreateProjectRequest model and return error if the validation failes Returns error if validation failes
type CreateProjectResponse ¶
type CreateProjectResponse struct { Err error ProjectID string Project models.Project Cursor string }
CreateProjectResponse contains the result of creating a new project
type DeleteProjectRequest ¶
DeleteProjectRequest contains the request to delete an existing project
func (DeleteProjectRequest) Validate ¶
func (val DeleteProjectRequest) Validate() error
Validate validates the DeleteProjectRequest model and return error if the validation failes Returns error if validation failes
type DeleteProjectResponse ¶
type DeleteProjectResponse struct {
Err error
}
DeleteProjectResponse contains the result of deleting an existing project
type ListProjectsRequest ¶ added in v0.7.0
type ListProjectsRequest struct { UserEmail string Pagination common.Pagination SortingOptions []common.SortingOptionPair ProjectIDs []string }
ListProjectsRequest contains the filter criteria to look for existing projects
func (ListProjectsRequest) Validate ¶ added in v0.7.0
func (val ListProjectsRequest) Validate() error
Validate validates the ListProjectsRequest model and return error if the validation failes Returns error if validation failes
type ListProjectsResponse ¶ added in v0.7.0
type ListProjectsResponse struct { Err error HasPreviousPage bool HasNextPage bool TotalCount int64 Projects []models.ProjectWithCursor }
ListProjectsResponse contains the list of the projects that matched the result
type ReadProjectRequest ¶
ReadProjectRequest contains the request to read an existing project
func (ReadProjectRequest) Validate ¶
func (val ReadProjectRequest) Validate() error
Validate validates the ReadProjectRequest model and return error if the validation failes Returns error if validation failes
type ReadProjectResponse ¶
ReadProjectResponse contains the result of reading an existing project
type UpdateProjectRequest ¶
UpdateProjectRequest contains the request to update an existing project
func (UpdateProjectRequest) Validate ¶
func (val UpdateProjectRequest) Validate() error
Validate validates the UpdateProjectRequest model and return error if the validation failes Returns error if validation failes