Help us shape the future of Go! Take the 2026 Go Developer Survey

jsoncs3

package
v2.52.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 26, 2026 License: Apache-2.0 Imports: 35 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewDefault

func NewDefault(m map[string]interface{}, logger *zerolog.Logger) (share.Manager, error)

NewDefault returns a new manager instance with default dependencies

Types

type EventOptions

type EventOptions struct {
	Endpoint             string `mapstructure:"natsaddress"`
	Cluster              string `mapstructure:"natsclusterid"`
	TLSInsecure          bool   `mapstructure:"tlsinsecure"`
	TLSRootCACertificate string `mapstructure:"tlsrootcacertificate"`
	EnableTLS            bool   `mapstructure:"enabletls"`
	AuthUsername         string `mapstructure:"authusername"`
	AuthPassword         string `mapstructure:"authpassword"`
}

EventOptions are the configurable options for events

type Manager

type Manager struct {
	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,
	logger *zerolog.Logger,
	gatewaySelector pool.Selectable[gatewayv1beta1.GatewayAPIClient],
	ttlSeconds int,
	es events.Stream,
	maxconcurrency int,
) (*Manager, error)

New returns a new manager instance.

func (*Manager) CleanupStaleShares

func (m *Manager) CleanupStaleShares(ctx context.Context) error

func (*Manager) GetReceivedShare

GetReceivedShare returns the information for a received share.

func (*Manager) GetShare

GetShare gets the information for a share by the given ref.

func (*Manager) ListReceivedShares

func (m *Manager) ListReceivedShares(ctx context.Context, filters []*collaboration.Filter, forUser *userv1beta1.UserId) ([]*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

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) ProcessEvents

func (m *Manager) ProcessEvents(ch <-chan events.Event)

func (*Manager) Ready added in v2.50.0

func (m *Manager) Ready() <-chan struct{}

Ready returns a channel that is closed once the background initialization goroutine has successfully connected to the metadata storage.

func (*Manager) RunMigration added in v2.52.0

func (m *Manager) RunMigration(ctx context.Context, name string) error

RunMigration runs the named migration whether or not it has already been applied, and blocks until it is done. It is meant for operators repeating a migration; the ordinary startup path is RunMigrations.

func (*Manager) RunMigrations added in v2.45.0

func (m *Manager) RunMigrations(cfg migration.MigrationConfig)

RunMigrations starts data migrations in a background goroutine. It should be called once after New() in production server startup. Callers that do not need migrations should call SkipMigrations instead to unblock write operations.

func (*Manager) Share

Share creates a new share

func (*Manager) SkipMigrations added in v2.45.0

func (m *Manager) SkipMigrations()

SkipMigrations unblocks write operations on this instance without running any migrations. It must be called when RunMigrations will not be called, for example in tests.

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, forUser *userv1beta1.UserId) (*collaboration.ReceivedShare, error)

UpdateReceivedShare updates the received share with share state.

func (*Manager) UpdateShare

UpdateShare updates the mode of the given share.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL