Documentation
¶
Index ¶
- type AgentClientWrapper
- func (h *AgentClientWrapper) AppendFile(ctx context.Context, name string, data io.Reader, perm types.FileMode) error
- func (h *AgentClientWrapper) Chmod(ctx context.Context, name string, mode types.FileMode) error
- func (h *AgentClientWrapper) Close(ctx context.Context) error
- func (h *AgentClientWrapper) Getegid(ctx context.Context) (uint64, error)
- func (h *AgentClientWrapper) Geteuid(ctx context.Context) (uint64, error)
- func (h *AgentClientWrapper) Lchown(ctx context.Context, name string, uid, gid uint32) error
- func (h *AgentClientWrapper) Lookup(ctx context.Context, username string) (*userPkg.User, error)
- func (h *AgentClientWrapper) LookupGroup(ctx context.Context, name string) (*userPkg.Group, error)
- func (h *AgentClientWrapper) Lstat(ctx context.Context, name string) (*types.Stat_t, error)
- func (h *AgentClientWrapper) Mkdir(ctx context.Context, name string, mode types.FileMode) error
- func (h *AgentClientWrapper) Mknod(ctx context.Context, pathName string, mode types.FileMode, ...) error
- func (h *AgentClientWrapper) ReadDir(ctx context.Context, name string) (<-chan types.DirEntResult, func())
- func (h *AgentClientWrapper) ReadFile(ctx context.Context, name string) (io.ReadCloser, error)
- func (h *AgentClientWrapper) Readlink(ctx context.Context, name string) (string, error)
- func (h *AgentClientWrapper) Remove(ctx context.Context, name string) error
- func (h *AgentClientWrapper) Run(ctx context.Context, cmd types.Cmd) (types.WaitStatus, error)
- func (h *AgentClientWrapper) String() string
- func (h *AgentClientWrapper) Symlink(ctx context.Context, oldname, newname string) error
- func (h *AgentClientWrapper) Type() string
- func (h *AgentClientWrapper) WriteFile(ctx context.Context, name string, data io.Reader, perm types.FileMode) error
- type Docker
- type Local
- func (h Local) AppendFile(ctx context.Context, name string, data io.Reader, mode types.FileMode) error
- func (h Local) Chmod(ctx context.Context, name string, mode types.FileMode) error
- func (h Local) Close(ctx context.Context) error
- func (h Local) Getegid(ctx context.Context) (uint64, error)
- func (h Local) Geteuid(ctx context.Context) (uint64, error)
- func (h Local) Lchown(ctx context.Context, name string, uid, gid uint32) error
- func (h Local) Lookup(ctx context.Context, username string) (*user.User, error)
- func (h Local) LookupGroup(ctx context.Context, name string) (*user.Group, error)
- func (h Local) Lstat(ctx context.Context, name string) (*types.Stat_t, error)
- func (h Local) Mkdir(ctx context.Context, name string, mode types.FileMode) error
- func (h Local) Mknod(ctx context.Context, pathName string, mode types.FileMode, ...) error
- func (h Local) ReadDir(ctx context.Context, name string) (<-chan types.DirEntResult, func())
- func (h Local) ReadFile(ctx context.Context, name string) (io.ReadCloser, error)
- func (h Local) Readlink(ctx context.Context, name string) (string, error)
- func (h Local) Remove(ctx context.Context, name string) error
- func (h Local) Run(ctx context.Context, cmd types.Cmd) (types.WaitStatus, error)
- func (h Local) String() string
- func (h Local) Symlink(ctx context.Context, oldname, newname string) error
- func (h Local) Type() string
- func (h Local) WriteFile(ctx context.Context, name string, data io.Reader, mode types.FileMode) error
- type LoggingWrapper
- func (h *LoggingWrapper) AppendFile(ctx context.Context, name string, data io.Reader, mode types.FileMode) error
- func (h *LoggingWrapper) Chmod(ctx context.Context, name string, mode types.FileMode) error
- func (h *LoggingWrapper) Close(ctx context.Context) error
- func (h *LoggingWrapper) Getegid(ctx context.Context) (uint64, error)
- func (h *LoggingWrapper) Geteuid(ctx context.Context) (uint64, error)
- func (h *LoggingWrapper) Lchown(ctx context.Context, name string, uid, gid uint32) error
- func (h *LoggingWrapper) Lookup(ctx context.Context, username string) (*user.User, error)
- func (h *LoggingWrapper) LookupGroup(ctx context.Context, name string) (*user.Group, error)
- func (h *LoggingWrapper) Lstat(ctx context.Context, name string) (*types.Stat_t, error)
- func (h *LoggingWrapper) Mkdir(ctx context.Context, name string, mode types.FileMode) error
- func (h *LoggingWrapper) Mknod(ctx context.Context, path string, mode types.FileMode, dev types.FileDevice) error
- func (h *LoggingWrapper) ReadDir(ctx context.Context, name string) (dirEntResultCh <-chan types.DirEntResult, cancel func())
- func (h *LoggingWrapper) ReadFile(ctx context.Context, name string) (io.ReadCloser, error)
- func (h *LoggingWrapper) Readlink(ctx context.Context, name string) (string, error)
- func (h *LoggingWrapper) Remove(ctx context.Context, name string) error
- func (h *LoggingWrapper) Run(ctx context.Context, cmd types.Cmd) (types.WaitStatus, error)
- func (h *LoggingWrapper) String() string
- func (h *LoggingWrapper) Symlink(ctx context.Context, oldname, newname string) error
- func (h *LoggingWrapper) Type() string
- func (h *LoggingWrapper) WriteFile(ctx context.Context, name string, data io.Reader, mode types.FileMode) error
- type Ssh
- type SshClientConfig
- type SshOptions
- type SudoWrapper
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AgentClientWrapper ¶
type AgentClientWrapper struct {
BaseHost types.BaseHost
// contains filtered or unexported fields
}
AgentClientWrapper wraps a BaseHost and provides a full Host implementation with the use of an ephemeral agent.
func NewAgentClientWrapper ¶
func (*AgentClientWrapper) AppendFile ¶
func (*AgentClientWrapper) Getegid ¶
func (h *AgentClientWrapper) Getegid(ctx context.Context) (uint64, error)
func (*AgentClientWrapper) Geteuid ¶
func (h *AgentClientWrapper) Geteuid(ctx context.Context) (uint64, error)
func (*AgentClientWrapper) LookupGroup ¶
func (*AgentClientWrapper) Mknod ¶
func (h *AgentClientWrapper) Mknod(ctx context.Context, pathName string, mode types.FileMode, dev types.FileDevice) error
func (*AgentClientWrapper) ReadDir ¶
func (h *AgentClientWrapper) ReadDir(ctx context.Context, name string) (<-chan types.DirEntResult, func())
func (*AgentClientWrapper) ReadFile ¶
func (h *AgentClientWrapper) ReadFile(ctx context.Context, name string) (io.ReadCloser, error)
func (*AgentClientWrapper) Remove ¶
func (h *AgentClientWrapper) Remove(ctx context.Context, name string) error
func (*AgentClientWrapper) Run ¶
func (h *AgentClientWrapper) Run(ctx context.Context, cmd types.Cmd) (types.WaitStatus, error)
func (*AgentClientWrapper) String ¶
func (h *AgentClientWrapper) String() string
func (*AgentClientWrapper) Symlink ¶
func (h *AgentClientWrapper) Symlink(ctx context.Context, oldname, newname string) error
func (*AgentClientWrapper) Type ¶
func (h *AgentClientWrapper) Type() string
type Docker ¶
type Docker struct {
// User/group and image in the format "[<name|uid>[:<group|gid>]@]<image>" (eg: root@ubuntu)
ConnectionString string
}
Docker uses docker exec to target a running container.
type Local ¶
type Local struct{}
Local interacts with the local machine running the code.
func (Local) AppendFile ¶
func (Local) LookupGroup ¶
type LoggingWrapper ¶
type LoggingWrapper struct {
// contains filtered or unexported fields
}
LoggingWrapper wraps Host logging received commands.
func NewLoggingWrapper ¶
func NewLoggingWrapper(host types.Host) *LoggingWrapper
func (*LoggingWrapper) AppendFile ¶
func (*LoggingWrapper) Getegid ¶
func (h *LoggingWrapper) Getegid(ctx context.Context) (uint64, error)
func (*LoggingWrapper) Geteuid ¶
func (h *LoggingWrapper) Geteuid(ctx context.Context) (uint64, error)
func (*LoggingWrapper) LookupGroup ¶
func (*LoggingWrapper) Mknod ¶
func (h *LoggingWrapper) Mknod(ctx context.Context, path string, mode types.FileMode, dev types.FileDevice) error
func (*LoggingWrapper) ReadDir ¶
func (h *LoggingWrapper) ReadDir(ctx context.Context, name string) (dirEntResultCh <-chan types.DirEntResult, cancel func())
func (*LoggingWrapper) ReadFile ¶
func (h *LoggingWrapper) ReadFile(ctx context.Context, name string) (io.ReadCloser, error)
func (*LoggingWrapper) Remove ¶
func (h *LoggingWrapper) Remove(ctx context.Context, name string) error
func (*LoggingWrapper) Run ¶
func (h *LoggingWrapper) Run(ctx context.Context, cmd types.Cmd) (types.WaitStatus, error)
func (*LoggingWrapper) String ¶
func (h *LoggingWrapper) String() string
func (*LoggingWrapper) Symlink ¶
func (h *LoggingWrapper) Symlink(ctx context.Context, oldname, newname string) error
func (*LoggingWrapper) Type ¶
func (h *LoggingWrapper) Type() string
type Ssh ¶
type Ssh struct {
Hostname string
// contains filtered or unexported fields
}
Ssh interacts with a remote machine connecting to it via SSH protocol.
func NewSshAuthority ¶
func NewSshAuthority(ctx context.Context, authority string, sshClientConfig SshClientConfig) (Ssh, error)
NewSshAuthority creates a new Ssh from given authority in the format [<user>[;fingerprint=<host-key fingerprint>]@]<host>[:<port>] based on https://www.iana.org/assignments/uri-schemes/prov/ssh
type SshClientConfig ¶
type SshClientConfig struct {
// RekeyThreshold as in ssh.Config
RekeyThreshold uint64
// KeyExchanges as in ssh.Config
KeyExchanges []string
// Ciphers as in ssh.Config
Ciphers []string
// MACs as in ssh.Config
MACs []string
// HostKeyAlgorithms as in ssh.ClientConfig
HostKeyAlgorithms []string
// Timeout aas in ssh.ClientConfig
Timeout time.Duration
}
type SshOptions ¶
type SshOptions struct {
SshClientConfig
User string
// Fingerprint is an optional unpadded base64 encoded sha256 hash as introduced by
// https://www.openssh.com/txt/release-6.8.
// Eg: SHA256:uwhOoCVTS7b3wlX1popZs5k609OaD1vQurHU34cCWPk
Fingerprint string
Host string
Port int
}
type SudoWrapper ¶
type SudoWrapper struct {
BaseHost types.BaseHost
Password *string
// contains filtered or unexported fields
}
SudoWrapper wraps another BaseHost and runs all commands with sudo.
func NewSudoWrapper ¶
func (*SudoWrapper) Run ¶
func (h *SudoWrapper) Run(ctx context.Context, cmd types.Cmd) (types.WaitStatus, error)
func (SudoWrapper) String ¶
func (h SudoWrapper) String() string
func (SudoWrapper) Type ¶
func (h SudoWrapper) Type() string
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
This lib package contains common functions used at various places.
|
This lib package contains common functions used at various places. |
Click to show internal directories.
Click to hide internal directories.