Documentation
¶
Index ¶
- func CheckName(name string) error
- func IsValidName(name string) bool
- func Lookup(ctx context.Context, nsc *Client, nsvol blobcache.Handle, p string) (*blobcache.Handle, error)
- type Client
- func (nsc *Client) CreateAt(ctx context.Context, nsh blobcache.Handle, name string, ...) (*blobcache.Handle, error)
- func (nsc *Client) Delete(ctx context.Context, nsh blobcache.Handle, name string) error
- func (nsc *Client) GC(ctx context.Context, volh blobcache.Handle) error
- func (nsc *Client) Get(ctx context.Context, volh blobcache.Handle, name string, dst *Entry) (bool, error)
- func (nsc *Client) Init(ctx context.Context, volh blobcache.Handle) error
- func (nsc *Client) List(ctx context.Context, volh blobcache.Handle) ([]Entry, error)
- func (nsc *Client) ListNames(ctx context.Context, volh blobcache.Handle) ([]string, error)
- func (nsc Client) Lookup(ctx context.Context, volh blobcache.Handle, p string) (ent Entry, rem string, _ error)
- func (nsc *Client) Move(ctx context.Context, nsh blobcache.Handle, oldName, newName string) error
- func (nsc *Client) OpenAt(ctx context.Context, nsh blobcache.Handle, name string, ...) (*blobcache.Handle, error)
- func (nsc *Client) Put(ctx context.Context, nsh blobcache.Handle, name string, volh blobcache.Handle, ...) error
- type Entry
- type Namespace
- type ObjectExpr
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsValidName ¶
Types ¶
type Client ¶
Client allows manipulation of namespace volumes.
func ClientForVolume ¶
func ClientForVolume(ctx context.Context, svc blobcache.Service, nsvolh blobcache.Handle) (*Client, error)
ClientForVolume returns a Client configured to use the Namespace schema for the Volume If the Volume does not have a known Schema or the Schema is not Namespace then an error is returned.
func ClientForVolumeExpr ¶ added in v0.4.0
func ClientForVolumeExpr(ctx context.Context, svc blobcache.Service, nsvol ObjectExpr) (*Client, error)
ClientForVolumeExpr returns a Client configured to use the Namespace schema for the Volume If the Volume does not have a known Schema or the Schema is not Namespace then an error is returned.
func (Client) Lookup ¶ added in v0.5.1
func (nsc Client) Lookup(ctx context.Context, volh blobcache.Handle, p string) (ent Entry, rem string, _ error)
Lookup looks up prefixes of the path (ending in /) in volh, starting with the whole string, and getting shorter.
func (*Client) Move ¶ added in v0.5.1
Move atomically renames an entry from oldName to newName within a namespace volume. The link token is preserved as-is.
type Entry ¶
type Entry struct {
// Name is the key for this entry within the namespace.
Name string `json:"name"`
// Target is the OID of the entry.
Target blobcache.OID `json:"target"`
// Rights is the set of rights for the entry.
Rights blobcache.ActionSet `json:"rights"`
Secret blobcache.LTSecret `json:"secret"`
}
Entry represents an entry in a namespace.
type Namespace ¶
type Namespace interface {
NSList(ctx context.Context, s bcsdk.RO, root []byte) ([]Entry, error)
// NSGet retrieves the entry at the given name.
// If the entry exists, it is returned in dst and true is returned.
// If the entry does not exist, dst is not modified and false is returned.
NSGet(ctx context.Context, s bcsdk.RO, root []byte, name string, dst *Entry) (bool, error)
// Delete deletes the entry at the given name.
// Delete is idempotent, and does not fail if the entry does not exist.
NSDelete(ctx context.Context, s bcsdk.RW, root []byte, name string) ([]byte, error)
// Put performs an idempotent create or replace operation.
NSPut(ctx context.Context, s bcsdk.RW, root []byte, ent Entry) ([]byte, error)
}
Namespace is an interface for Schemas which support common Namespace operations.
type ObjectExpr ¶ added in v0.4.0
ObjectExpr is information capable of producing a Handle to an Object. Base is used to establish a connection to the local node. If the Secret is empty, then OpenFiat will be used to establish a connection The zero value for ObjectExpr refers to the root Volume.
func ParseObjectish ¶
func ParseObjectish(x string) (ObjectExpr, error)
func (*ObjectExpr) BaseHandle ¶ added in v0.4.0
func (oish *ObjectExpr) BaseHandle() *blobcache.Handle
func (*ObjectExpr) BaseIsHandle ¶ added in v0.4.0
func (oish *ObjectExpr) BaseIsHandle() bool
BaseIsHandle returns true if Base is a handle instead of an OID
func (*ObjectExpr) BaseOID ¶ added in v0.4.0
func (oish *ObjectExpr) BaseOID() blobcache.OID
func (*ObjectExpr) String ¶ added in v0.4.0
func (oish *ObjectExpr) String() string