package webdav import ( "context" "fmt" "os" "golang.org/x/net/webdav" "imuslab.com/bokofs/bokofsd/mod/bokofile" ) /* router.go This implement a emulated file system abstraction that routes the request to the correct worker */ type RouterDir struct { } func (r *RouterDir) Mkdir(ctx context.Context, name string, perm os.FileMode) error { // Implement the Mkdir method fmt.Println("Mkdir called to " + name) return nil } func (r *RouterDir) OpenFile(ctx context.Context, name string, flag int, perm os.FileMode) (webdav.File, error) { // Implement the OpenFile method fmt.Println("OpenFile called to " + name) thisFile := &bokofile.File{} return thisFile, nil } func (r *RouterDir) RemoveAll(ctx context.Context, name string) error { // Implement the RemoveAll method fmt.Println("RemoveAll called to " + name) return nil } func (r *RouterDir) Rename(ctx context.Context, oldName, newName string) error { // Implement the Rename method fmt.Println("Rename called from " + oldName + " to " + newName) return nil } func (r *RouterDir) Stat(ctx context.Context, name string) (os.FileInfo, error) { // Implement the Stat method fmt.Println("Stat called to " + name) return nil, nil } // Ensure RouterDir implements the FileSystem interface var _ webdav.FileSystem = (*RouterDir)(nil)