Documentation ¶
Overview ¶
Package activity stores and distributes events to users in a social-feed manner.
It is composed of two services, one GRPC for persistence layer and one REST for logic. Persistence is currently only implemented using a BoltDB store.
Index ¶
- func AclActivity(author string, workspace *idm.Workspace, permission string) (ac *activity.Object)
- func Collection(items []*activity.Object) (c *activity.Object)
- func CountCollection(count int32) (c *activity.Object)
- func Digest(ctx context.Context, items []*activity.Object) (*activity.Object, error)
- func DocumentActivity(author string, event *tree.NodeChangeEvent) (ac *activity.Object, detectedNode *tree.Node)
- func Migrate(f dao.DAO, t dao.DAO, dryRun bool, status chan dao.MigratorStatus) (map[string]int, error)
- func NewDAO(ctx context.Context, o dao.DAO) (dao.DAO, error)
- type BoxName
- type Cache
- func (c *Cache) ActivitiesFor(ctx context.Context, ownerType activity.OwnerType, ownerId string, ...) error
- func (c *Cache) CloseConn(ctx context.Context) error
- func (c *Cache) CountUnreadForUser(ctx context.Context, userId string) int
- func (c *Cache) Delete(ctx context.Context, ownerType activity.OwnerType, ownerId string) error
- func (c *Cache) Init(ctx context.Context, values configx.Values) error
- func (c *Cache) ListSubscriptions(ctx context.Context, objectType activity.OwnerType, objectIds []string) (res []*activity.Subscription, e error)
- func (c *Cache) PostActivity(ctx context.Context, ownerType activity.OwnerType, ownerId string, ...) error
- func (c *Cache) Purge(ctx context.Context, logger func(string, int), ownerType activity.OwnerType, ...) error
- func (c *Cache) StoreLastUserInbox(ctx context.Context, userId string, boxName BoxName, activityId string) error
- func (c *Cache) UpdateSubscription(ctx context.Context, subscription *activity.Subscription) error
- type DAO
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AclActivity ¶
func Collection ¶
Collection groups activities into a collection.
func CountCollection ¶
CountCollection is a simple container for N activities.
func DocumentActivity ¶
Types ¶
type Cache ¶
type Cache struct { DAO // contains filtered or unexported fields }
func (*Cache) ActivitiesFor ¶
func (*Cache) CountUnreadForUser ¶
func (*Cache) ListSubscriptions ¶
func (*Cache) PostActivity ¶
func (*Cache) StoreLastUserInbox ¶
func (*Cache) UpdateSubscription ¶
type DAO ¶
type DAO interface { dao.DAO // PostActivity posts an activity to target inbox. PostActivity(ctx context.Context, ownerType activity.OwnerType, ownerId string, boxName BoxName, object *activity.Object, publish bool) error // UpdateSubscription updates Subscriptions status. UpdateSubscription(ctx context.Context, subscription *activity.Subscription) error // ListSubscriptions lists subs on a given object. // Returns a map of userId => status (true/false, required to disable default subscriptions like workspaces). ListSubscriptions(ctx context.Context, objectType activity.OwnerType, objectIds []string) ([]*activity.Subscription, error) // CountUnreadForUser counts the number of unread activities in user "Inbox" box. CountUnreadForUser(ctx context.Context, userId string) int // ActivitiesFor loads activities for a given owner. Targets "outbox" by default. ActivitiesFor(ctx context.Context, ownerType activity.OwnerType, ownerId string, boxName BoxName, refBoxOffset BoxName, reverseOffset int64, limit int64, result chan *activity.Object, done chan bool) error // StoreLastUserInbox stores the last read uint ID for a given box. StoreLastUserInbox(ctx context.Context, userId string, boxName BoxName, activityId string) error // Delete should be wired to "USER_DELETE" and "NODE_DELETE" events // to remove (or archive?) deprecated queues Delete(ctx context.Context, ownerType activity.OwnerType, ownerId string) error // Purge removes records based on a maximum number of records and/or based on the activity update date // It keeps at least minCount record(s) - to see last activity - even if older than expected date Purge(ctx context.Context, logger func(string, int), ownerType activity.OwnerType, ownerId string, boxName BoxName, minCount, maxCount int, updatedBefore time.Time, compactDB, clearBackup bool) error // contains filtered or unexported methods }
Directories ¶
Path | Synopsis |
---|---|
Package actions provides a scheduler action for generating mail digests
|
Package actions provides a scheduler action for generating mail digests |
Package grpc is the persistence service for all activities.
|
Package grpc is the persistence service for all activities. |
Package lang provides i18n strings related to activities
|
Package lang provides i18n strings related to activities |
Package render provides helper for rendering activies into various formats (currently markdown).
|
Package render provides helper for rendering activies into various formats (currently markdown). |
Package rest exposes a Rest service for querying activities feed
|
Package rest exposes a Rest service for querying activities feed |
Click to show internal directories.
Click to hide internal directories.