Documentation ¶
Index ¶
- Variables
- func CreateCommands(source entities.ImageScpOptions, dest entities.ImageScpOptions, ...) ([]string, []string)
- func CreateSCPCommand(cmd *exec.Cmd, command []string) *exec.Cmd
- func ExecPodman(dest entities.ImageScpOptions, podman string, command []string) (string, error)
- func ExecuteTransfer(src, dst string, parentFlags []string, quiet bool, sshMode ssh.EngineMode) (*entities.ImageLoadReport, *entities.ImageScpOptions, ...)
- func ExtractImage(out []byte) string
- func GetServiceInformation(sshInfo *entities.ImageScpConnections, cliConnections []string, ...) error
- func GetUserInfo(uri *url.URL) (*url.Userinfo, error)
- func IfPassesSecretsFilter(s secrets.Secret, filters map[string][]string) (bool, error)
- func LoadToRemote(dest entities.ImageScpOptions, localFile string, tag string, url *url.URL, ...) (string, string, error)
- func LoginUser(user string) (*exec.Cmd, error)
- func ParseImageSCPArg(arg string) (*entities.ImageScpOptions, []string, error)
- func RemoteArgLength(input string, side int) int
- func SaveToRemote(image, localFile string, tag string, uri *url.URL, iden string, ...) error
- func ScpTag(cmd *exec.Cmd, podman string, dest entities.ImageScpOptions) error
- func ToLibpodFilters(f url.Values) (filters []string)
- func ToURLValues(f []string) (filters url.Values)
- func ValidateImageName(input string) string
- func ValidateImagePortion(location entities.ImageScpOptions, arg string) (entities.ImageScpOptions, error)
- func ValidateSCPArgs(locations []*entities.ImageScpOptions) error
Constants ¶
This section is empty.
Variables ¶
var DeepCopy = func(dst interface{}, src interface{}) error { payload, err := json.Marshal(src) if err != nil { return err } err = json.Unmarshal(payload, dst) if err != nil { return err } return nil }
DeepCopy does a deep copy of a structure Error checking of parameters delegated to json engine
Functions ¶
func CreateCommands ¶
func CreateCommands(source entities.ImageScpOptions, dest entities.ImageScpOptions, parentFlags []string, podman string) ([]string, []string)
createCommands forms the podman save and load commands used by SCP
func CreateSCPCommand ¶
CreateSCPCommand takes an existing command, appends the given arguments and returns a configured podman command for image scp
func ExecPodman ¶
execPodman executes the podman save/load command given the podman binary
func ExecuteTransfer ¶
func ExecuteTransfer(src, dst string, parentFlags []string, quiet bool, sshMode ssh.EngineMode) (*entities.ImageLoadReport, *entities.ImageScpOptions, *entities.ImageScpOptions, []string, error)
func ExtractImage ¶
ExtractImage pulls out the last line of output from save/load (image id)
func GetServiceInformation ¶
func GetServiceInformation(sshInfo *entities.ImageScpConnections, cliConnections []string, cfg *config.Config) error
GetServiceInformation takes the parsed list of hosts to connect to and validates the information
func IfPassesSecretsFilter ¶
func LoadToRemote ¶
func LoadToRemote(dest entities.ImageScpOptions, localFile string, tag string, url *url.URL, iden string, sshEngine ssh.EngineMode) (string, string, error)
loadToRemote takes image and remote connection information. it connects to the specified client and copies the saved image dir over to the remote host and then loads it onto the machine returns a string containing output or an error
func LoginUser ¶
LoginUser starts the user process on the host so that image scp can use systemd-run
func ParseImageSCPArg ¶
func ParseImageSCPArg(arg string) (*entities.ImageScpOptions, []string, error)
parseImageSCPArg returns the valid connection, and source/destination data based off of the information provided by the user arg is a string containing one of the cli arguments returned is a filled out source/destination options structs as well as a connections array and an error if applicable
func RemoteArgLength ¶
remoteArgLength is a helper function to simplify the extracting of host argument data returns an int which contains the length of a specified index in a host::image string
func SaveToRemote ¶
func SaveToRemote(image, localFile string, tag string, uri *url.URL, iden string, sshEngine ssh.EngineMode) error
saveToRemote takes image information and remote connection information. it connects to the specified client and saves the specified image on the remote machine and then copies it to the specified local location returns an error if one occurs.
func ScpTag ¶
ScpTag is a helper function for native podman to tag an image after a local load from image SCP
func ToLibpodFilters ¶
func ToURLValues ¶
func ValidateImageName ¶
validateImageName makes sure that the image given is valid and no injections are occurring we simply use this for error checking, bot setting the image
func ValidateImagePortion ¶
func ValidateImagePortion(location entities.ImageScpOptions, arg string) (entities.ImageScpOptions, error)
func ValidateSCPArgs ¶
func ValidateSCPArgs(locations []*entities.ImageScpOptions) error
validateSCPArgs takes the array of source and destination options and checks for common errors
Types ¶
This section is empty.