Documentation
¶
Index ¶
- Constants
- Variables
- func Cat(c *cli.Context) (err error)
- func CheckArtifactSize(outputPath string, ctx *cli.Context) error
- func Copy(c *cli.Context) (err error)
- func CopyFromImage(image VPImage, imageFile string, hostFile string) error
- func CopyIntoImage(hostFile string, image VPImage, imageFile string) error
- func CopyOwner(tFile *os.File, artFile string) error
- func DumpCommand(c *cli.Context) error
- func FormatSize(bytes int64) string
- func Install(c *cli.Context) (err error)
- func ParseSizeLimit(sizeStr string) (int64, error)
- func Remove(c *cli.Context) (err error)
- func Run(args []string) error
- type ModImageArtifact
- type ModImageBase
- type ModImageRaw
- type ModImageSdimg
- type SigningKey
- type VPDir
- type VPFile
- type VPImage
Constants ¶
const ( KB = 1000 MB = 1000 * 1000 GB = 1000 * 1000 * 1000 TB = 1000 * 1000 * 1000 * 1000 )
const CustomSubcommandHelpTemplate = `` /* 574-byte string literal not displayed */
SubcommandHelpTemplate is the text template for the subcommand help topic. cli.go uses text/template to render templates. This template is used for sub-commands with one or more required flags present.
const LatestFormatVersion = 3
LatestFormatVersion is the latest version of the format, which is also what we default to.
Variables ¶
var Log *logrus.Logger
Log is a global reference to our logger.
var Version = "unknown"
Version of the mender-artifact CLI tool
Functions ¶
func CheckArtifactSize ¶
CheckArtifactSize checks the Artifact file size against configured limits Returns error if max limit exceeded (and deletes file) Logs warning if warn limit exceeded (keeps file)
func CopyFromImage ¶
Shortcut to open a file in the image, read from it, and close it again.
func CopyIntoImage ¶
Shortcut to open a file in the image, write into it, and close it again.
func DumpCommand ¶
func FormatSize ¶
FormatSize formats bytes into human-readable format Examples: 5000000 -> "5.0 MB", 1500000000 -> "1.5 GB"
func Install ¶
Install installs a file from the host filesystem or directory onto either a mender artifact, or an sdimg.
func ParseSizeLimit ¶
ParseSizeLimit parses size strings like "5MB", "1.5GB", "100" Supports: B, KB, MB, GB, TB (decimal, base 1000) Case-insensitive, allows decimals (1.5MB), bare numbers (5000000)
Types ¶
type ModImageArtifact ¶
type ModImageArtifact struct {
ModImageBase
// contains filtered or unexported fields
}
func (*ModImageArtifact) Close ¶
func (i *ModImageArtifact) Close() error
Closes and repacks the artifact or sdimg.
type ModImageBase ¶
type ModImageBase struct {
// contains filtered or unexported fields
}
type ModImageRaw ¶
type ModImageRaw struct {
ModImageBase
}
func (*ModImageRaw) Close ¶
func (i *ModImageRaw) Close() error
type ModImageSdimg ¶
type ModImageSdimg struct {
ModImageBase
// contains filtered or unexported fields
}
func (*ModImageSdimg) Close ¶
func (i *ModImageSdimg) Close() error