dir

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2019 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	//Dep - deployment descriptor
	Dep = "dep"
	//Dev - development descriptor
	Dev = "dev"
)

Variables

This section is empty.

Functions

func Archive

func Archive(sourcePath, targetArchivePath string) (e error)

Archive module and mtar artifacts, compatible with the JAR specification to support the spec requirements Source Path to be zipped Target artifact

func CloseFile

func CloseFile(file io.Closer, err error) error

CloseFile - closes file error handling takes into account error of the calling function

func CopyByPatterns

func CopyByPatterns(source, target string, patterns []string) error

CopyByPatterns - copy files/directories according to patterns from source folder to target folder patterns are relative to source folder

func CopyDir

func CopyDir(src string, dst string, withParents bool) error

CopyDir - copy directory content

func CopyEntries

func CopyEntries(entries []os.FileInfo, src, dst string) (rerr error)

CopyEntries - copies entries (files and directories) from source to destination folder

func CopyFile

func CopyFile(src, dst string) (rerr error)

CopyFile - copy file content

func CopyFileWithMode

func CopyFileWithMode(src, dst string, mode os.FileMode) (rerr error)

CopyFileWithMode - copy file content using file mode parameter

func CreateDirIfNotExist

func CreateDirIfNotExist(dir string) error

CreateDirIfNotExist - Create new dir

func CreateFile

func CreateFile(path string) (file *os.File, err error)

CreateFile - create new file

func Read

func Read(ep IMtaYaml) ([]byte, error)

Read returns mta byte slice.

func ReadExt

func ReadExt(ep IMtaExtYaml, platform string) ([]byte, error)

ReadExt returns mta extension byte slice.

func ValidateDeploymentDescriptor

func ValidateDeploymentDescriptor(descriptor string) error

ValidateDeploymentDescriptor validates the deployment descriptor.

Types

type IDescriptor

type IDescriptor interface {
	IsDeploymentDescriptor() bool
	GetDescriptor() string
}

IDescriptor - descriptor interface

type IModule

type IModule interface {
	ISourceModule
	ITargetModule
}

IModule - module interface

type IMtaExtYaml

type IMtaExtYaml interface {
	GetMtaExtYamlPath(platform string) string
}

IMtaExtYaml - MTA Extension Yaml interface

type IMtaParser

type IMtaParser interface {
	ParseFile() (*mta.MTA, error)
	ParseExtFile(platform string) (*mta.EXT, error)
}

IMtaParser - MTA Parser interface

type IMtaYaml

type IMtaYaml interface {
	GetMtaYamlFilename() string
	GetMtaYamlPath() string
}

IMtaYaml - MTA Yaml interface

type ISourceModule

type ISourceModule interface {
	GetSourceModuleDir(modulePath string) string
}

ISourceModule - source module interface

type ITargetArtifacts

type ITargetArtifacts interface {
	GetMetaPath() string
	GetMtadPath() string
	GetManifestPath() string
}

ITargetArtifacts - target artifacts interface

type ITargetModule

type ITargetModule interface {
	GetTargetModuleDir(moduleName string) string
	GetTargetModuleZipPath(moduleName string) string
}

ITargetModule - Target Module interface

type ITargetPath

type ITargetPath interface {
	GetTarget() string
	GetTargetTmpDir() string
}

ITargetPath - target path interface

type Loc

type Loc struct {
	// SourcePath - Path to MTA project
	SourcePath string
	// TargetPath - Path to results
	TargetPath string
	// MtaFilename - MTA yaml filename "mta.yaml" by default
	MtaFilename string
	// Descriptor - indicator of deployment descriptor usage (mtad.yaml)
	Descriptor string
}

Loc - MTA tool file properties

func Location

func Location(source, target, descriptor string, wdGetter func() (string, error)) (*Loc, error)

Location - provides Location parameters of MTA

func (*Loc) GetDescriptor

func (ep *Loc) GetDescriptor() string

GetDescriptor - gets descriptor type of Location

func (*Loc) GetManifestPath

func (ep *Loc) GetManifestPath() string

GetManifestPath gets the path to the generated manifest file.

func (*Loc) GetMetaPath

func (ep *Loc) GetMetaPath() string

GetMetaPath gets the path to the generated META-INF directory.

func (*Loc) GetMtaExtYamlPath

func (ep *Loc) GetMtaExtYamlPath(platform string) string

GetMtaExtYamlPath gets the MTA extension .yaml file path.

func (*Loc) GetMtaYamlFilename

func (ep *Loc) GetMtaYamlFilename() string

GetMtaYamlFilename - Gets the MTA .yaml file name.

func (*Loc) GetMtaYamlPath

func (ep *Loc) GetMtaYamlPath() string

GetMtaYamlPath gets the MTA .yaml file path.

func (*Loc) GetMtadPath

func (ep *Loc) GetMtadPath() string

GetMtadPath gets the path to the generated MTAD file.

func (*Loc) GetSource

func (ep *Loc) GetSource() string

GetSource gets the processed project path; if it is not provided, use the current directory.

func (*Loc) GetSourceModuleDir

func (ep *Loc) GetSourceModuleDir(modulePath string) string

GetSourceModuleDir gets the path to the module to be packed. The subdirectory is in the source.

func (*Loc) GetTarget

func (ep *Loc) GetTarget() string

GetTarget gets the target path; if it is not provided, use the path of the processed project.

func (*Loc) GetTargetModuleDir

func (ep *Loc) GetTargetModuleDir(moduleName string) string

GetTargetModuleDir gets the path to the packed module directory. The subdirectory in the temporary target directory is named by the module name.

func (*Loc) GetTargetModuleZipPath

func (ep *Loc) GetTargetModuleZipPath(moduleName string) string

GetTargetModuleZipPath gets the path to the packed module data.zip file. The subdirectory in temporary target directory is named by the module name.

func (*Loc) GetTargetTmpDir

func (ep *Loc) GetTargetTmpDir() string

GetTargetTmpDir gets the temporary target directory path. The subdirectory in the target folder is named as the source project folder.

func (*Loc) IsDeploymentDescriptor

func (ep *Loc) IsDeploymentDescriptor() bool

IsDeploymentDescriptor checks whether the flag is related to the deployment descriptor.

func (*Loc) ParseExtFile

func (ep *Loc) ParseExtFile(platform string) (*mta.EXT, error)

ParseExtFile returns a reference to the MTA object from a given mta.yaml file.

func (*Loc) ParseFile

func (ep *Loc) ParseFile() (*mta.MTA, error)

ParseFile returns a reference to the MTA object from a given mta.yaml file.

Jump to

Keyboard shortcuts

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