mirror of
https://github.com/openfaas/faasd.git
synced 2025-06-19 20:46:40 +00:00
service: support /var/lib/faasd/.docker/config.json
Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
This commit is contained in:
Gopkg.lockGopkg.tomlREADME.md
pkg/service
vendor/github.com
Microsoft
hcsshim
osversion
containerd
continuity
pathdriver
docker
cli
docker-credential-helpers
docker
AUTHORSLICENSENOTICE
contrib
syntax
vim
docs
static_files
hack
integration-cli
pkg
homedir
idtools
idtools.goidtools_unix.goidtools_windows.gousergroupadd_linux.gousergroupadd_unsupported.goutils_unix.go
mount
flags.goflags_freebsd.goflags_linux.goflags_unsupported.gomount.gomounter_freebsd.gomounter_linux.gomounter_unsupported.gomountinfo.gomountinfo_freebsd.gomountinfo_linux.gomountinfo_unsupported.gomountinfo_windows.gosharedsubtree_linux.gounmount_unix.gounmount_unsupported.go
symlink
system
args_windows.gochtimes.gochtimes_unix.gochtimes_windows.goerrors.goexitcode.gofilesys.gofilesys_windows.goinit.goinit_unix.goinit_windows.golcow.golcow_unix.golcow_windows.golstat_unix.golstat_windows.gomeminfo.gomeminfo_linux.gomeminfo_unsupported.gomeminfo_windows.gomknod.gomknod_windows.gopath.gopath_unix.gopath_windows.goprocess_unix.goprocess_windows.gorm.gostat_darwin.gostat_freebsd.gostat_linux.gostat_openbsd.gostat_solaris.gostat_unix.gostat_windows.gosyscall_unix.gosyscall_windows.goumask.goumask_windows.goutimes_freebsd.goutimes_linux.goutimes_unsupported.goxattrs_linux.goxattrs_unsupported.go
go-units
56
vendor/github.com/docker/docker-credential-helpers/client/command.go
generated
vendored
Normal file
56
vendor/github.com/docker/docker-credential-helpers/client/command.go
generated
vendored
Normal file
@ -0,0 +1,56 @@
|
||||
package client
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"io"
|
||||
"os"
|
||||
"os/exec"
|
||||
)
|
||||
|
||||
// Program is an interface to execute external programs.
|
||||
type Program interface {
|
||||
Output() ([]byte, error)
|
||||
Input(in io.Reader)
|
||||
}
|
||||
|
||||
// ProgramFunc is a type of function that initializes programs based on arguments.
|
||||
type ProgramFunc func(args ...string) Program
|
||||
|
||||
// NewShellProgramFunc creates programs that are executed in a Shell.
|
||||
func NewShellProgramFunc(name string) ProgramFunc {
|
||||
return NewShellProgramFuncWithEnv(name, nil)
|
||||
}
|
||||
|
||||
// NewShellProgramFuncWithEnv creates programs that are executed in a Shell with environment variables
|
||||
func NewShellProgramFuncWithEnv(name string, env *map[string]string) ProgramFunc {
|
||||
return func(args ...string) Program {
|
||||
return &Shell{cmd: createProgramCmdRedirectErr(name, args, env)}
|
||||
}
|
||||
}
|
||||
|
||||
func createProgramCmdRedirectErr(commandName string, args []string, env *map[string]string) *exec.Cmd {
|
||||
programCmd := exec.Command(commandName, args...)
|
||||
programCmd.Env = os.Environ()
|
||||
if env != nil {
|
||||
for k, v := range *env {
|
||||
programCmd.Env = append(programCmd.Env, fmt.Sprintf("%s=%s", k, v))
|
||||
}
|
||||
}
|
||||
programCmd.Stderr = os.Stderr
|
||||
return programCmd
|
||||
}
|
||||
|
||||
// Shell invokes shell commands to talk with a remote credentials helper.
|
||||
type Shell struct {
|
||||
cmd *exec.Cmd
|
||||
}
|
||||
|
||||
// Output returns responses from the remote credentials helper.
|
||||
func (s *Shell) Output() ([]byte, error) {
|
||||
return s.cmd.Output()
|
||||
}
|
||||
|
||||
// Input sets the input to send to a remote credentials helper.
|
||||
func (s *Shell) Input(in io.Reader) {
|
||||
s.cmd.Stdin = in
|
||||
}
|
Reference in New Issue
Block a user