/
process.go
87 lines (72 loc) · 1.72 KB
/
process.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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
// Auto-generated by avdl-compiler v1.3.20 (https://github.com/keybase/node-avdl-compiler)
// Input file: avdl/keybase1/process.avdl
package keybase1
import (
"github.com/keybase/go-framed-msgpack-rpc/rpc"
)
type FileType int
const (
FileType_UNKNOWN FileType = 0
FileType_DIRECTORY FileType = 1
FileType_FILE FileType = 2
)
func (o FileType) DeepCopy() FileType { return o }
var FileTypeMap = map[string]FileType{
"UNKNOWN": 0,
"DIRECTORY": 1,
"FILE": 2,
}
var FileTypeRevMap = map[FileType]string{
0: "UNKNOWN",
1: "DIRECTORY",
2: "FILE",
}
func (e FileType) String() string {
if v, ok := FileTypeRevMap[e]; ok {
return v
}
return ""
}
type FileDescriptor struct {
Name string `codec:"name" json:"name"`
Type FileType `codec:"type" json:"type"`
}
func (o FileDescriptor) DeepCopy() FileDescriptor {
return FileDescriptor{
Name: o.Name,
Type: o.Type.DeepCopy(),
}
}
type Process struct {
Pid string `codec:"pid" json:"pid"`
Command string `codec:"command" json:"command"`
FileDescriptors []FileDescriptor `codec:"fileDescriptors" json:"fileDescriptors"`
}
func (o Process) DeepCopy() Process {
return Process{
Pid: o.Pid,
Command: o.Command,
FileDescriptors: (func(x []FileDescriptor) []FileDescriptor {
if x == nil {
return nil
}
var ret []FileDescriptor
for _, v := range x {
vCopy := v.DeepCopy()
ret = append(ret, vCopy)
}
return ret
})(o.FileDescriptors),
}
}
type ProcessInterface interface {
}
func ProcessProtocol(i ProcessInterface) rpc.Protocol {
return rpc.Protocol{
Name: "keybase.1.process",
Methods: map[string]rpc.ServeHandlerDescription{},
}
}
type ProcessClient struct {
Cli rpc.GenericClient
}