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

receivedsharecache

package
v2.52.1 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2026 License: Apache-2.0 Imports: 17 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 utils.FilenameEncoder, 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 utils.FilenameEncoder, spaceID, shareID string) (*State, error)

Get returns one entry from the cache

func (*Cache) List

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

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

func (*Cache) Remove

func (c *Cache) Remove(ctx context.Context, userID utils.FilenameEncoder, spaceID, shareID string) error

Remove removes an entry from the cache

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