mirror of
https://github.com/anyproto/any-sync.git
synced 2025-06-08 05:57:03 +09:00
coordinator client: shareable/unshareable space methods
This commit is contained in:
parent
53fb239021
commit
45bd5be0e7
1 changed files with 22 additions and 0 deletions
|
@ -302,6 +302,28 @@ func (c *coordinatorClient) AccountLimitsSet(ctx context.Context, req *coordinat
|
|||
})
|
||||
}
|
||||
|
||||
func (c *coordinatorClient) SpaceMakeShareable(ctx context.Context, spaceId string) (err error) {
|
||||
return c.doClient(ctx, func(cl coordinatorproto.DRPCCoordinatorClient) error {
|
||||
if _, err := cl.SpaceMakeShareable(ctx, &coordinatorproto.SpaceMakeShareableRequest{
|
||||
SpaceId: spaceId,
|
||||
}); err != nil {
|
||||
return rpcerr.Unwrap(err)
|
||||
}
|
||||
return nil
|
||||
})
|
||||
}
|
||||
|
||||
func (c *coordinatorClient) SpaceMakeUnshareable(ctx context.Context, spaceId string) (err error) {
|
||||
return c.doClient(ctx, func(cl coordinatorproto.DRPCCoordinatorClient) error {
|
||||
if _, err := cl.SpaceMakeUnshareable(ctx, &coordinatorproto.SpaceMakeUnshareableRequest{
|
||||
SpaceId: spaceId,
|
||||
}); err != nil {
|
||||
return rpcerr.Unwrap(err)
|
||||
}
|
||||
return nil
|
||||
})
|
||||
}
|
||||
|
||||
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