events

package
v2.19.6 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2024 License: Apache-2.0 Imports: 15 Imported by: 14

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"
)
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 added in v2.13.0

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 BytesReceived added in v2.13.0

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

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

func (BytesReceived) Unmarshal added in v2.13.0

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 added in v2.3.0

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

ContainerCreated is emitted when a directory has been created

func (ContainerCreated) Unmarshal added in v2.3.0

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

Unmarshal to fulfill umarshaller interface

type Event added in v2.13.0

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

Event is the envelope for events

func (*Event) GetTraceContext added in v2.16.0

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 added in v2.1.0

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

FileDownloaded is emitted when a file is downloaded

func (FileDownloaded) Unmarshal added in v2.1.0

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

Unmarshal to fulfill umarshaller interface

type FileLocked added in v2.19.2

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

FileLocked is emitted when a file is locked

func (FileLocked) Unmarshal added in v2.19.2

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

Unmarshal to fulfill umarshaller interface

type FileTouched added in v2.6.1

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

FileTouched is emitted when a file is uploaded

func (FileTouched) Unmarshal added in v2.6.1

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

Unmarshal to fulfill umarshaller interface

type FileUnlocked added in v2.19.2

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

FileUnlocked is emitted when a file is unlocked

func (FileUnlocked) Unmarshal added in v2.19.2

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

Unmarshal to fulfill umarshaller interface

type FileUploaded added in v2.1.0

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

FileUploaded is emitted when a file is uploaded

func (FileUploaded) Unmarshal added in v2.1.0

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

Unmarshal to fulfill umarshaller interface

type FileVersionRestored added in v2.1.0

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

FileVersionRestored is emitted when a file version is restored

func (FileVersionRestored) Unmarshal added in v2.1.0

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

Unmarshal to fulfill umarshaller interface

type GroupCreated added in v2.2.0

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

GroupCreated is emitted when a group was created

func (GroupCreated) Unmarshal added in v2.2.0

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

Unmarshal to fulfill umarshaller interface

type GroupDeleted added in v2.2.0

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

GroupDeleted is emitted when a group was deleted

func (GroupDeleted) Unmarshal added in v2.2.0

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

Unmarshal to fulfill umarshaller interface

type GroupFeature added in v2.13.0

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

GroupFeature represents a group feature

type GroupFeatureChanged added in v2.13.0

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 added in v2.13.0

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

Unmarshal to fulfill unmarshaller interface

type GroupMemberAdded added in v2.2.0

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 added in v2.2.0

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

Unmarshal to fulfill umarshaller interface

type GroupMemberRemoved added in v2.2.0

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 added in v2.2.0

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

Unmarshal to fulfill umarshaller interface

type ItemMoved added in v2.1.0

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

ItemMoved is emitted when a file or folder is moved

func (ItemMoved) Unmarshal added in v2.1.0

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

Unmarshal to fulfill umarshaller interface

type ItemPurged added in v2.1.0

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

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

func (ItemPurged) Unmarshal added in v2.1.0

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

Unmarshal to fulfill umarshaller interface

type ItemRestored added in v2.1.0

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
}

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

func (ItemRestored) Unmarshal added in v2.1.0

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

Unmarshal to fulfill umarshaller interface

type ItemTrashed added in v2.1.0

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

ItemTrashed is emitted when a file or folder is trashed

func (ItemTrashed) Unmarshal added in v2.1.0

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

Unmarshal to fulfill umarshaller interface

type LinkAccessFailed added in v2.1.0

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 added in v2.1.0

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

Unmarshal to fulfill umarshaller interface

type LinkAccessed added in v2.1.0

type LinkAccessed struct {
	Executant         *user.UserId
	ShareID           *link.PublicShareId
	Sharer            *user.UserId
	ItemID            *provider.ResourceId
	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 added in v2.1.0

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

Unmarshal to fulfill umarshaller interface

type LinkCreated added in v2.1.0

type LinkCreated struct {
	Executant         *user.UserId
	ShareID           *link.PublicShareId
	Sharer            *user.UserId
	ItemID            *provider.ResourceId
	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 added in v2.1.0

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

Unmarshal to fulfill umarshaller interface

type LinkRemoved added in v2.1.0

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

LinkRemoved is emitted when a share is removed

func (LinkRemoved) Unmarshal added in v2.1.0

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

Unmarshal to fulfill umarshaller interface

type LinkUpdated added in v2.1.0

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

	FieldUpdated string
}

LinkUpdated is emitted when a public link is updated

func (LinkUpdated) Unmarshal added in v2.1.0

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

Unmarshal to fulfill umarshaller interface

type PersonalDataExtracted added in v2.13.0

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

PersonalDataExtracted is emitted when a user data extraction is finished

func (PersonalDataExtracted) Unmarshal added in v2.13.0

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

Unmarshal to fulfill umarshaller interface

type PostprocessingFinished added in v2.13.0

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
}

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

func (PostprocessingFinished) Unmarshal added in v2.13.0

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

Unmarshal to fulfill umarshaller interface

type PostprocessingOutcome added in v2.13.0

type PostprocessingOutcome string

PostprocessingOutcome defines the result of the postprocessing

type PostprocessingRetry added in v2.17.0

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 added in v2.17.0

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

Unmarshal to fulfill umarshaller interface

type PostprocessingStepFinished added in v2.13.0

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 added in v2.13.0

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

Unmarshal to fulfill umarshaller interface

type Postprocessingstep added in v2.13.0

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 added in v2.1.0

type ReceivedShareUpdated struct {
	Executant      *user.UserId
	ShareID        *collaboration.ShareId
	ItemID         *provider.ResourceId
	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 added in v2.1.0

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

Unmarshal to fulfill umarshaller interface

type RestartPostprocessing added in v2.15.0

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 added in v2.15.0

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

Unmarshal to fulfill umarshaller interface

type ResumePostprocessing added in v2.15.0

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

ResumePostprocessing can be emitted to repair broken postprocessing

func (ResumePostprocessing) Unmarshal added in v2.15.0

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

Unmarshal to fulfill umarshaller interface

type SendSSE added in v2.17.0

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

SendSSE instructs the sse service to send one or multiple notifications

func (SendSSE) Unmarshal added in v2.17.0

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
	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 added in v2.13.0

type ShareExpired struct {
	ShareID    *collaboration.ShareId
	ShareOwner *user.UserId
	ItemID     *provider.ResourceId
	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 added in v2.13.0

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

Unmarshal to fulfill umarshaller interface

type ShareRemoved added in v2.1.0

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
	Timestamp time.Time
}

ShareRemoved is emitted when a share is removed

func (ShareRemoved) Unmarshal added in v2.1.0

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

Unmarshal to fulfill umarshaller interface

type ShareUpdated added in v2.1.0

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

	// indicates what was updated - one of "displayname", "permissions"
	Updated string
}

ShareUpdated is emitted when a share is updated

func (ShareUpdated) Unmarshal added in v2.1.0

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

Unmarshal to fulfill umarshaller interface

type SpaceCreated added in v2.1.0

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 added in v2.1.0

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

Unmarshal to fulfill umarshaller interface

type SpaceDeleted added in v2.1.0

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 added in v2.1.0

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

Unmarshal to fulfill umarshaller interface

type SpaceDisabled added in v2.1.0

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

SpaceDisabled is emitted when a space is disabled

func (SpaceDisabled) Unmarshal added in v2.1.0

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

Unmarshal to fulfill umarshaller interface

type SpaceEnabled added in v2.1.0

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 added in v2.1.0

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

Unmarshal to fulfill umarshaller interface

type SpaceMembershipExpired added in v2.13.0

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 added in v2.13.0

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

Unmarshal to fulfill umarshaller interface

type SpaceRenamed added in v2.1.0

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 added in v2.1.0

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

Unmarshal to fulfill umarshaller interface

type SpaceShared added in v2.11.0

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 added in v2.11.0

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

Unmarshal to fulfill umarshaller interface

type SpaceUnshared added in v2.12.0

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 added in v2.12.0

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

Unmarshal to fulfill umarshaller interface

type SpaceUpdated added in v2.12.0

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 added in v2.12.0

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

Unmarshal to fulfill umarshaller interface

type StartPostprocessingStep added in v2.13.0

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
}

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

func (StartPostprocessingStep) Unmarshal added in v2.13.0

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 added in v2.13.0

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 added in v2.13.0

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

Unmarshal to fulfill umarshaller interface

type TagsRemoved added in v2.13.0

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 added in v2.13.0

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 added in v2.13.0

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

UploadReady is emitted by the storage provider when postprocessing is finished

func (UploadReady) Unmarshal added in v2.13.0

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

Unmarshal to fulfill umarshaller interface

type UserCreated added in v2.2.0

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

UserCreated is emitted when a user was created

func (UserCreated) Unmarshal added in v2.2.0

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

Unmarshal to fulfill umarshaller interface

type UserDeleted added in v2.2.0

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

UserDeleted is emitted when a user was deleted

func (UserDeleted) Unmarshal added in v2.2.0

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

Unmarshal to fulfill umarshaller interface

type UserFeature added in v2.2.0

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

UserFeature represents a user feature

type UserFeatureChanged added in v2.2.0

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 added in v2.2.0

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

Unmarshal to fulfill umarshaller interface

type VirusscanResult added in v2.13.0

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