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 NewDAO(o dao.DAO) dao.DAO
- type BoxName
- type Cache
- func (c *Cache) ActivitiesFor(ownerType activity.OwnerType, ownerId string, boxName BoxName, ...) error
- func (c *Cache) CloseConn() error
- func (c *Cache) CountUnreadForUser(userId string) int
- func (c *Cache) Delete(ownerType activity.OwnerType, ownerId string) error
- func (c *Cache) Driver() string
- func (c *Cache) GetConn() dao.Conn
- func (c *Cache) Init(values configx.Values) error
- func (c *Cache) ListSubscriptions(objectType activity.OwnerType, objectIds []string) (res []*activity.Subscription, e error)
- func (c *Cache) PostActivity(ownerType activity.OwnerType, ownerId string, boxName BoxName, ...) error
- func (c *Cache) Prefix() string
- func (c *Cache) Purge(logger func(string), ownerType activity.OwnerType, ownerId string, ...) error
- func (c *Cache) SetConn(conn dao.Conn)
- func (c *Cache) StoreLastUserInbox(userId string, boxName BoxName, last []byte, activityId string) error
- func (c *Cache) UpdateSubscription(subscription *activity.Subscription) error
- type DAO
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AclActivity ¶ added in v1.5.0
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 {
// contains filtered or unexported fields
}
func (*Cache) ActivitiesFor ¶
func (*Cache) CountUnreadForUser ¶
func (*Cache) ListSubscriptions ¶
func (*Cache) PostActivity ¶
func (*Cache) StoreLastUserInbox ¶
func (*Cache) UpdateSubscription ¶
func (c *Cache) UpdateSubscription(subscription *activity.Subscription) error
type DAO ¶
type DAO interface { dao.DAO // PostActivity posts an activity to target inbox. PostActivity(ownerType activity.OwnerType, ownerId string, boxName BoxName, object *activity.Object, publishCtx context.Context) error // UpdateSubscription updates Subscriptions status. UpdateSubscription(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(objectType activity.OwnerType, objectIds []string) ([]*activity.Subscription, error) // CountUnreadForUser counts the number of unread activities in user "Inbox" box. CountUnreadForUser(userId string) int // ActivitiesFor loads activities for a given owner. Targets "outbox" by default. ActivitiesFor(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(userId string, boxName BoxName, last []byte, activityId string) error // Delete should be wired to "USER_DELETE" and "NODE_DELETE" events // to remove (or archive?) deprecated queues Delete(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(logger func(string), ownerType activity.OwnerType, ownerId string, boxName BoxName, minCount, maxCount int, updatedBefore time.Time, compactDB, clearBackup bool) error }
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.