receivedsharecache

package
v2.13.3 Latest Latest
Warning

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

Go to latest
Published: May 17, 2023 License: Apache-2.0 Imports: 11 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 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(userID, spaceID, shareID string) *State

Get returns one entry from the cache

func (*Cache) Persist

func (c *Cache) Persist(ctx context.Context, userID string) error

Persist persists the data for one user to the storage

func (*Cache) Sync

func (c *Cache) Sync(ctx context.Context, userID string) error

Sync updates the in-memory data with the data from the storage if it is outdated

type Space

type Space struct {
	Mtime  time.Time
	States map[string]*State
}

Space holds the received shares of one user in one space

type Spaces

type Spaces struct {
	Mtime  time.Time
	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
}

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