diff options
Diffstat (limited to 'pkg')
| -rw-r--r-- | pkg/osutil/osutil.go | 10 | ||||
| -rw-r--r-- | pkg/rpctype/rpctype.go | 15 |
2 files changed, 20 insertions, 5 deletions
diff --git a/pkg/osutil/osutil.go b/pkg/osutil/osutil.go index fecb5f95b..4fbd04506 100644 --- a/pkg/osutil/osutil.go +++ b/pkg/osutil/osutil.go @@ -155,3 +155,13 @@ func WriteFile(filename string, data []byte) error { func WriteExecFile(filename string, data []byte) error { return ioutil.WriteFile(filename, data, DefaultExecPerm) } + +// Return all files in a directory. +func ListDir(dir string) ([]string, error) { + f, err := os.Open(dir) + if err != nil { + return nil, err + } + defer f.Close() + return f.Readdirnames(-1) +} diff --git a/pkg/rpctype/rpctype.go b/pkg/rpctype/rpctype.go index ab3f2243a..a198a90f4 100644 --- a/pkg/rpctype/rpctype.go +++ b/pkg/rpctype/rpctype.go @@ -74,18 +74,23 @@ type HubConnectArgs struct { type HubSyncArgs struct { // see HubConnectArgs. - Client string - Key string - Manager string + Client string + Key string + Manager string + NeedRepros bool // Programs added to corpus since last sync or connect. Add [][]byte - // Hashed of programs removed from corpus since last sync or connect. + // Hashes of programs removed from corpus since last sync or connect. Del []string + // Repros found since last sync. + Repros [][]byte } type HubSyncRes struct { // Set of programs from other managers. - Inputs [][]byte + Progs [][]byte + // Set of repros from other managers. + Repros [][]byte // Number of remaining pending programs, // if >0 manager should do sync again. More int |
