containerx

package
v0.0.9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 26, 2024 License: Apache-2.0 Imports: 2 Imported by: 14

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetImageURL

func GetImageURL(opts *NewBaseContainerOpts) (string, error)

GetImageURL constructs the full image URL from the provided options. It returns an error if the options are nil or the image name is empty.

Parameters:

  • opts: A pointer to NewBaseContainerOpts containing the image name and version.

Returns:

  • A string containing the full image URL in the format "image:version".
  • An error if the options are nil or the image name is empty.

Example:

opts := &NewBaseContainerOpts{
    Image:   "golang",
    Version: "1.16",
}
imageURL, err := GetImageURL(opts)
if err != nil {
    // handle error
}
fmt.Println(imageURL) // Output: "golang:1.16"

Types

type NewBaseContainerOpts

type NewBaseContainerOpts struct {
	// Image is the name of the image to use.
	Image string
	// Version is the version of the image to use.
	Version string
	// FallbackImage is the name of the fallback image to use if the primary image is empty.
	FallbackImage string
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL