MCPcopy Create free account
hub / github.com/docker/secrets-engine / WithConnection

Function WithConnection

plugin/config.go:56–68  ·  view source on GitHub ↗

WithConnection sets an existing secrets runtime connection to use.

(conn net.Conn)

Source from the content-addressed store, hash-verified

54
55// WithConnection sets an existing secrets runtime connection to use.
56func WithConnection(conn net.Conn) ManualLaunchOption {
57 return func(s *cfg) error {
58 if s.conn != nil {
59 return errors.New("connection already set")
60 }
61 hijackedConn, err := ipc.Hijackify(conn, hijackTimeout)
62 if err != nil {
63 return fmt.Errorf("external plugin rejected: %w", err)
64 }
65 s.conn = hijackedConn
66 return nil
67 }
68}
69
70type cfg struct {
71 Config

Callers 1

Calls 1

ErrorfMethod · 0.65

Tested by 1