github.com/hustcat/docker@v1.3.3-0.20160314103604-901c67a8eeab/cliconfig/credentials/shell_command.go (about) 1 package credentials 2 3 import ( 4 "io" 5 "os/exec" 6 ) 7 8 func shellCommandFn(storeName string) func(args ...string) command { 9 name := remoteCredentialsPrefix + storeName 10 return func(args ...string) command { 11 return &shell{cmd: exec.Command(name, args...)} 12 } 13 } 14 15 // shell invokes shell commands to talk with a remote credentials helper. 16 type shell struct { 17 cmd *exec.Cmd 18 } 19 20 // Output returns responses from the remote credentials helper. 21 func (s *shell) Output() ([]byte, error) { 22 return s.cmd.Output() 23 } 24 25 // Input sets the input to send to a remote credentials helper. 26 func (s *shell) Input(in io.Reader) { 27 s.cmd.Stdin = in 28 }