v.io: v.io/x/ref/services/mounttable/mounttablelib Index | Files

package mounttablelib

import "v.io/x/ref/services/mounttable/mounttablelib"

Package mounttablelib implements utilities for mounttable implementations.

nolint:golint

Index

Package Files

mounttable.go mounttablelib.vdl.go neighborhood.go opts.go persistentstore.go serverlist.go servers.go versionedpermissions.go

Variables

var CollectionDesc rpc.InterfaceDesc = descCollection

CollectionDesc describes the Collection interface.

func Main Uses

func Main(opts Opts) error

func MainWithCtx Uses

func MainWithCtx(ctx *context.T, opts Opts) error

func NewLoopbackNeighborhoodDispatcher Uses

func NewLoopbackNeighborhoodDispatcher(host string, addresses ...string) (rpc.Dispatcher, error)

NewLoopbackNeighborhoodDispatcher creates a new instance of a dispatcher for a neighborhood service provider on loopback interfaces (meant for testing).

func NewMountTableDispatcher Uses

func NewMountTableDispatcher(ctx *context.T, permsFile, persistDir, statsPrefix string) (rpc.Dispatcher, error)

NewMountTableDispatcher creates a new server that uses the AccessLists specified in permissions file for authorization.

permsFile is a JSON-encoded mapping from paths in the mounttable to the access.Permissions for that path. The tags used in the map are the typical access tags (the Tag type defined in v.io/v23/security/access).

persistDir is the directory for persisting Permissions.

statsPrefix is the prefix for for exported statistics objects.

func NewMountTableDispatcherWithClock Uses

func NewMountTableDispatcherWithClock(ctx *context.T, permsFile, persistDir, statsPrefix string, clock timekeeper.TimeKeeper) (rpc.Dispatcher, error)

func NewNeighborhoodDispatcher Uses

func NewNeighborhoodDispatcher(host string, addresses ...string) (rpc.Dispatcher, error)

NewNeighborhoodDispatcher creates a new instance of a dispatcher for a neighborhood service provider.

func StartServers Uses

func StartServers(ctx *context.T, listenSpec rpc.ListenSpec, mountName, nhName, permsFile, persistDir, debugPrefix string) (string, func(), error)

type CollectionClientMethods Uses

type CollectionClientMethods interface {
    // Export sets the value for a name.  Overwrite controls the behavior when
    // an entry exists, if Overwrite is true, then the binding is replaced,
    // otherwise the call fails with an error.  The Val must be no larger than
    // MaxSize bytes.
    Export(_ *context.T, Val string, Overwrite bool, _ ...rpc.CallOpt) error
    // Lookup retrieves the value associated with a name.  Returns an error if
    // there is no such binding.
    Lookup(*context.T, ...rpc.CallOpt) ([]byte, error)
}

CollectionClientMethods is the client interface containing Collection methods.

type CollectionClientStub Uses

type CollectionClientStub interface {
    CollectionClientMethods
}

CollectionClientStub embeds CollectionClientMethods and is a placeholder for additional management operations.

func CollectionClient Uses

func CollectionClient(name string) CollectionClientStub

CollectionClient returns a client stub for Collection.

type CollectionServerMethods Uses

type CollectionServerMethods interface {
    // Export sets the value for a name.  Overwrite controls the behavior when
    // an entry exists, if Overwrite is true, then the binding is replaced,
    // otherwise the call fails with an error.  The Val must be no larger than
    // MaxSize bytes.
    Export(_ *context.T, _ rpc.ServerCall, Val string, Overwrite bool) error
    // Lookup retrieves the value associated with a name.  Returns an error if
    // there is no such binding.
    Lookup(*context.T, rpc.ServerCall) ([]byte, error)
}

CollectionServerMethods is the interface a server writer implements for Collection.

type CollectionServerStub Uses

type CollectionServerStub interface {
    CollectionServerStubMethods
    // DescribeInterfaces the Collection interfaces.
    Describe__() []rpc.InterfaceDesc
}

CollectionServerStub adds universal methods to CollectionServerStubMethods.

func CollectionServer Uses

func CollectionServer(impl CollectionServerMethods) CollectionServerStub

CollectionServer returns a server stub for Collection. It converts an implementation of CollectionServerMethods into an object that may be used by rpc.Server.

type CollectionServerStubMethods Uses

type CollectionServerStubMethods CollectionServerMethods

CollectionServerStubMethods is the server interface containing Collection methods, as expected by rpc.Server. There is no difference between this interface and CollectionServerMethods since there are no streaming methods.

type Opts Uses

type Opts struct {
    MountName  string
    AclFile    string //nolint:golint // API change required.
    NhName     string
    PersistDir string
}

func (*Opts) InitFlags Uses

func (o *Opts) InitFlags(f *flag.FlagSet)

Note: Where possible, we have flag default values be zero values, so that struct-based configuration matches flag-based configuration.

type VersionedPermissions Uses

type VersionedPermissions struct {
    V   int32
    P   access.Permissions
}

VersionedPermissions associates a Version with a Permissions

func CopyPermissions Uses

func CopyPermissions(cc *callContext, cur *node) *VersionedPermissions

CopyPermissions copies one node's permissions to another and adds the clients blessings as patterns to the Admin tag.

func NewVersionedPermissions Uses

func NewVersionedPermissions() *VersionedPermissions

func (*VersionedPermissions) AccessListForTag Uses

func (b *VersionedPermissions) AccessListForTag(tag string) (access.AccessList, bool)

AccessListForTag returns the current access list for the given tag.

func (*VersionedPermissions) Add Uses

func (b *VersionedPermissions) Add(pattern security.BlessingPattern, tag string)

Add adds the blessing pattern to the tag in the receiver.

func (*VersionedPermissions) Copy Uses

func (b *VersionedPermissions) Copy() *VersionedPermissions

Copy copies the receiver.

func (*VersionedPermissions) Get Uses

func (b *VersionedPermissions) Get() (string, access.Permissions)

Get returns the current Version and Permissions.

func (*VersionedPermissions) Set Uses

func (b *VersionedPermissions) Set(ctx *context.T, verstr string, perm access.Permissions) (*VersionedPermissions, error)

Set sets the Permissions iff Version matches the current Version. If the set happens, the Version is advanced. If b is nil, this creates a new VersionedPermissions.

Package mounttablelib imports 33 packages (graph) and is imported by 17 packages. Updated 2020-10-17. Refresh now. Tools for package owners.