first servicable server

This commit is contained in:
Barak Michener 2018-03-29 14:29:05 -07:00
parent 90aa93a1d7
commit 869999fc3e
8 changed files with 309 additions and 12 deletions

41
request.go Normal file
View file

@ -0,0 +1,41 @@
package kubelwagen
import "github.com/hanwen/go-fuse/fuse"
type Method int
const (
MethodInvalid Method = iota
MethodOpenDir
MethodGetAttr
)
type Request struct {
ID int `json:"id"`
Method Method `json:"method"`
Path string `json:"path"`
Mode int32
UID int32
GID int32
Size int32
Dev int32
Flags int32
NewPath string `json:"newpath,omitempty"`
Attr string `json:"attr,omitempty"`
Data []byte `json:"data,omitempty"`
}
type RequestCallback struct {
message Request
response chan Response
}
type Response struct {
ID int `json:"id"`
Code fuse.Status `json:"status"`
Data []byte `json:"data,omitempty"`
Stat *fuse.Attr `json:"stat,omitempty"`
Attrs []string `json:"attrs,omitempty"`
Dirents []fuse.DirEntry `json:"dirents,omitempty"`
LinkStr string `json:"linkstr,omitempty"`
}