forked from leanlabsio/kanban
/
datasource.go
45 lines (37 loc) · 1.11 KB
/
datasource.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
package datasource
import (
"gitlab.com/leanlabsio/kanban/models"
)
type DataSource interface {
CardSource
BoardSource
CommentSource
UserSource
LabelSource
MilestoneSource
}
type CardSource interface {
ListCards(project_id string) ([]*models.Card, error)
CreateCard(*models.CardRequest) (*models.Card, int, error)
UpdateCard(*models.CardRequest) (*models.Card, int, error)
DeleteCard(*models.CardRequest) (*models.Card, int, error)
}
type BoardSource interface {
ListBoards() ([]*models.Board, error)
ItemBoard(board_id string) (*models.Board, error)
ConfigureBoard(*models.BoardRequest) (int, error)
}
type CommentSource interface {
ListComments(project_id, card_id string) ([]*models.Comment, error)
CreateComment(*models.CommentRequest) (*models.Comment, int, error)
}
type UserSource interface {
ListMembers(board_id string) ([]*models.User, error)
}
type LabelSource interface {
ListLabels(board_id string) ([]*models.Label, error)
}
type MilestoneSource interface {
ListMilestones(board_id string) ([]*models.Milestone, error)
CreateMilestone(*models.MilestoneRequest) (*models.Milestone, int, error)
}