repository

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2021 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package repository implements different repository services required by the project service

Package repository implements different repository services required by the project service

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CreateProjectRequest

type CreateProjectRequest struct {
	UserEmail string
	Project   models.Project
}

CreateProjectRequest contains the request to create a new project

type CreateProjectResponse

type CreateProjectResponse struct {
	ProjectID string
	Project   models.Project
	Cursor    string
}

CreateProjectResponse contains the result of creating a new project

type DeleteProjectRequest

type DeleteProjectRequest struct {
	UserEmail string
	ProjectID string
}

DeleteProjectRequest contains the request to delete an existing project

type DeleteProjectResponse

type DeleteProjectResponse struct {
}

DeleteProjectResponse contains the result of deleting an existing project

type ReadProjectRequest

type ReadProjectRequest struct {
	UserEmail string
	ProjectID string
}

ReadProjectRequest contains the request to read an existing project

type ReadProjectResponse

type ReadProjectResponse struct {
	Project models.Project
}

ReadProjectResponse contains the result of reading an existing project

type RepositoryContract

type RepositoryContract 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 esiting 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 esiting 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 esiting project
	// Returns either the result of deleting an existing project or error if something goes wrong.
	DeleteProject(
		ctx context.Context,
		request *DeleteProjectRequest) (*DeleteProjectResponse, error)

	// Search 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
	Search(
		ctx context.Context,
		request *SearchRequest) (*SearchResponse, error)
}

RepositoryContract declares the repository service that can create new project, read, update and delete existing projects.

type SearchRequest

type SearchRequest struct {
	UserEmail      string
	Pagination     common.Pagination
	SortingOptions []common.SortingOptionPair
	ProjectIDs     []string
}

SearchRequest contains the filter criteria to look for existing projects

type SearchResponse

type SearchResponse struct {
	HasPreviousPage bool
	HasNextPage     bool
	TotalCount      int64
	Projects        []models.ProjectWithCursor
}

SearchResponse contains the list of the projects that matched the result

type UpdateProjectRequest

type UpdateProjectRequest struct {
	UserEmail string
	ProjectID string
	Project   models.Project
}

UpdateProjectRequest contains the request to update an existing project

type UpdateProjectResponse

type UpdateProjectResponse struct {
	Project models.Project
	Cursor  string
}

UpdateProjectResponse contains the result of updating an existing project

Directories

Path Synopsis
Package mock_repository is a generated GoMock package.
Package mock_repository is a generated GoMock package.
Package mongodb implements MongoDB repository services
Package mongodb implements MongoDB repository services

Jump to

Keyboard shortcuts

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