projects

package
v0.0.0-...-a12d374 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2020 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DbContext

type DbContext interface {
	GetProjectsRepository() (Repository, error)
}

type Project

type Project struct {
	dal.Definition
}

type ProjectEntity

type ProjectEntity struct {
	dal.Entity
	Project
}

type QueryResult

type QueryResult struct {
	dal.QueryResult
	Data []ProjectEntity
}

type Repository

type Repository interface {
	Get(ctx context.Context, id string) (ProjectEntity, error)

	Find(ctx context.Context, query dal.Query) (QueryResult, error)

	Create(ctx context.Context, project Project) (dal.Entity, error)

	Update(ctx context.Context, project UpdateProject) (dal.Entity, error)

	Delete(ctx context.Context, id string) error
}

type Service

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

func NewService

func NewService(db DbContext) (*Service, error)

func (*Service) CreateProject

func (service *Service) CreateProject(ctx context.Context, project Project) (dal.Entity, error)

func (*Service) DeleteProject

func (service *Service) DeleteProject(ctx context.Context, id string) error

func (*Service) FindProjects

func (service *Service) FindProjects(ctx context.Context, q dal.Query) (QueryResult, error)

func (*Service) GetProject

func (service *Service) GetProject(ctx context.Context, id string) (ProjectEntity, error)

func (*Service) UpdateProject

func (service *Service) UpdateProject(ctx context.Context, project UpdateProject) (dal.Entity, error)

type UpdateProject

type UpdateProject struct {
	Project
	ID string `json:"id"`
}

Jump to

Keyboard shortcuts

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