-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathtypes.go
71 lines (62 loc) · 1.17 KB
/
types.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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
package esc
import (
"github.com/yuin/gopher-lua"
"net"
"time"
)
type EscConfig struct {
Host string
Node string `json:"node"`
Join string `json:"join"`
IFace string `json:"iface"`
Discovery int `json:"discovery"`
Port int `json:"port"`
Directory string `json:"directory"`
Net *net.Interface
IPs []net.IP
Extras map[string]string `json:"extras"`
}
type Message struct {
From string `json:"from"`
Name string `json:"name"`
To string `json:"to"`
Payload string `json:"payload"`
Coalesce bool `json:"coalesce"`
}
type Service struct {
Name string
AddrV4 *net.IP
Port int
}
type Listener struct {
From string
Name string
Handler func(message *Message)
}
type File struct {
Name string
Hash string
Time time.Time
Content []byte
}
type Script struct {
Id string
Lua *lua.LState
Listeners []*Listener
File string
Hash string
Done []chan bool
}
type ScriptCall struct {
Message *Message
Fun *lua.LFunction
Script *Script
Done chan bool
Back bool
}
type Plugin struct {
Id string
File string
Stop func()
Script func(*Script)
}