-
Notifications
You must be signed in to change notification settings - Fork 1
/
type.shy
76 lines (67 loc) · 1.2 KB
/
type.shy
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
type Any = interface{}
type List = []Any
type Map = map[string]Any
type Maps = map[string]string
type Handler func(m *Message, arg ...string)
type Messages = map[string]*Message
type Contexts = map[string]*Context
type Commands = map[string]*Command
type Actions = map[string]*Action
type Configs = map[string]*Config
type Caches = map[string]*Cache
type Cache struct {
Name string
Help string
Value string
}
type Config struct {
Name string
Help string
Value Any
}
type Action struct {
Name string
Help string
Hand Handler
List List
}
type Command struct {
Name string
Help string
Actions Actions
Hand Handler
RawHand Any
List List
Meta Map
}
type Context struct {
Name string
Help string
Caches Caches
Configs Configs
Commands Commands
contexts Contexts
context *Context
root *Context
server Server
id int32
}
type Server interface {
Begin(m *Message, arg ...string)
Start(m *Message, arg ...string)
Close(m *Message, arg ...string)
}
type Message struct {
code int
data Map
meta map[string][]string
root *Message
message *Message
_source string
_target string
source *Context
target *Context
_cmd *Command
_key string
_sub string
}