events

package
v2.29.2 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2025 License: Apache-2.0 Imports: 16 Imported by: 32

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// MainQueueName is the name of the main queue
	// All events will go through here as they are forwarded to the consumer via the
	// group name
	// TODO: "fan-out" so not all events go through the same queue? requires investigation
	MainQueueName = "main-queue"

	// MetadatakeyEventType is the key used for the eventtype in the metadata map of the event
	MetadatakeyEventType = "eventtype"

	// MetadatakeyEventID is the key used for the eventID in the metadata map of the event
	MetadatakeyEventID = "eventid"

	// MetadatakeyTraceParent is the key used for the traceparent in the metadata map of the event
	MetadatakeyTraceParent = "traceparent"

	// MetadatakeyInitiatorID is the key used for the initiator id in the metadata map of the event
	MetadatakeyInitiatorID = "initiatorid"
)
View Source
var (
	// PPStepAntivirus is the step that scans for viruses
	PPStepAntivirus Postprocessingstep = "virusscan"
	// PPStepPolicies is the step the step that enforces policies
	PPStepPolicies Postprocessingstep = "policies"
	// PPStepDelay is the step that processing. Useful for testing or user annoyment
	PPStepDelay Postprocessingstep = "delay"
	// PPStepFinished is the step that signals that postprocessing is finished, but storage provider hasn't acknowledged it yet
	PPStepFinished Postprocessingstep = "finished"

	// PPOutcomeDelete means that the file and the upload should be deleted
	PPOutcomeDelete PostprocessingOutcome = "delete"
	// PPOutcomeAbort means that the upload is cancelled but the bytes are being kept in the upload folder
	PPOutcomeAbort PostprocessingOutcome = "abort"
	// PPOutcomeContinue means that the upload is moved to its final destination (eventually being marked with pp results)
	PPOutcomeContinue PostprocessingOutcome = "continue"
	// PPOutcomeRetry means that there was a temporary issue and the postprocessing should be retried at a later point in time
	PPOutcomeRetry PostprocessingOutcome = "retry"
)

Functions

func Consume

func Consume(s Consumer, group string, evs ...Unmarshaller) (<-chan Event, error)

Consume returns a channel that will get all events that match the given evs group defines the service type: One group will get exactly one copy of a event that is emitted NOTE: uses reflect on initialization

func ConsumeAll

func ConsumeAll(s Consumer, group string) (<-chan Event, error)

ConsumeAll allows consuming all events. Note that unmarshalling must be done manually in this case, therefore Event.Event will always be of type []byte

func Publish

func Publish(ctx context.Context, s Publisher, ev interface{}) error

Publish publishes the ev to the MainQueue from where it is distributed to all subscribers NOTE: needs to use reflect on runtime

Types

type BackchannelLogout

type BackchannelLogout struct {
	Executant *user.UserId
	SessionId string
	Timestamp *types.Timestamp
}

BackchannelLogout is emitted when the callback from the identity provider is received

func (BackchannelLogout) Unmarshal

func (BackchannelLogout) Unmarshal(v []byte) (interface{}, error)

Unmarshal to fulfill umarshaller interface

type BytesReceived

type BytesReceived struct {
	UploadID          string
	SpaceOwner        *user.UserId
	ExecutingUser     *user.User
	ResourceID        *provider.ResourceId
	Filename          string
	Filesize          uint64
	URL               string
	Timestamp         *types.Timestamp
	ImpersonatingUser *user.User
}

BytesReceived is emitted by the server when it received all bytes of an upload

func (BytesReceived) Unmarshal

func (BytesReceived) Unmarshal(v []byte) (interface{}, error)

Unmarshal to fulfill umarshaller interface

type Consumer

type Consumer interface {
	Consume(string, ...events.ConsumeOption) (<-chan events.Event, error)
}

Consumer is the interface consumer need to fulfill

type ContainerCreated

type ContainerCreated struct {
	SpaceOwner        *user.UserId
	Executant         *user.UserId
	Ref               *provider.Reference
	Owner             *user.UserId
	Timestamp         *types.Timestamp
	ImpersonatingUser *user.User
}

ContainerCreated is emitted when a directory has been created

func (ContainerCreated) Unmarshal

func (ContainerCreated) Unmarshal(v []byte) (interface{}, error)

Unmarshal to fulfill umarshaller interface

type Event

type Event struct {
	Type        string
	ID          string
	TraceParent string
	InitiatorID string
	Event       interface{}
}

Event is the envelope for events

func (*Event) GetTraceContext

func (e *Event) GetTraceContext(ctx context.Context) context.Context

GetTraceContext extracts the trace context from the event and injects it into the given context.

type FileDownloaded

type FileDownloaded struct {
	Executant         *user.UserId
	Ref               *provider.Reference
	Owner             *user.UserId
	Timestamp         *types.Timestamp
	ImpersonatingUser *user.User
}

FileDownloaded is emitted when a file is downloaded

func (FileDownloaded) Unmarshal

func (FileDownloaded) Unmarshal(v []byte) (interface{}, error)

Unmarshal to fulfill umarshaller interface

type FileLocked

type FileLocked struct {
	Executant         *user.UserId
	Ref               *provider.Reference
	Owner             *user.UserId
	Timestamp         *types.Timestamp
	ImpersonatingUser *user.User
}

FileLocked is emitted when a file is locked

func (FileLocked) Unmarshal

func (FileLocked) Unmarshal(v []byte) (interface{}, error)

Unmarshal to fulfill umarshaller interface

type FileTouched

type FileTouched struct {
	SpaceOwner        *user.UserId
	Executant         *user.UserId
	Ref               *provider.Reference
	Timestamp         *types.Timestamp
	ImpersonatingUser *user.User
}

FileTouched is emitted when a file is uploaded

func (FileTouched) Unmarshal

func (FileTouched) Unmarshal(v []byte) (interface{}, error)

Unmarshal to fulfill umarshaller interface

type FileUnlocked

type FileUnlocked struct {
	Executant         *user.UserId
	Ref               *provider.Reference
	Owner             *user.UserId
	Timestamp         *types.Timestamp
	ImpersonatingUser *user.User
}

FileUnlocked is emitted when a file is unlocked

func (FileUnlocked) Unmarshal

func (FileUnlocked) Unmarshal(v []byte) (interface{}, error)

Unmarshal to fulfill umarshaller interface

type FileUploaded

type FileUploaded struct {
	SpaceOwner        *user.UserId
	Executant         *user.UserId
	Ref               *provider.Reference
	Owner             *user.UserId
	Timestamp         *types.Timestamp
	ImpersonatingUser *user.User
}

FileUploaded is emitted when a file is uploaded

func (FileUploaded) Unmarshal

func (FileUploaded) Unmarshal(v []byte) (interface{}, error)

Unmarshal to fulfill umarshaller interface

type FileVersionRestored

type FileVersionRestored struct {
	SpaceOwner        *user.UserId
	Executant         *user.UserId
	Ref               *provider.Reference
	Owner             *user.UserId
	Key               string
	Timestamp         *types.Timestamp
	ImpersonatingUser *user.User
}

FileVersionRestored is emitted when a file version is restored

func (FileVersionRestored) Unmarshal

func (FileVersionRestored) Unmarshal(v []byte) (interface{}, error)

Unmarshal to fulfill umarshaller interface

type GroupCreated

type GroupCreated struct {
	Executant *user.UserId
	GroupID   string
	Timestamp *types.Timestamp
}

GroupCreated is emitted when a group was created

func (GroupCreated) Unmarshal

func (GroupCreated) Unmarshal(v []byte) (interface{}, error)

Unmarshal to fulfill umarshaller interface

type GroupDeleted

type GroupDeleted struct {
	Executant *user.UserId
	GroupID   string
	Timestamp *types.Timestamp
}

GroupDeleted is emitted when a group was deleted

func (GroupDeleted) Unmarshal

func (GroupDeleted) Unmarshal(v []byte) (interface{}, error)

Unmarshal to fulfill umarshaller interface

type GroupFeature

type GroupFeature struct {
	Name      string
	Value     string
	Timestamp *types.Timestamp
}

GroupFeature represents a group feature

type GroupFeatureChanged

type GroupFeatureChanged struct {
	Executant *user.UserId
	GroupID   string
	Features  []GroupFeature
	Timestamp *types.Timestamp
}

GroupFeatureChanged is emitted when a group feature was changed

func (GroupFeatureChanged) Unmarshal

func (GroupFeatureChanged) Unmarshal(v []byte) (interface{}, error)

Unmarshal to fulfill unmarshaller interface

type GroupMemberAdded

type GroupMemberAdded struct {
	Executant *user.UserId
	GroupID   string
	UserID    string
	Timestamp *types.Timestamp
}

GroupMemberAdded is emitted when a user was added to a group

func (GroupMemberAdded) Unmarshal

func (GroupMemberAdded) Unmarshal(v []byte) (interface{}, error)

Unmarshal to fulfill umarshaller interface

type GroupMemberRemoved

type GroupMemberRemoved struct {
	Executant *user.UserId
	GroupID   string
	UserID    string
	Timestamp *types.Timestamp
}

GroupMemberRemoved is emitted when a user was removed from a group

func (GroupMemberRemoved) Unmarshal

func (GroupMemberRemoved) Unmarshal(v []byte) (interface{}, error)

Unmarshal to fulfill umarshaller interface

type ItemMoved

type ItemMoved struct {
	SpaceOwner        *user.UserId
	Executant         *user.UserId
	Ref               *provider.Reference
	Owner             *user.UserId
	OldReference      *provider.Reference
	Timestamp         *types.Timestamp
	ImpersonatingUser *user.User
}

ItemMoved is emitted when a file or folder is moved

func (ItemMoved) Unmarshal

func (ItemMoved) Unmarshal(v []byte) (interface{}, error)

Unmarshal to fulfill umarshaller interface

type ItemPurged

type ItemPurged struct {
	Executant         *user.UserId
	ID                *provider.ResourceId
	Ref               *provider.Reference
	Owner             *user.UserId
	Timestamp         *types.Timestamp
	ImpersonatingUser *user.User
}

ItemPurged is emitted when a file or folder is removed from trashbin

func (ItemPurged) Unmarshal

func (ItemPurged) Unmarshal(v []byte) (interface{}, error)

Unmarshal to fulfill umarshaller interface

type ItemRestored

type ItemRestored struct {
	SpaceOwner        *user.UserId
	Executant         *user.UserId
	ID                *provider.ResourceId
	Ref               *provider.Reference
	Owner             *user.UserId
	OldReference      *provider.Reference
	Key               string
	Timestamp         *types.Timestamp
	ImpersonatingUser *user.User
}

ItemRestored is emitted when a file or folder is restored from trashbin

func (ItemRestored) Unmarshal

func (ItemRestored) Unmarshal(v []byte) (interface{}, error)

Unmarshal to fulfill umarshaller interface

type ItemTrashed

type ItemTrashed struct {
	SpaceOwner        *user.UserId
	Executant         *user.UserId
	ID                *provider.ResourceId
	Ref               *provider.Reference
	Owner             *user.UserId
	Timestamp         *types.Timestamp
	ImpersonatingUser *user.User
}

ItemTrashed is emitted when a file or folder is trashed

func (ItemTrashed) Unmarshal

func (ItemTrashed) Unmarshal(v []byte) (interface{}, error)

Unmarshal to fulfill umarshaller interface

type LinkAccessFailed

type LinkAccessFailed struct {
	Executant *user.UserId
	ShareID   *link.PublicShareId
	Token     string
	Status    rpc.Code
	Message   string
	Timestamp *types.Timestamp
}

LinkAccessFailed is emitted when an access to a public link has resulted in an error (by token)

func (LinkAccessFailed) Unmarshal

func (LinkAccessFailed) Unmarshal(v []byte) (interface{}, error)

Unmarshal to fulfill umarshaller interface

type LinkAccessed

type LinkAccessed struct {
	Executant         *user.UserId
	ShareID           *link.PublicShareId
	Sharer            *user.UserId
	ItemID            *provider.ResourceId
	Path              string
	Permissions       *link.PublicSharePermissions
	DisplayName       string
	Expiration        *types.Timestamp
	PasswordProtected bool
	CTime             *types.Timestamp
	Token             string
}

LinkAccessed is emitted when a public link is accessed successfully (by token)

func (LinkAccessed) Unmarshal

func (LinkAccessed) Unmarshal(v []byte) (interface{}, error)

Unmarshal to fulfill umarshaller interface

type LinkCreated

type LinkCreated struct {
	Executant         *user.UserId
	ShareID           *link.PublicShareId
	Sharer            *user.UserId
	ItemID            *provider.ResourceId
	ResourceName      string
	Permissions       *link.PublicSharePermissions
	DisplayName       string
	Expiration        *types.Timestamp
	PasswordProtected bool
	CTime             *types.Timestamp
	Token             string
}

LinkCreated is emitted when a public link is created

func (LinkCreated) Unmarshal

func (LinkCreated) Unmarshal(v []byte) (interface{}, error)

Unmarshal to fulfill umarshaller interface

type LinkRemoved

type LinkRemoved struct {
	Executant *user.UserId
	// split protobuf Ref
	ShareID      *link.PublicShareId
	ShareToken   string
	Timestamp    *types.Timestamp
	ItemID       *provider.ResourceId
	ResourceName string
}

LinkRemoved is emitted when a share is removed

func (LinkRemoved) Unmarshal

func (LinkRemoved) Unmarshal(v []byte) (interface{}, error)

Unmarshal to fulfill umarshaller interface

type LinkUpdated

type LinkUpdated struct {
	Executant         *user.UserId
	ShareID           *link.PublicShareId
	Sharer            *user.UserId
	ItemID            *provider.ResourceId
	ResourceName      string
	Permissions       *link.PublicSharePermissions
	DisplayName       string
	Expiration        *types.Timestamp
	PasswordProtected bool
	MTime             *types.Timestamp
	Token             string

	FieldUpdated string
}

LinkUpdated is emitted when a public link is updated

func (LinkUpdated) Unmarshal

func (LinkUpdated) Unmarshal(v []byte) (interface{}, error)

Unmarshal to fulfill umarshaller interface

type OCMCoreShareCreated

type OCMCoreShareCreated struct {
	ShareID       string
	Executant     *user.UserId
	Sharer        *user.UserId
	GranteeUserID *user.UserId
	ItemID        string
	ResourceName  string
	Permissions   *provider.ResourcePermissions
	CTime         *types.Timestamp
}

OCMCoreShareCreated is emitted when an ocm share is received

func (OCMCoreShareCreated) Unmarshal

func (OCMCoreShareCreated) Unmarshal(v []byte) (interface{}, error)

Unmarshal to fulfill umarshaller interface

type PersonalDataExtracted

type PersonalDataExtracted struct {
	Executant *user.UserId
	Timestamp *types.Timestamp
	ErrorMsg  string
}

PersonalDataExtracted is emitted when a user data extraction is finished

func (PersonalDataExtracted) Unmarshal

func (PersonalDataExtracted) Unmarshal(v []byte) (interface{}, error)

Unmarshal to fulfill umarshaller interface

type PostprocessingFinished

type PostprocessingFinished struct {
	UploadID          string
	Filename          string
	SpaceOwner        *user.UserId
	ExecutingUser     *user.User
	Result            map[Postprocessingstep]interface{} // it is a map[step]Event
	Outcome           PostprocessingOutcome
	Timestamp         *types.Timestamp
	ImpersonatingUser *user.User
}

PostprocessingFinished is emitted by *some* service which can decide that

func (PostprocessingFinished) Unmarshal

func (PostprocessingFinished) Unmarshal(v []byte) (interface{}, error)

Unmarshal to fulfill umarshaller interface

type PostprocessingOutcome

type PostprocessingOutcome string

PostprocessingOutcome defines the result of the postprocessing

type PostprocessingRetry

type PostprocessingRetry struct {
	UploadID        string
	Filename        string
	ExecutingUser   *user.User
	Failures        int
	BackoffDuration time.Duration
}

PostprocessingRetry is emitted by *some* service which can decide that

func (PostprocessingRetry) Unmarshal

func (PostprocessingRetry) Unmarshal(v []byte) (interface{}, error)

Unmarshal to fulfill umarshaller interface

type PostprocessingStepFinished

type PostprocessingStepFinished struct {
	UploadID      string
	ExecutingUser *user.User
	Filename      string

	FinishedStep Postprocessingstep    // name of the step
	Result       interface{}           // result information see VirusscanResult for example
	Error        error                 // possible error of the step
	Outcome      PostprocessingOutcome // some services may cause postprocessing to stop
	Timestamp    *types.Timestamp
}

PostprocessingStepFinished can be issued by the server when a postprocessing step is finished

func (PostprocessingStepFinished) Unmarshal

func (PostprocessingStepFinished) Unmarshal(v []byte) (interface{}, error)

Unmarshal to fulfill umarshaller interface

type Postprocessingstep

type Postprocessingstep string

Postprocessingstep are the available postprocessingsteps

type Publisher

type Publisher interface {
	Publish(string, interface{}, ...events.PublishOption) error
}

Publisher is the interface publishers need to fulfill

type ReceivedShareUpdated

type ReceivedShareUpdated struct {
	Executant      *user.UserId
	ShareID        *collaboration.ShareId
	ItemID         *provider.ResourceId
	Path           string
	Permissions    *collaboration.SharePermissions
	GranteeUserID  *user.UserId
	GranteeGroupID *group.GroupId
	Sharer         *user.UserId
	MTime          *types.Timestamp

	State string
}

ReceivedShareUpdated is emitted when a received share is accepted or declined

func (ReceivedShareUpdated) Unmarshal

func (ReceivedShareUpdated) Unmarshal(v []byte) (interface{}, error)

Unmarshal to fulfill umarshaller interface

type RestartPostprocessing

type RestartPostprocessing struct {
	UploadID  string
	Timestamp *types.Timestamp
}

RestartPostprocessing will be emitted by postprocessing service if it doesn't know about an upload

func (RestartPostprocessing) Unmarshal

func (RestartPostprocessing) Unmarshal(v []byte) (interface{}, error)

Unmarshal to fulfill umarshaller interface

type ResumePostprocessing

type ResumePostprocessing struct {
	UploadID  string
	Step      Postprocessingstep
	Timestamp *types.Timestamp
}

ResumePostprocessing can be emitted to repair broken postprocessing

func (ResumePostprocessing) Unmarshal

func (ResumePostprocessing) Unmarshal(v []byte) (interface{}, error)

Unmarshal to fulfill umarshaller interface

type ScienceMeshInviteTokenGenerated

type ScienceMeshInviteTokenGenerated struct {
	Sharer        *user.UserId
	RecipientMail string
	Token         string
	Description   string
	Expiration    uint64
	InviteLink    string
	Timestamp     *types.Timestamp
}

ScienceMeshInviteTokenGenerated is emitted when a sciencemesh token is generated

func (ScienceMeshInviteTokenGenerated) Unmarshal

func (ScienceMeshInviteTokenGenerated) Unmarshal(v []byte) (interface{}, error)

Unmarshal to fulfill unmarshaller interface

type SendEmailsEvent

type SendEmailsEvent struct {
	Interval string
}

SendEmailsEvent instructs the notification service to send grouped emails

func (SendEmailsEvent) Unmarshal

func (SendEmailsEvent) Unmarshal(v []byte) (interface{}, error)

Unmarshal to fulfill umarshaller interface

type SendSSE

type SendSSE struct {
	UserIDs []string
	Type    string
	Message []byte
}

SendSSE instructs the sse service to send one or multiple notifications

func (SendSSE) Unmarshal

func (SendSSE) Unmarshal(v []byte) (interface{}, error)

Unmarshal to fulfill umarshaller interface

type ShareCreated

type ShareCreated struct {
	ShareID   *collaboration.ShareId
	Executant *user.UserId
	Sharer    *user.UserId
	// split the protobuf Grantee oneof so we can use stdlib encoding/json
	GranteeUserID  *user.UserId
	GranteeGroupID *group.GroupId
	Sharee         *provider.Grantee
	ItemID         *provider.ResourceId
	ResourceName   string
	Permissions    *collaboration.SharePermissions
	CTime          *types.Timestamp
}

ShareCreated is emitted when a share is created

func (ShareCreated) Unmarshal

func (ShareCreated) Unmarshal(v []byte) (interface{}, error)

Unmarshal to fulfill umarshaller interface

type ShareExpired

type ShareExpired struct {
	ShareID    *collaboration.ShareId
	ShareOwner *user.UserId
	ItemID     *provider.ResourceId
	Path       string
	ExpiredAt  time.Time
	// split the protobuf Grantee oneof so we can use stdlib encoding/json
	GranteeUserID  *user.UserId
	GranteeGroupID *group.GroupId
}

ShareExpired is emitted when a share expires

func (ShareExpired) Unmarshal

func (ShareExpired) Unmarshal(v []byte) (interface{}, error)

Unmarshal to fulfill umarshaller interface

type ShareRemoved

type ShareRemoved struct {
	Executant *user.UserId
	// split protobuf Spec
	ShareID  *collaboration.ShareId
	ShareKey *collaboration.ShareKey
	// split the protobuf Grantee oneof so we can use stdlib encoding/json
	GranteeUserID  *user.UserId
	GranteeGroupID *group.GroupId

	ItemID       *provider.ResourceId
	ResourceName string
	Timestamp    time.Time
}

ShareRemoved is emitted when a share is removed

func (ShareRemoved) Unmarshal

func (ShareRemoved) Unmarshal(v []byte) (interface{}, error)

Unmarshal to fulfill umarshaller interface

type ShareUpdated

type ShareUpdated struct {
	Executant      *user.UserId
	ShareID        *collaboration.ShareId
	ItemID         *provider.ResourceId
	ResourceName   string
	Permissions    *collaboration.SharePermissions
	GranteeUserID  *user.UserId
	GranteeGroupID *group.GroupId
	Sharer         *user.UserId
	MTime          *types.Timestamp

	Updated string // Deprecated
	// indicates what was updated
	UpdateMask []string
}

ShareUpdated is emitted when a share is updated

func (ShareUpdated) Unmarshal

func (ShareUpdated) Unmarshal(v []byte) (interface{}, error)

Unmarshal to fulfill umarshaller interface

type SpaceCreated

type SpaceCreated struct {
	Executant *user.UserId
	ID        *provider.StorageSpaceId
	Owner     *user.UserId
	Root      *provider.ResourceId
	Name      string
	Type      string
	Quota     *provider.Quota
	MTime     *types.Timestamp
}

SpaceCreated is emitted when a space is created

func (SpaceCreated) Unmarshal

func (SpaceCreated) Unmarshal(v []byte) (interface{}, error)

Unmarshal to fulfill umarshaller interface

type SpaceDeleted

type SpaceDeleted struct {
	Executant    *user.UserId
	ID           *provider.StorageSpaceId
	SpaceName    string
	FinalMembers map[string]provider.ResourcePermissions
	Timestamp    time.Time
}

SpaceDeleted is emitted when a space is deleted

func (SpaceDeleted) Unmarshal

func (SpaceDeleted) Unmarshal(v []byte) (interface{}, error)

Unmarshal to fulfill umarshaller interface

type SpaceDisabled

type SpaceDisabled struct {
	Executant *user.UserId
	ID        *provider.StorageSpaceId
	Timestamp time.Time
}

SpaceDisabled is emitted when a space is disabled

func (SpaceDisabled) Unmarshal

func (SpaceDisabled) Unmarshal(v []byte) (interface{}, error)

Unmarshal to fulfill umarshaller interface

type SpaceEnabled

type SpaceEnabled struct {
	Executant *user.UserId
	ID        *provider.StorageSpaceId
	Owner     *user.UserId
	Timestamp *types.Timestamp
}

SpaceEnabled is emitted when a space is (re-)enabled

func (SpaceEnabled) Unmarshal

func (SpaceEnabled) Unmarshal(v []byte) (interface{}, error)

Unmarshal to fulfill umarshaller interface

type SpaceMembershipExpired

type SpaceMembershipExpired struct {
	SpaceOwner *user.UserId
	SpaceID    *provider.StorageSpaceId
	SpaceName  string
	ExpiredAt  time.Time
	// split the protobuf Grantee oneof so we can use stdlib encoding/json
	GranteeUserID  *user.UserId
	GranteeGroupID *group.GroupId
	Timestamp      *types.Timestamp
}

SpaceMembershipExpired is emitted when a space membership expires

func (SpaceMembershipExpired) Unmarshal

func (SpaceMembershipExpired) Unmarshal(v []byte) (interface{}, error)

Unmarshal to fulfill umarshaller interface

type SpaceRenamed

type SpaceRenamed struct {
	Executant *user.UserId
	ID        *provider.StorageSpaceId
	Owner     *user.UserId
	Name      string
	Timestamp *types.Timestamp
}

SpaceRenamed is emitted when a space is renamed

func (SpaceRenamed) Unmarshal

func (SpaceRenamed) Unmarshal(v []byte) (interface{}, error)

Unmarshal to fulfill umarshaller interface

type SpaceShareUpdated

type SpaceShareUpdated struct {
	Executant      *user.UserId
	GranteeUserID  *user.UserId
	GranteeGroupID *group.GroupId
	ID             *provider.StorageSpaceId
	Timestamp      time.Time
}

SpaceShareUpdated is emitted when a space share is updated

func (SpaceShareUpdated) Unmarshal

func (SpaceShareUpdated) Unmarshal(v []byte) (interface{}, error)

Unmarshal to fulfill umarshaller interface

type SpaceShared

type SpaceShared struct {
	Executant      *user.UserId
	GranteeUserID  *user.UserId
	GranteeGroupID *group.GroupId
	Creator        *user.UserId
	ID             *provider.StorageSpaceId
	Timestamp      time.Time
}

SpaceShared is emitted when a space is shared

func (SpaceShared) Unmarshal

func (SpaceShared) Unmarshal(v []byte) (interface{}, error)

Unmarshal to fulfill umarshaller interface

type SpaceUnshared

type SpaceUnshared struct {
	Executant      *user.UserId
	GranteeUserID  *user.UserId
	GranteeGroupID *group.GroupId
	ID             *provider.StorageSpaceId
	Timestamp      time.Time
}

SpaceUnshared is emitted when a space is unshared

func (SpaceUnshared) Unmarshal

func (SpaceUnshared) Unmarshal(v []byte) (interface{}, error)

Unmarshal to fulfill umarshaller interface

type SpaceUpdated

type SpaceUpdated struct {
	Executant *user.UserId
	ID        *provider.StorageSpaceId
	Space     *provider.StorageSpace
	Timestamp *types.Timestamp
}

SpaceUpdated is emitted when a space is updated

func (SpaceUpdated) Unmarshal

func (SpaceUpdated) Unmarshal(v []byte) (interface{}, error)

Unmarshal to fulfill umarshaller interface

type StartPostprocessingStep

type StartPostprocessingStep struct {
	UploadID      string
	URL           string
	ExecutingUser *user.User
	Filename      string
	Filesize      uint64
	Token         string               // for file retrieval in after upload case
	ResourceID    *provider.ResourceId // for file retrieval in after upload case
	RevaToken     string               // for file retrieval in after upload case

	StepToStart       Postprocessingstep
	Timestamp         *types.Timestamp
	ImpersonatingUser *user.User
}

StartPostprocessingStep can be issued by the server to start a postprocessing step

func (StartPostprocessingStep) Unmarshal

func (StartPostprocessingStep) Unmarshal(v []byte) (interface{}, error)

Unmarshal to fulfill umarshaller interface

type Stream

type Stream interface {
	Publish(string, interface{}, ...events.PublishOption) error
	Consume(string, ...events.ConsumeOption) (<-chan events.Event, error)
}

Stream is the interface common to Publisher and Consumer

type TagsAdded

type TagsAdded struct {
	SpaceOwner *user.UserId
	Tags       string
	Ref        *provider.Reference
	Executant  *user.UserId
	Timestamp  *types.Timestamp
}

TagsAdded is emitted when a Tag has been added

func (TagsAdded) Unmarshal

func (TagsAdded) Unmarshal(v []byte) (interface{}, error)

Unmarshal to fulfill umarshaller interface

type TagsRemoved

type TagsRemoved struct {
	SpaceOwner *user.UserId
	Tags       string
	Ref        *provider.Reference
	Executant  *user.UserId
	Timestamp  *types.Timestamp
}

TagsRemoved is emitted when a Tag has been added

func (TagsRemoved) Unmarshal

func (TagsRemoved) Unmarshal(v []byte) (interface{}, error)

Unmarshal to fulfill umarshaller interface

type Unmarshaller

type Unmarshaller interface {
	Unmarshal([]byte) (interface{}, error)
}

Unmarshaller is the interface events need to fulfill

type UploadReady

type UploadReady struct {
	UploadID          string
	Filename          string
	SpaceOwner        *user.UserId
	ExecutingUser     *user.User
	ImpersonatingUser *user.User
	FileRef           *provider.Reference
	Timestamp         *types.Timestamp
	Failed            bool
	IsVersion         bool
}

UploadReady is emitted by the storage provider when postprocessing is finished

func (UploadReady) Unmarshal

func (UploadReady) Unmarshal(v []byte) (interface{}, error)

Unmarshal to fulfill umarshaller interface

type UserCreated

type UserCreated struct {
	Executant *user.UserId
	UserID    string
	Timestamp *types.Timestamp
}

UserCreated is emitted when a user was created

func (UserCreated) Unmarshal

func (UserCreated) Unmarshal(v []byte) (interface{}, error)

Unmarshal to fulfill umarshaller interface

type UserDeleted

type UserDeleted struct {
	Executant *user.UserId
	UserID    string
	Timestamp *types.Timestamp
}

UserDeleted is emitted when a user was deleted

func (UserDeleted) Unmarshal

func (UserDeleted) Unmarshal(v []byte) (interface{}, error)

Unmarshal to fulfill umarshaller interface

type UserFeature

type UserFeature struct {
	Name     string
	Value    string
	OldValue *string
}

UserFeature represents a user feature

type UserFeatureChanged

type UserFeatureChanged struct {
	Executant *user.UserId
	UserID    string
	Features  []UserFeature
	Timestamp *types.Timestamp
}

UserFeatureChanged is emitted when a user feature was changed

func (UserFeatureChanged) Unmarshal

func (UserFeatureChanged) Unmarshal(v []byte) (interface{}, error)

Unmarshal to fulfill umarshaller interface

type UserSignedIn

type UserSignedIn struct {
	Executant *user.UserId
	Timestamp *types.Timestamp
}

UserSignedIn is emitted when a user signs in

func (UserSignedIn) Unmarshal

func (UserSignedIn) Unmarshal(v []byte) (interface{}, error)

Unmarshal to fulfill umarshaller interface

type VirusscanResult

type VirusscanResult struct {
	Infected    bool
	Description string
	Scandate    time.Time
	ResourceID  *provider.ResourceId
	ErrorMsg    string // empty when no error
	Timestamp   *types.Timestamp
}

VirusscanResult is the Result of a PostprocessingStepFinished event from the antivirus

Directories

Path Synopsis
consumer
Package consumer contains an example implementation of an event consumer
Package consumer contains an example implementation of an event consumer
publisher
Package publisher contains an example implementation for a publisher
Package publisher contains an example implementation for a publisher
Package stream provides streaming clients used by `Consume` and `Publish` methods
Package stream provides streaming clients used by `Consume` and `Publish` methods

Jump to

Keyboard shortcuts

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