packer

package
v0.0.0-...-ebca4f8 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2020 License: MIT Imports: 18 Imported by: 1

Documentation

Overview

Package packer handles the process of packaging asset with the support of supporting library.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PackkerInput

type PackkerInput struct {
	// The name of the asset client stub.
	Name string `json:"name" yaml:"name"`
	// TempPath would be used to carryout all the operation of Unpackker defaults to PWD.
	TempPath string `json:"tempath" yaml:"tempath"`
	// Path to asset which has to be packed.
	AssetPath string `json:"assetpath" yaml:"assetpath" env:"UNPACKKER_ASSET_PATH"`
	// AssetMetaData is set of metadata that has to be applied to the asset.
	// This value can be used while unpacking or for any future requirements.
	AssetMetaData map[string]string `json:"assetmetadata" yaml:"assetmetadata"`
	// Path defines where the packed asset has to be placed.
	Path string `json:"path" yaml:"path"`
	// IgnoreFiles are regexes of the files that should be avided.
	IgnoreFiles []string `json:"ignore" yaml:"ignore"`
	// Environment in which the asset is packed.
	Environment string `json:"environment" yaml:"environment" env:"UNPACKKER_ENVIRONMENT"`
	// AssetVersion refers to version of asset which has to eb packed.
	AssetVersion string `json:"assetversion" yaml:"assetversion" env:"UNPACKKER_ASSET_VERSION"`
	// Backend for the asset generated.
	Backend *backend.Store `json:"backend" yaml:"backend"`
	// ConfigPath refers to file path where the config file lies, defaults to PWD.
	ConfigPath string `json:"configpath" yaml:"configpath" env:"UNPACKKER_CONFIG_PATH"`
	// CleanLocalCache clears the local cache creted under PackkerInput.Path if enabled,
	// this will be effective only if backend is type 'fs'.
	CleanLocalCache bool `json:"cleancache" yaml:"cleancache" env:"UNPACKKER_CLEAN_LOCALCACHE"`

	gen.GenInput
	// contains filtered or unexported fields
}

PackkerInput holds the required fields to pack the asset.

func NewConfig

func NewConfig() *PackkerInput

NewConfig retunrns new config of PackkerInput.

func (*PackkerInput) LoadConfig

func (i *PackkerInput) LoadConfig() (*PackkerInput, error)

LoadConfig will load config from file `unpackker-config` onto PackkerInput.

func (*PackkerInput) Packer

func (i *PackkerInput) Packer(cmd *cobra.Command, args []string)

Packer packs the asset which would be understood by unpacker

Jump to

Keyboard shortcuts

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