-
Notifications
You must be signed in to change notification settings - Fork 2
/
repository.go
48 lines (39 loc) · 1.26 KB
/
repository.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
46
47
48
package neocortex
import "time"
type TimeFramePreset string
const DayPreset TimeFramePreset = "day"
const MonthPreset TimeFramePreset = "month"
const WeekPreset TimeFramePreset = "week"
const YearPreset TimeFramePreset = "year"
type TimeFrame struct {
From time.Time
To time.Time
Preset TimeFramePreset
PageSize int
PageNum int
}
type Repository interface {
SaveDialog(dialog *Dialog) error
GetDialogByID(id string) (*Dialog, error)
AllDialogs(frame TimeFrame) ([]*Dialog, error) // to page or not to page?
DeleteDialog(id string) (*Dialog, error)
// Dialogs are inmutable, cause it doesn't have an updater
DialogsByView(viewID string, frame TimeFrame) ([]*Dialog, error)
Summary(frame TimeFrame) (*Summary, error)
RegisterIntent(intent string) error
RegisterEntity(entity string) error
RegisterDialogNode(name string) error
RegisterContextVar(value string) error
Intents() []string
Entities() []string
DialogNodes() []string
ContextVars() []string
SaveView(view *View) error
GetViewByID(id string) (*View, error)
FindViewByName(name string) ([]*View, error)
AllViews() ([]*View, error)
UpdateView(view *View) error
DeleteView(id string) (*View, error)
SetActionVar(name string, value string) error
GetActionVar(name string) (string, error)
}