refactor: add tag and relation methods to node to enforce integrity
This commit is contained in:
@@ -25,21 +25,16 @@ func GetNodeService(cfg Config) (NodeService, error) {
|
||||
}
|
||||
|
||||
type listFilter struct {
|
||||
tagPrefixes []string
|
||||
assignee string
|
||||
mentionsUser string
|
||||
tagPrefixes []string
|
||||
relPrefixes []*models.Rel
|
||||
}
|
||||
|
||||
type ListOption func(*listFilter)
|
||||
|
||||
func WithTags(prefixes ...string) ListOption {
|
||||
return func(f *listFilter) { f.tagPrefixes = prefixes }
|
||||
return func(f *listFilter) { f.tagPrefixes = append(f.tagPrefixes, prefixes...) }
|
||||
}
|
||||
|
||||
func WithAssignee(userID string) ListOption {
|
||||
return func(f *listFilter) { f.assignee = userID }
|
||||
}
|
||||
|
||||
func WithMentions(userID string) ListOption {
|
||||
return func(f *listFilter) { f.mentionsUser = userID }
|
||||
func WithRels(prefixes ...*models.Rel) ListOption {
|
||||
return func(f *listFilter) { f.relPrefixes = append(f.relPrefixes, prefixes...) }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user