Documentation ¶
Index ¶
- Constants
- func Create(options *ConnectionCreateOptions, kind EngineMode) error
- func Dial(options *ConnectionDialOptions, kind EngineMode) (*ssh.Client, error)
- func DialNet(sshClient *ssh.Client, mode string, url *url.URL) (net.Conn, error)
- func Exec(options *ConnectionExecOptions, kind EngineMode) (string, error)
- func ExecRemoteCommand(dial *ssh.Client, run string) ([]byte, error)
- func GetUserInfo(uri *url.URL) (*url.Userinfo, error)
- func ParseScpArgs(options ConnectionScpOptions) (string, string, string, bool, error)
- func PublicKey(path string, passphrase []byte) (ssh.Signer, error)
- func ReadLogin() []byte
- func ReadPassphrase() []byte
- func ReadPassword(prompt string) (pw []byte, err error)
- func Scp(options *ConnectionScpOptions, kind EngineMode) (string, error)
- func Validate(user *url.Userinfo, path string, port int, identity string) (*config.Destination, *url.URL, error)
- func ValidateAndConfigure(uri *url.URL, iden string, insecureIsMachineConnection bool) (*ssh.ClientConfig, error)
- type CPUUsage
- type ConmonInfo
- type ConnectionCreateOptions
- type ConnectionDialOptions
- type ConnectionDialReport
- type ConnectionExecOptions
- type ConnectionExecReport
- type ConnectionScpOptions
- type ConnectionScpReport
- type ContainerStore
- type DistributionInfo
- type EngineMode
- type HostInfo
- type IDMappings
- type ImageStore
- type Info
- type OCIRuntimeInfo
- type Plugins
- type RemoteSocket
- type SecurityInfo
- type SlirpInfo
- type StoreInfo
- type Version
Constants ¶
const ( NativeMode = EngineMode("native") GolangMode = EngineMode("golang") InvalidMode = EngineMode("invalid") )
Variables ¶
This section is empty.
Functions ¶
func Create ¶
func Create(options *ConnectionCreateOptions, kind EngineMode) error
func Dial ¶
func Dial(options *ConnectionDialOptions, kind EngineMode) (*ssh.Client, error)
func Exec ¶
func Exec(options *ConnectionExecOptions, kind EngineMode) (string, error)
func ExecRemoteCommand ¶
ExecRemoteCommand takes a ssh client connection and a command to run and executes the command on the specified client. The function returns the Stdout from the client or the Stderr
func ParseScpArgs ¶
func ReadPassphrase ¶
func ReadPassphrase() []byte
func ReadPassword ¶
ReadPassword prompts for a secret and returns value input by user from stdin Unlike terminal.ReadPassword(), $(echo $SECRET | podman...) is supported. Additionally, all input after `<secret>/n` is queued to podman command.
func Scp ¶
func Scp(options *ConnectionScpOptions, kind EngineMode) (string, error)
func ValidateAndConfigure ¶
func ValidateAndConfigure(uri *url.URL, iden string, insecureIsMachineConnection bool) (*ssh.ClientConfig, error)
ValidateAndConfigure will take a ssh url and an identity key (rsa and the like) and ensure the information given is valid iden iden can be blank to mean no identity key once the function validates the information it creates and returns an ssh.ClientConfig.
Types ¶
type ConmonInfo ¶
type ConmonInfo struct { Package string `json:"package"` Path string `json:"path"` Version string `json:"version"` }
ConmonInfo describes the conmon executable being used
type ConnectionCreateOptions ¶
type ConnectionDialOptions ¶
type ConnectionDialReport ¶
type ConnectionExecOptions ¶
type ConnectionExecReport ¶
type ConnectionExecReport struct {
Response string
}
type ConnectionScpOptions ¶
type ConnectionScpReport ¶
type ConnectionScpReport struct {
Response string
}
type ContainerStore ¶
type ContainerStore struct { Number int `json:"number"` Paused int `json:"paused"` Running int `json:"running"` Stopped int `json:"stopped"` }
ContainerStore describes the quantity of containers in the store by status
type DistributionInfo ¶
type DistributionInfo struct { Distribution string `json:"distribution"` Variant string `json:"variant,omitempty"` Version string `json:"version"` Codename string `json:"codename,omitempty"` }
DistributionInfo describes the host distribution for libpod
type HostInfo ¶
type HostInfo struct { Arch string `json:"arch"` BuildahVersion string `json:"buildahVersion"` CgroupManager string `json:"cgroupManager"` CgroupsVersion string `json:"cgroupVersion"` CgroupControllers []string `json:"cgroupControllers"` Conmon *ConmonInfo `json:"conmon"` CPUs int `json:"cpus"` CPUUtilization *CPUUsage `json:"cpuUtilization"` Distribution DistributionInfo `json:"distribution"` EventLogger string `json:"eventLogger"` Hostname string `json:"hostname"` IDMappings IDMappings `json:"idMappings,omitempty"` Kernel string `json:"kernel"` LogDriver string `json:"logDriver"` MemFree int64 `json:"memFree"` MemTotal int64 `json:"memTotal"` NetworkBackend string `json:"networkBackend"` OCIRuntime *OCIRuntimeInfo `json:"ociRuntime"` OS string `json:"os"` // RemoteSocket returns the UNIX domain socket the Podman service is listening on RemoteSocket *RemoteSocket `json:"remoteSocket,omitempty"` RuntimeInfo map[string]interface{} `json:"runtimeInfo,omitempty"` // ServiceIsRemote is true when the podman/libpod service is remote to the client ServiceIsRemote bool `json:"serviceIsRemote"` Security SecurityInfo `json:"security"` Slirp4NetNS SlirpInfo `json:"slirp4netns,omitempty"` SwapFree int64 `json:"swapFree"` SwapTotal int64 `json:"swapTotal"` Uptime string `json:"uptime"` Linkmode string `json:"linkmode"` }
HostInfo describes the libpod host
type IDMappings ¶
type IDMappings struct { GIDMap []idtools.IDMap `json:"gidmap"` UIDMap []idtools.IDMap `json:"uidmap"` }
IDMappings describe the GID and UID mappings
type ImageStore ¶
type ImageStore struct {
Number int `json:"number"`
}
ImageStore describes the image store. Right now only the number of images present
type Info ¶
type Info struct { Host *HostInfo `json:"host"` Store *StoreInfo `json:"store"` Registries map[string]interface{} `json:"registries"` Plugins Plugins `json:"plugins"` Version Version `json:"version"` }
Info is the overall struct that describes the host system running libpod/podman
type OCIRuntimeInfo ¶
type OCIRuntimeInfo struct { Name string `json:"name"` Package string `json:"package"` Path string `json:"path"` Version string `json:"version"` }
OCIRuntimeInfo describes the runtime (crun or runc) being used with podman
type RemoteSocket ¶
type RemoteSocket struct { Path string `json:"path,omitempty"` Exists bool `json:"exists,omitempty"` }
RemoteSocket describes information about the API socket
type SecurityInfo ¶
type SecurityInfo struct { AppArmorEnabled bool `json:"apparmorEnabled"` DefaultCapabilities string `json:"capabilities"` Rootless bool `json:"rootless"` SECCOMPEnabled bool `json:"seccompEnabled"` SECCOMPProfilePath string `json:"seccompProfilePath"` SELinuxEnabled bool `json:"selinuxEnabled"` }
SecurityInfo describes the libpod host
type SlirpInfo ¶
type SlirpInfo struct { Executable string `json:"executable"` Package string `json:"package"` Version string `json:"version"` }
SlirpInfo describes the slirp executable that is being used
type StoreInfo ¶
type StoreInfo struct { ConfigFile string `json:"configFile"` ContainerStore ContainerStore `json:"containerStore"` GraphDriverName string `json:"graphDriverName"` GraphOptions map[string]interface{} `json:"graphOptions"` GraphRoot string `json:"graphRoot"` // GraphRootAllocated is how much space the graphroot has in bytes GraphRootAllocated uint64 `json:"graphRootAllocated"` // GraphRootUsed is how much of graphroot is used in bytes GraphRootUsed uint64 `json:"graphRootUsed"` GraphStatus map[string]string `json:"graphStatus"` ImageCopyTmpDir string `json:"imageCopyTmpDir"` ImageStore ImageStore `json:"imageStore"` RunRoot string `json:"runRoot"` VolumePath string `json:"volumePath"` }
StoreInfo describes the container storage and its attributes