mirror of
https://github.com/anyproto/any-sync.git
synced 2025-06-08 05:57:03 +09:00
coordinatorclient: AclEventLog method
This commit is contained in:
parent
48b0bd91b0
commit
e2c893b549
2 changed files with 22 additions and 0 deletions
|
@ -424,6 +424,10 @@ func (m mockCoordinatorClient) AclGetRecords(ctx context.Context, spaceId, aclHe
|
|||
return
|
||||
}
|
||||
|
||||
func (m mockCoordinatorClient) AclEventLog(ctx context.Context, accountId, lastRecordId string, limit int) (records []*coordinatorproto.AclEventLogRecord, err error) {
|
||||
return
|
||||
}
|
||||
|
||||
func (m mockCoordinatorClient) Init(a *app.App) (err error) {
|
||||
return
|
||||
}
|
||||
|
|
|
@ -50,6 +50,8 @@ type CoordinatorClient interface {
|
|||
|
||||
AccountLimitsSet(ctx context.Context, req *coordinatorproto.AccountLimitsSetRequest) error
|
||||
|
||||
AclEventLog(ctx context.Context, accountId, lastRecordId string, limit int) (records []*coordinatorproto.AclEventLogRecord, err error)
|
||||
|
||||
app.Component
|
||||
}
|
||||
|
||||
|
@ -332,6 +334,22 @@ func (c *coordinatorClient) SpaceMakeUnshareable(ctx context.Context, spaceId, a
|
|||
})
|
||||
}
|
||||
|
||||
func (c *coordinatorClient) AclEventLog(ctx context.Context, accountId, lastRecordId string, limit int) (records []*coordinatorproto.AclEventLogRecord, err error) {
|
||||
err = c.doClient(ctx, func(cl coordinatorproto.DRPCCoordinatorClient) error {
|
||||
resp, err := cl.AclEventLog(ctx, &coordinatorproto.AclEventLogRequest{
|
||||
AccountIdentity: accountId,
|
||||
AfterId: lastRecordId,
|
||||
Limit: uint32(limit),
|
||||
})
|
||||
if err != nil {
|
||||
return rpcerr.Unwrap(err)
|
||||
}
|
||||
records = resp.Records
|
||||
return nil
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
func (c *coordinatorClient) doClient(ctx context.Context, f func(cl coordinatorproto.DRPCCoordinatorClient) error) error {
|
||||
p, err := c.getPeer(ctx)
|
||||
if err != nil {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue