packages

package
v0.0.0-...-07a382d Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2024 License: LGPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// MaxHookExecutionTimeout represents the maximum hook execution timeout
	MaxHookExecutionTimeout = time.Minute * 15
)

Variables

This section is empty.

Functions

func CreateTempPackage

func CreateTempPackage(sources []string, packageType PackageType) (string, error)

CreateTempPackage creates a temporary package file with the given contents

func IsTarball

func IsTarball(filePath string) bool

IsTarball detects if the given package is a valid tarball

func IsZip

func IsZip(filePath string) bool

IsZip detects if the given package is a valid zip archive

func ParseManifest

func ParseManifest(reader io.Reader, manifest interface{}) error

ParseManifest parses the manifest structure from io reader

func ValidateHookTimeout

func ValidateHookTimeout(timeout string) error

ValidateHookTimeout validates the given timeout for hooks

Types

type ContentList

type ContentList []string

ContentList represents a list of content

func (*ContentList) Add

func (c *ContentList) Add(content ...string)

Add adds new contents into the list

func (*ContentList) Has

func (c *ContentList) Has(content string) bool

Has checks if the given content is included in the content list

type Package

type Package interface {
	// Validate validates a package
	Validate() error

	// Manifest returns the manifest structure of a package
	Manifest() interface{}
}

Package represents a generic interface for a package which helps for the validation

type PackageType

type PackageType int

PackageType represents the file format for a pacakge

const (
	// PackageTypeUnknown represents an unknown addon or application package format
	PackageTypeUnknown PackageType = iota - 1
	// PackageTypeTarBZ2 represents an addon or application package as a tarball
	PackageTypeTarBZ2
	// PackageTypeZip represents an addon or application package as a zip archive
	PackageTypeZip
)

func DetectPackageType

func DetectPackageType(filePath string) (PackageType, error)

DetectPackageType is used to auto-determine the type of a package by looking at the magic bytes of a file

Jump to

Keyboard shortcuts

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