publicshare

package
v3.15.2 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2026 License: Apache-2.0 Imports: 11 Imported by: 1 module, 1 package

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddSignature

func AddSignature(share *link.PublicShare, pw string) error

AddSignature augments a public share with a signature. The signature has a validity of 30 minutes.

func CreateSignature

func CreateSignature(token, pw string, expiration time.Time) (string, error)

CreateSignature calculates a signature for a public share.

func GroupFiltersByType

GroupFiltersByType groups the given filters and returns a map using the filter type as the key.

func IsExpired

func IsExpired(s *link.PublicShare) bool

IsExpired tests whether a public share is expired.

func MatchesAnyFilter

func MatchesAnyFilter(share *link.PublicShare, filters []*link.ListPublicSharesRequest_Filter) bool

MatchesAnyFilter checks if the share passes at least one of the given filters.

func MatchesFilter

func MatchesFilter(share *link.PublicShare, filter *link.ListPublicSharesRequest_Filter) bool

MatchesFilter tests if the share passes the filter.

func MatchesFilters

func MatchesFilters(share *link.PublicShare, filters []*link.ListPublicSharesRequest_Filter) bool

MatchesFilters checks if the share passes the given filters. Filters of the same type form a disjuntion, a logical OR. Filters of separate type form a conjunction, a logical AND. Here is an example: (resource_id=1 OR resource_id=2) AND (grantee_type=USER OR grantee_type=GROUP).

func ResourceIDFilter

ResourceIDFilter is an abstraction for creating filter by resource id.

Types

type Manager

type Manager interface {
	CreatePublicShare(ctx context.Context, u *user.User, md *provider.ResourceInfo, g *link.Grant, description string, internal bool, notifyUploads bool, notifyUploadsExtraRecipients string) (*link.PublicShare, error)
	UpdatePublicShare(ctx context.Context, u *user.User, req *link.UpdatePublicShareRequest, g *link.Grant) (*link.PublicShare, error)
	GetPublicShare(ctx context.Context, u *user.User, ref *link.PublicShareReference, sign bool) (*link.PublicShare, error)
	ListPublicShares(ctx context.Context, u *user.User, filters []*link.ListPublicSharesRequest_Filter, md *provider.ResourceInfo, sign bool) ([]*link.PublicShare, error)
	RevokePublicShare(ctx context.Context, u *user.User, ref *link.PublicShareReference) error
	GetPublicShareByToken(ctx context.Context, token string, auth *link.PublicShareAuthentication, sign bool) (*link.PublicShare, error)
}

Manager manipulates public shares.

Directories

Path Synopsis
manager

Jump to

Keyboard shortcuts

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