Documentation ¶
Index ¶
- func NewDefault(m map[string]interface{}) (share.Manager, error)
- type EventOptions
- type Manager
- func (m *Manager) GetReceivedShare(ctx context.Context, ref *collaboration.ShareReference) (*collaboration.ReceivedShare, error)
- func (m *Manager) GetShare(ctx context.Context, ref *collaboration.ShareReference) (*collaboration.Share, error)
- func (m *Manager) ListReceivedShares(ctx context.Context, filters []*collaboration.Filter) ([]*collaboration.ReceivedShare, error)
- func (m *Manager) ListShares(ctx context.Context, filters []*collaboration.Filter) ([]*collaboration.Share, error)
- func (m *Manager) Load(ctx context.Context, shareChan <-chan *collaboration.Share, ...) error
- func (m *Manager) Share(ctx context.Context, md *provider.ResourceInfo, g *collaboration.ShareGrant) (*collaboration.Share, error)
- func (m *Manager) Unshare(ctx context.Context, ref *collaboration.ShareReference) error
- func (m *Manager) UpdateReceivedShare(ctx context.Context, receivedShare *collaboration.ReceivedShare, ...) (*collaboration.ReceivedShare, error)
- func (m *Manager) UpdateShare(ctx context.Context, ref *collaboration.ShareReference, ...) (*collaboration.Share, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type EventOptions ¶ added in v2.13.0
type EventOptions struct { NatsAddress string `mapstructure:"natsaddress"` NatsClusterID string `mapstructure:"natsclusterid"` TLSInsecure bool `mapstructure:"tlsinsecure"` TLSRootCACertificate string `mapstructure:"tlsrootcacertificate"` }
EventOptions are the configurable options for events
type Manager ¶
type Manager struct { sync.RWMutex Cache providercache.Cache // holds all shares, sharded by provider id and space id CreatedCache sharecache.Cache // holds the list of shares a user has created, sharded by user id GroupReceivedCache sharecache.Cache // holds the list of shares a group has access to, sharded by group id UserReceivedStates receivedsharecache.Cache // holds the state of shares a user has received, sharded by user id SpaceRoot *provider.ResourceId MaxConcurrency int // contains filtered or unexported fields }
Manager implements a share manager using a cs3 storage backend with local caching
func New ¶
func New(s metadata.Storage, gc gatewayv1beta1.GatewayAPIClient, ttlSeconds int, es events.Stream, maxconcurrency int) (*Manager, error)
New returns a new manager instance.
func (*Manager) GetReceivedShare ¶
func (m *Manager) GetReceivedShare(ctx context.Context, ref *collaboration.ShareReference) (*collaboration.ReceivedShare, error)
GetReceivedShare returns the information for a received share.
func (*Manager) GetShare ¶
func (m *Manager) GetShare(ctx context.Context, ref *collaboration.ShareReference) (*collaboration.Share, error)
GetShare gets the information for a share by the given ref.
func (*Manager) ListReceivedShares ¶
func (m *Manager) ListReceivedShares(ctx context.Context, filters []*collaboration.Filter) ([]*collaboration.ReceivedShare, error)
ListReceivedShares returns the list of shares the user has access to.
func (*Manager) ListShares ¶
func (m *Manager) ListShares(ctx context.Context, filters []*collaboration.Filter) ([]*collaboration.Share, error)
ListShares returns the shares created by the user
func (*Manager) Load ¶ added in v2.9.0
func (m *Manager) Load(ctx context.Context, shareChan <-chan *collaboration.Share, receivedShareChan <-chan share.ReceivedShareWithUser) error
Load imports shares and received shares from channels (e.g. during migration)
func (*Manager) Share ¶
func (m *Manager) Share(ctx context.Context, md *provider.ResourceInfo, g *collaboration.ShareGrant) (*collaboration.Share, error)
Share creates a new share
func (*Manager) Unshare ¶
func (m *Manager) Unshare(ctx context.Context, ref *collaboration.ShareReference) error
Unshare deletes a share
func (*Manager) UpdateReceivedShare ¶
func (m *Manager) UpdateReceivedShare(ctx context.Context, receivedShare *collaboration.ReceivedShare, fieldMask *field_mask.FieldMask) (*collaboration.ReceivedShare, error)
UpdateReceivedShare updates the received share with share state.
func (*Manager) UpdateShare ¶
func (m *Manager) UpdateShare(ctx context.Context, ref *collaboration.ShareReference, p *collaboration.SharePermissions, updated *collaboration.Share, fieldMask *field_mask.FieldMask) (*collaboration.Share, error)
UpdateShare updates the mode of the given share.