receivedsharecache

package
v2.24.1 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2024 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache

type Cache struct {
	ReceivedSpaces mtimesyncedcache.Map[string, *Spaces]
	// contains filtered or unexported fields
}

Cache stores the list of received shares and their states It functions as an in-memory cache with a persistence layer The storage is sharded by user

func New

func New(s metadata.Storage, ttl time.Duration) Cache

New returns a new Cache instance

func (*Cache) Add

func (c *Cache) Add(ctx context.Context, userID, spaceID string, rs *collaboration.ReceivedShare) error

Add adds a new entry to the cache

func (*Cache) Get

func (c *Cache) Get(ctx context.Context, userID, spaceID, shareID string) (*State, error)

Get returns one entry from the cache

func (*Cache) List added in v2.17.0

func (c *Cache) List(ctx context.Context, userID string) (map[string]*Space, error)

List returns a list of received shares for a given user The return list is guaranteed to be thread-safe

type Space

type Space struct {
	States map[string]*State
}

Space holds the received shares of one user in one space

type Spaces

type Spaces struct {
	Spaces map[string]*Space
	// contains filtered or unexported fields
}

Spaces holds the received shares of one user per space

type State

type State struct {
	State      collaboration.ShareState
	MountPoint *provider.Reference
	Hidden     bool
}

State holds the state information of a received share

Jump to

Keyboard shortcuts

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