@@ -100,3 +100,27 @@ type PrivacyMapper interface {
100
100
// given group ID key.
101
101
PrivacyDB (groupID session.ID ) PrivacyMapDB
102
102
}
103
+
104
+ // ActionDB is an interface that abstracts the database operations needed for
105
+ // the Action persistence and querying.
106
+ type ActionDB interface {
107
+ // AddAction persists the given action to the database.
108
+ AddAction (action * Action ) (uint64 , error )
109
+
110
+ // SetActionState finds the action specified by the ActionLocator and
111
+ // sets its state to the given state.
112
+ SetActionState (al * ActionLocator , state ActionState ,
113
+ errReason string ) error
114
+
115
+ // ListActions returns a list of Actions that pass the filterFn
116
+ // requirements. The query IndexOffset and MaxNum params can be used to
117
+ // control the number of actions returned. The return values are the
118
+ // list of actions, the last index and the total count (iff
119
+ // query.CountTotal is set).
120
+ ListActions (ctx context.Context , query * ListActionsQuery ,
121
+ options ... ListActionOption ) ([]* Action , uint64 , uint64 , error )
122
+
123
+ // GetActionsReadDB produces an ActionReadDB using the given group ID
124
+ // and feature name.
125
+ GetActionsReadDB (groupID session.ID , featureName string ) ActionsReadDB
126
+ }
0 commit comments