Documentation ¶
Index ¶
- func ValidateCreateRequest(c *issuesProto.CreateIssueRequest) error
- func ValidateStatusCreateRequest(c *issuesProto.CreateIssueStatusRequest) error
- func ValidateStatusUpdateRequest(u *issuesProto.UpdateIssueStatusRequest) error
- func ValidateUpdateRequest(u *issuesProto.UpdateIssueRequest) error
- type API
- type Repository
- type Service
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 }
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 ¶
type Service interface { Get(ctx context.Context, uuid string) (*issuesProto.Issue, error) Query(ctx context.Context, offset, limit int64) (*issuesProto.ListIssuesResponse, error) Count(ctx context.Context) (int64, error) Create(ctx context.Context, input *issuesProto.CreateIssueRequest) (*issuesProto.Issue, error) Update(ctx context.Context, input *issuesProto.UpdateIssueRequest) (*issuesProto.Issue, error) Delete(ctx context.Context, uuid string) (*issuesProto.Issue, error) GetStatus(ctx context.Context, Uuid string) (*issuesProto.IssueStatus, error) QueryStatus(ctx context.Context, offset, limit int64) (*issuesProto.ListIssueStatusResponse, error) CountStatus(ctx context.Context) (int64, error) CreateStatus(ctx context.Context, input *issuesProto.CreateIssueStatusRequest) (*issuesProto.IssueStatus, error) UpdateStatus(ctx context.Context, input *issuesProto.UpdateIssueStatusRequest) (*issuesProto.IssueStatus, error) DeleteStatus(ctx context.Context, Uuid string) (*issuesProto.IssueStatus, error) }
Service encapsulates use case logic for issues.
func NewService ¶
NewService creates a new issue service.
Click to show internal directories.
Click to hide internal directories.