issues

package
v0.0.0-...-1d8daf6 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ValidateCreateRequest

func ValidateCreateRequest(c *issuesProto.CreateIssueRequest) error

ValidateCreateRequest validates the CreateIssueRequest fields.

func ValidateStatusCreateRequest

func ValidateStatusCreateRequest(c *issuesProto.CreateIssueStatusRequest) error

ValidateStatusCreateRequest validates the CreateIssueStatusRequest fields.

func ValidateStatusUpdateRequest

func ValidateStatusUpdateRequest(u *issuesProto.UpdateIssueStatusRequest) error

ValidateStatusUpdateRequest validates the UpdateIssueStatusRequest fields.

func ValidateUpdateRequest

func ValidateUpdateRequest(u *issuesProto.UpdateIssueRequest) error

ValidateUpdateRequest validates the UpdateIssueRequest fields.

Types

type API

type API interface {
	grpcgw.Controller
	issues.IssueServiceServer
}

func New

func New(srv Service) API

type Repository

type Repository interface {
	// Get returns the issue with the specified issue UUID.
	Get(ctx context.Context, uuid string) (entity.Issue, error)
	// Count returns the number of issues.
	Count(ctx context.Context) (int64, error)
	// Query returns the list of issues with the given offset and limit.
	Query(ctx context.Context, offset, limit int64) ([]entity.Issue, int, error)
	// Create saves a new issue in the storage.
	Create(ctx context.Context, issue entity.Issue) error
	// Update updates the issue with given UUID in the storage.
	Update(ctx context.Context, issue entity.Issue) error
	// Delete removes the issue with given UUID from the storage.
	Delete(ctx context.Context, uuid string) error

	// GetStatus returns the status with the specified issue UUID.
	GetStatus(ctx context.Context, uuid string) (entity.IssueStatus, error)
	// CountStatus returns the number of status.
	CountStatus(ctx context.Context) (int64, error)
	// QueryStatus returns the list of status with the given offset and limit.
	QueryStatus(ctx context.Context, offset, limit int64) ([]entity.IssueStatus, int, error)
	// CreateStatus saves a new status in the storage.
	CreateStatus(ctx context.Context, issueStatus entity.IssueStatus) error
	// UpdateStatus updates the status with given UUID in the storage.
	UpdateStatus(ctx context.Context, issueStatus entity.IssueStatus) error
	// DeleteStatus removes the status with given UUID from the storage.
	DeleteStatus(ctx context.Context, uuid string) error
}

Repository encapsulates the logic to access issues from the data source.

func NewRepository

func NewRepository(db *db.DB) Repository

NewRepository creates a new issue repository

type Service

Service encapsulates use case logic for issues.

func NewService

func NewService(repo Repository, userSrv users.Service, cyclesSrv cycles.Service) Service

NewService creates a new issue service.

Jump to

Keyboard shortcuts

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