Documentation
¶
Overview ¶
Package mounttablelib implements utilities for mounttable implementations.
Index ¶
- Variables
- func Main(opts Opts) error
- func MainWithCtx(ctx *context.T, opts Opts) error
- func NewLoopbackNeighborhoodDispatcher(host string, addresses ...string) (rpc.Dispatcher, error)
- func NewMountTableDispatcher(ctx *context.T, permsFile, persistDir, statsPrefix string) (rpc.Dispatcher, error)
- func NewMountTableDispatcherWithClock(ctx *context.T, permsFile, persistDir, statsPrefix string, ...) (rpc.Dispatcher, error)
- func NewNeighborhoodDispatcher(host string, addresses ...string) (rpc.Dispatcher, error)
- func StartServers(ctx *context.T, listenSpec rpc.ListenSpec, ...) (string, func(), error)
- type CollectionClientMethods
- type CollectionClientStub
- type CollectionServerMethods
- type CollectionServerStub
- type CollectionServerStubMethods
- type Opts
- type VersionedPermissions
- func (b *VersionedPermissions) AccessListForTag(tag string) (access.AccessList, bool)
- func (b *VersionedPermissions) Add(pattern security.BlessingPattern, tag string)
- func (b *VersionedPermissions) Copy() *VersionedPermissions
- func (b *VersionedPermissions) Get() (string, access.Permissions)
- func (b *VersionedPermissions) Set(ctx *context.T, verstr string, perm access.Permissions) (*VersionedPermissions, error)
Constants ¶
This section is empty.
Variables ¶
var CollectionDesc rpc.InterfaceDesc = descCollection
CollectionDesc describes the Collection interface.
Functions ¶
func NewLoopbackNeighborhoodDispatcher ¶
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 ¶
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 ¶
func NewMountTableDispatcherWithClock(ctx *context.T, permsFile, persistDir, statsPrefix string, clock timekeeper.TimeKeeper) (rpc.Dispatcher, error)
func NewNeighborhoodDispatcher ¶
func NewNeighborhoodDispatcher(host string, addresses ...string) (rpc.Dispatcher, error)
NewNeighborhoodDispatcher creates a new instance of a dispatcher for a neighborhood service provider.
func StartServers ¶
Types ¶
type CollectionClientMethods ¶
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 ¶
type CollectionClientStub interface { CollectionClientMethods }
CollectionClientStub embeds CollectionClientMethods and is a placeholder for additional management operations.
func CollectionClient ¶
func CollectionClient(name string) CollectionClientStub
CollectionClient returns a client stub for Collection.
type CollectionServerMethods ¶
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 ¶
type CollectionServerStub interface { CollectionServerStubMethods // DescribeInterfaces the Collection interfaces. Describe__() []rpc.InterfaceDesc }
CollectionServerStub adds universal methods to CollectionServerStubMethods.
func CollectionServer ¶
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 ¶
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 ¶
type VersionedPermissions ¶
type VersionedPermissions struct { V int32 P access.Permissions }
VersionedPermissions associates a Version with a Permissions
func CopyPermissions ¶
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 ¶
func NewVersionedPermissions() *VersionedPermissions
func (*VersionedPermissions) AccessListForTag ¶
func (b *VersionedPermissions) AccessListForTag(tag string) (access.AccessList, bool)
AccessListForTag returns the current access list for the given tag.
func (*VersionedPermissions) Add ¶
func (b *VersionedPermissions) Add(pattern security.BlessingPattern, tag string)
Add adds the blessing pattern to the tag in the receiver.
func (*VersionedPermissions) Copy ¶
func (b *VersionedPermissions) Copy() *VersionedPermissions
Copy copies the receiver.
func (*VersionedPermissions) Get ¶
func (b *VersionedPermissions) Get() (string, access.Permissions)
Get returns the current Version and Permissions.
func (*VersionedPermissions) Set ¶
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.