blob: fba8427fa727aad161b875f5ec6a0443c1b5c6bc [file] [log] [blame] [edit]
// Copyright 2015 The Vanadium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// Package namespace defines an RPC services that allows remoting of the
// namespace client library over the wire. This is useful for
// javascript so it doesn't have to implement the library.
// This should be kept in sync with the namespace library (v.io/v23/naming).
package namespace
import (
"time"
"v.io/v23/naming"
"v.io/v23/security/access"
)
type Namespace interface {
// Run a glob query and stream the results.
Glob(pattern string) stream<_, naming.GlobReply> error
// Mount mounts a server under the given name.
Mount(name, server string, ttl time.Duration, replace bool) error
// Unmount removes an existing mount point.
Unmount(name, server string) error
// Resolve resolves a name to an address.
Resolve(name string) ([]string | error)
// ResolveToMountTable resolves a name to the address of the mounttable
// directly hosting it.
ResolveToMountTable(name string) ([]string | error)
// FlushCacheEntry removes the namespace cache entry for a given name.
FlushCacheEntry(name string) (bool | error)
// DisableCache disables the naming cache.
DisableCache(disable bool) error
// Roots returns the addresses of the current mounttable roots.
Roots() ([]string | error)
// SetRoots sets the current mounttable roots.
SetRoots(roots []string) error
// SetPermissions sets the AccessList in a node in a mount table.
SetPermissions(name string, perms access.Permissions, version string) error
// GetPermissions returns the AccessList in a node in a mount table.
GetPermissions(name string) (perms access.Permissions, version string | error)
// Delete deletes the name from the mounttable and, if requested, any subtree.
Delete(name string, deleteSubtree bool) error
}