@@ -21,6 +21,7 @@ import (
2121 "github.com/jr-k/d4s/internal/dao/docker/container"
2222 "github.com/jr-k/d4s/internal/dao/docker/image"
2323 "github.com/jr-k/d4s/internal/dao/docker/network"
24+ "github.com/jr-k/d4s/internal/dao/docker/secret"
2425 "github.com/jr-k/d4s/internal/dao/docker/volume"
2526 "github.com/jr-k/d4s/internal/dao/swarm/node"
2627 "github.com/jr-k/d4s/internal/dao/swarm/service"
@@ -35,6 +36,7 @@ type Volume = volume.Volume
3536type Network = network.Network
3637type Service = service.Service
3738type Node = node.Node
39+ type Secret = secret.Secret
3840type ComposeProject = compose.ComposeProject
3941
4042type DockerClient struct {
@@ -49,6 +51,7 @@ type DockerClient struct {
4951 Network * network.Manager
5052 Service * service.Manager
5153 Node * node.Manager
54+ Secret * secret.Manager
5255 Compose * compose.Manager
5356}
5457
@@ -77,6 +80,7 @@ func NewDockerClient(contextName string) (*DockerClient, error) {
7780 Network : network .NewManager (cli , ctx ),
7881 Service : service .NewManager (cli , ctx ),
7982 Node : node .NewManager (cli , ctx ),
83+ Secret : secret .NewManager (cli , ctx ),
8084 Compose : compose .NewManager (cli , ctx ),
8185 }, nil
8286}
@@ -229,6 +233,10 @@ func (d *DockerClient) ListCompose() ([]common.Resource, error) {
229233 return d .Compose .List ()
230234}
231235
236+ func (d * DockerClient ) ListSecrets () ([]common.Resource , error ) {
237+ return d .Secret .List ()
238+ }
239+
232240// Actions wrappers
233241func (d * DockerClient ) StopContainer (id string ) error {
234242 return d .Container .Stop (id )
@@ -302,6 +310,10 @@ func (d *DockerClient) RemoveNode(id string, force bool) error {
302310 return d .Node .Remove (id , force )
303311}
304312
313+ func (d * DockerClient ) RemoveSecret (id string ) error {
314+ return d .Secret .Remove (id )
315+ }
316+
305317func (d * DockerClient ) StopComposeProject (projectName string ) error {
306318 return d .Compose .Stop (projectName )
307319}
@@ -347,6 +359,14 @@ func (d *DockerClient) GetServiceLogs(id string, since string, tail string, time
347359 return d .Service .Logs (id , since , tail , timestamps )
348360}
349361
362+ func (d * DockerClient ) GetServiceEnv (id string ) ([]string , error ) {
363+ return d .Service .GetEnv (id )
364+ }
365+
366+ func (d * DockerClient ) GetServiceSecrets (id string ) ([]* swarm.SecretReference , error ) {
367+ return d .Service .GetSecrets (id )
368+ }
369+
350370func (d * DockerClient ) GetComposeLogs (projectName string , since string , tail string , timestamps bool ) (io.ReadCloser , error ) {
351371 return d .Compose .Logs (projectName , since , tail , timestamps )
352372}
0 commit comments