/
base.go
49 lines (41 loc) · 877 Bytes
/
base.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
49
package model
import (
"github.com/maritimusj/centrum/gate/web/helper"
"github.com/maritimusj/centrum/gate/web/resource"
"github.com/sirupsen/logrus"
"github.com/tidwall/gjson"
"time"
)
type DBEntry interface {
GetID() int64
CreatedAt() time.Time
Save() error
Destroy() error
}
type OptionEntry interface {
Option() map[string]interface{}
GetOption(path string) gjson.Result
SetOption(path string, value interface{}) error
}
type EnableEntry interface {
Enable()
Disable()
IsEnabled() bool
}
type Profile interface {
Simple() Map
Brief() Map
Detail() Map
}
type LogEntry interface {
UID() string
Logger() *logrus.Entry
}
type Resource interface {
OrganizationID() int64
ResourceClass() resource.Class
ResourceID() int64
ResourceTitle() string
ResourceDesc() string
GetChildrenResources(options ...helper.OptionFN) ([]Resource, int64, error)
}