Documentation ¶
Index ¶
- Constants
- func CreateTempPackage(sources []string, packageType PackageType) (string, error)
- func IsTarball(filePath string) bool
- func IsZip(filePath string) bool
- func ParseManifest(reader io.Reader, manifest interface{}) error
- func ValidateHookTimeout(timeout string) error
- type ContentList
- type Package
- type PackageType
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 ParseManifest ¶
ParseManifest parses the manifest structure from io reader
func ValidateHookTimeout ¶
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
Click to show internal directories.
Click to hide internal directories.