share

package
v2.19.3 Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrShareAlreadyExisting = errtypes.AlreadyExists("share already exists")

ErrShareAlreadyExisting is the error returned when the share already exists for the 3-tuple consisting of (owner, resource, grantee).

View Source
var ErrShareNotFound = errtypes.NotFound("share not found")

ErrShareNotFound is the error returned where the share does not exist.

Functions

func NewTransferAccessMethod added in v2.17.0

func NewTransferAccessMethod() *ocm.AccessMethod

NewTransferAccessMethod is an abstraction for creating a Transfer access method.

func NewTransferProtocol added in v2.17.0

func NewTransferProtocol(sourceURI, sharedSecret string, size uint64) *ocm.Protocol

NewTransferProtocol is an abstraction for creating a Transfer protocol.

func NewWebDAVProtocol added in v2.17.0

func NewWebDAVProtocol(uri, shareSecred string, perms *ocm.SharePermissions) *ocm.Protocol

NewWebDAVProtocol is an abstraction for creating a WebDAV protocol.

func NewWebDavAccessMethod added in v2.17.0

func NewWebDavAccessMethod(perms *provider.ResourcePermissions) *ocm.AccessMethod

NewWebDavAccessMethod is an abstraction for creating a WebDAV access method.

func NewWebappAccessMethod added in v2.17.0

func NewWebappAccessMethod(mode appprovider.ViewMode) *ocm.AccessMethod

NewWebappAccessMethod is an abstraction for creating a Webapp access method.

func NewWebappProtocol added in v2.17.0

func NewWebappProtocol(uriTemplate string, viewMode appprovider.ViewMode) *ocm.Protocol

NewWebappProtocol is an abstraction for creating a Webapp protocol.

func ResourceIDFilter

func ResourceIDFilter(id *provider.ResourceId) *ocm.ListOCMSharesRequest_Filter

ResourceIDFilter is an abstraction for creating filter by resource id.

Types

type Repository added in v2.17.0

type Repository interface {
	// StoreShare stores a share.
	StoreShare(ctx context.Context, share *ocm.Share) (*ocm.Share, error)

	// GetShare gets the information for a share by the given ref.
	GetShare(ctx context.Context, user *userpb.User, ref *ocm.ShareReference) (*ocm.Share, error)

	// DeleteShare deletes the share pointed by ref.
	DeleteShare(ctx context.Context, user *userpb.User, ref *ocm.ShareReference) error

	// UpdateShare updates the mode of the given share.
	UpdateShare(ctx context.Context, user *userpb.User, ref *ocm.ShareReference, f ...*ocm.UpdateOCMShareRequest_UpdateField) (*ocm.Share, error)

	// ListShares returns the shares created by the user. If md is provided is not nil,
	// it returns only shares attached to the given resource.
	ListShares(ctx context.Context, user *userpb.User, filters []*ocm.ListOCMSharesRequest_Filter) ([]*ocm.Share, error)

	// StoreReceivedShare stores a received share.
	StoreReceivedShare(ctx context.Context, share *ocm.ReceivedShare) (*ocm.ReceivedShare, error)

	// ListReceivedShares returns the list of shares the user has access.
	ListReceivedShares(ctx context.Context, user *userpb.User) ([]*ocm.ReceivedShare, error)

	// GetReceivedShare returns the information for a received share the user has access.
	GetReceivedShare(ctx context.Context, user *userpb.User, ref *ocm.ShareReference) (*ocm.ReceivedShare, error)

	// UpdateReceivedShare updates the received share with share state.
	UpdateReceivedShare(ctx context.Context, user *userpb.User, share *ocm.ReceivedShare, fieldMask *field_mask.FieldMask) (*ocm.ReceivedShare, error)
}

Repository is the interface that manipulates the OCM shares repository.

Directories

Path Synopsis
repository
nextcloud
Package nextcloud verifies a clientID and clientSecret against a Nextcloud backend.
Package nextcloud verifies a clientID and clientSecret against a Nextcloud backend.

Jump to

Keyboard shortcuts

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