mirror of
https://github.com/psviderski/uncloud.git
synced 2026-10-08 06:09:17 +00:00
feat(distlock): integrate distributed lease management into Machine API
This commit is contained in:
1 parent
00d68d9465
commit
1c29d4d5d0
3 files changed
+110
-2
No files matched your search
@@ -10,6 +10,7 @@ import (
|
||||
"github.com/psviderski/uncloud/internal/machine/api/pb"
|
||||
"github.com/psviderski/uncloud/internal/machine/docker"
|
||||
"github.com/psviderski/uncloud/pkg/api"
|
||||
distlockgrpc "github.com/psviderski/uncloud/pkg/distlock/grpc"
|
||||
"golang.org/x/net/proxy"
|
||||
"google.golang.org/grpc"
|
||||
"google.golang.org/grpc/metadata"
|
||||
@@ -28,6 +29,7 @@ type Client struct {
|
||||
// Docker is a namespaced client for the Docker service to distinguish Uncloud-specific service container operations
|
||||
// from generic Docker operations.
|
||||
Docker *docker.Client
|
||||
leases distlockgrpc.LeaseClient
|
||||
}
|
||||
|
||||
var _ api.Client = (*Client)(nil)
|
||||
@@ -57,6 +59,7 @@ func New(ctx context.Context, connector Connector) (*Client, error) {
|
||||
c.ClusterClient = pb.NewClusterClient(c.conn)
|
||||
c.Caddy = pb.NewCaddyClient(c.conn)
|
||||
c.Docker = docker.NewClient(c.conn)
|
||||
c.leases = distlockgrpc.NewLeaseClient(c.conn)
|
||||
|
||||
return c, nil
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user