Documentation
¶
Index ¶
- Variables
- func AsyncMultiWriter(writers ...io.Writer) io.Writer
- func CalcChecksums(reader io.Reader, checksumType ...Algorithm) (map[Algorithm]string, error)
- func CleanOldDirs() error
- func CreateExtractorPropsFile(configPropertiesPath string, configProperties map[string]string) (string, error)
- func CreateTempBuildFile(buildName, buildNumber, projectKey, buildsDirPath string, logger Log) (*os.File, error)
- func CreateTempDir() (string, error)
- func DoubleWinPathSeparator(filePath string) string
- func DownloadDependencies(downloadTo, filename, relativefilePath string, ...) error
- func DownloadFile(downloadTo string, fromUrl string) (err error)
- func GetBuildDir(buildName, buildNumber, projectKey, buildsDirPath string) (string, error)
- func GetCachePath() (string, error)
- func GetDependenciesGraph(projectDir string, log Log) (map[string][]string, error)
- func GetDependenciesList(projectDir string, log Log) (map[string]bool, error)
- func GetFileChecksums(filePath string) (checksums *entities.Checksum, err error)
- func GetFileContentAndInfo(filePath string) (fileContent []byte, fileInfo os.FileInfo, err error)
- func GetGoModCachePath() (string, error)
- func GetModuleNameByDir(projectDir string, log Log) (string, error)
- func GetPartialsBuildDir(buildName, buildNumber, projectKey, buildsDirPath string) (string, error)
- func GetProjectRoot() (string, error)
- func IsDirExists(path string) (bool, error)
- func IsFileExists(path string) (bool, error)
- func IsPathExists(path string) bool
- func ListFiles(path string) ([]string, error)
- func NewDefaultLogger(logLevel LevelType) *defaultLogger
- func RemoveTempDir(dirPath string) error
- func RunGo(goArg []string, repoUrl string) error
- type Algorithm
- type Cmd
- type LevelType
- type Log
- type NullLog
Constants ¶
This section is empty.
Variables ¶
var ErrShortWrite = errors.New("short write")
Functions ¶
func AsyncMultiWriter ¶ added in v0.1.5
AsyncMultiWriter creates a writer that duplicates its writes to all the provided writers asynchronous
func CalcChecksums ¶ added in v0.1.5
CalcChecksums calculates all hashes at once using AsyncMultiWriter. The file is therefore read only once.
func CleanOldDirs ¶ added in v0.1.5
func CleanOldDirs() error
Old runs/tests may leave junk at temp dir. Each temp file/Dir is named with prefix+timestamp, search for all temp files/dirs that match the common prefix and validate their timestamp.
func CreateExtractorPropsFile ¶
func CreateExtractorPropsFile(configPropertiesPath string, configProperties map[string]string) (string, error)
Save all the extractor's properties into a local file. configPropertiesPath - path to a file where all the properties will be written. configProperties - the actual properties.
func CreateTempBuildFile ¶
func CreateTempBuildFile(buildName, buildNumber, projectKey, buildsDirPath string, logger Log) (*os.File, error)
Create a temp file of build-info.
func CreateTempDir ¶ added in v0.1.5
CreateTempDir creates a temporary directory and returns its path.
func DoubleWinPathSeparator ¶
func DownloadDependencies ¶
func DownloadFile ¶
func GetBuildDir ¶
func GetCachePath ¶ added in v0.1.5
GetCachePath returns the location of downloads dir insied the GOMODCACHE
func GetDependenciesGraph ¶ added in v0.1.5
Runs 'go mod graph' command and returns map that maps dependencies to their child dependencies slice
func GetDependenciesList ¶ added in v0.1.5
Runs go list -f {{with .Module}}{{.Path}}:{{.Version}}{{end}} all command and returns map of the dependencies
func GetFileChecksums ¶ added in v0.1.5
func GetFileContentAndInfo ¶ added in v0.1.5
func GetGoModCachePath ¶ added in v0.1.5
GetGoModCachePath returns the location of the go module cache
func GetModuleNameByDir ¶ added in v0.1.5
Runs 'go list -m' command and returns module name
func GetPartialsBuildDir ¶
func GetProjectRoot ¶ added in v0.1.5
Returns the root dir where the go.mod located.
func IsDirExists ¶
func IsFileExists ¶
func NewDefaultLogger ¶
func NewDefaultLogger(logLevel LevelType) *defaultLogger
NewDefaultLogger creates a new logger with a given LogLevel. All logs are written to Stderr and output is written to Stdout.
func RemoveTempDir ¶ added in v0.1.5
Types ¶
type Cmd ¶ added in v0.1.5
type Cmd struct { Go string Command []string CommandFlags []string Dir string StrWriter io.WriteCloser ErrWriter io.WriteCloser }
func (*Cmd) GetErrWriter ¶ added in v0.1.5
func (config *Cmd) GetErrWriter() io.WriteCloser
func (*Cmd) GetStdWriter ¶ added in v0.1.5
func (config *Cmd) GetStdWriter() io.WriteCloser
type Log ¶
type Log interface { Debug(a ...interface{}) Info(a ...interface{}) Warn(a ...interface{}) Error(a ...interface{}) Output(a ...interface{}) }