utils

package
v0.0.0-...-6b0a7c7 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2016 License: Apache-2.0 Imports: 19 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddTrailingSlashIfNeeded

func AddTrailingSlashIfNeeded(url string) string

func AppendFile

func AppendFile(srcPath string, destFile *os.File)

Reads the content of the file in the source path and appends it to the file in the destination path.

func BuildAqlSearchQuery

func BuildAqlSearchQuery(searchPattern string, recursive bool, props string) string

func CheckError

func CheckError(err error)

func CreateTempDirPath

func CreateTempDirPath()

func DownloadFile

func DownloadFile(downloadPath, localPath, fileName string, flat bool, artifactoryDetails ArtifactoryDetails) *http.Response

func DownloadFileConcurrently

func DownloadFileConcurrently(downloadPath, localPath, fileName, logMsgPrefix string, fileSize int64, flags *Flags)

func Exit

func Exit(exitCode ExitCode, msg string)

func GetEncryptedPasswordFromArtifactory

func GetEncryptedPasswordFromArtifactory(artifactoryDetails *ArtifactoryDetails) (*http.Response, string)

func GetFileNameFromPath

func GetFileNameFromPath(path string) string

func GetFileSeperator

func GetFileSeperator() string

func GetHomeDir

func GetHomeDir() string

func GetLogMsgPrefix

func GetLogMsgPrefix(threadId int, dryRun bool) string

func GetTempDirPath

func GetTempDirPath() string

func GetVersion

func GetVersion() string

func IsDir

func IsDir(path string) bool

func IsDirExists

func IsDirExists(path string) bool

func IsFileExists

func IsFileExists(path string) bool

func IsPathExists

func IsPathExists(path string) bool

func ListFiles

func ListFiles(path string) []string

Return the list of files and directories in the specified path

func ListFilesRecursive

func ListFilesRecursive(path string) []string

Return the recursive list of files and directories in the specified path

func ReadFile

func ReadFile(filePath string) []byte

func RemoveTempDir

func RemoveTempDir()

func Send

func Send(method string, url string, content []byte, headers map[string]string,
	artifactoryDetails ArtifactoryDetails) (*http.Response, []byte)

func SendGet

func SendGet(url string, headers map[string]string, artifactoryDetails ArtifactoryDetails) (*http.Response, []byte)

func SendHead

func SendHead(url string, artifactoryDetails ArtifactoryDetails) (*http.Response, []byte)

func SendPost

func SendPost(url string, content []byte, artifactoryDetails ArtifactoryDetails) (*http.Response, []byte)

func SendPut

func SendPut(url string, content []byte, headers map[string]string, artifactoryDetails ArtifactoryDetails) (*http.Response, []byte)

func SshAuthentication

func SshAuthentication(details *ArtifactoryDetails)

func UploadFile

func UploadFile(f *os.File, url string, artifactoryDetails ArtifactoryDetails, details *FileDetails) *http.Response

Types

type ArtifactoryDetails

type ArtifactoryDetails struct {
	Url            string
	User           string
	Password       string
	SshKeyPath     string
	SshAuthHeaders map[string]string
}

type ExitCode

type ExitCode struct {
	Code int
}
var ExitCodeError ExitCode = ExitCode{1}
var ExitCodeWarning ExitCode = ExitCode{2}

type FileDetails

type FileDetails struct {
	Md5          string
	Sha1         string
	Size         int64
	AcceptRanges bool
}

func GetFileDetails

func GetFileDetails(filePath string) *FileDetails

func GetFileDetailsFromArtifactory

func GetFileDetailsFromArtifactory(downloadUrl string, artifactoryDetails ArtifactoryDetails) *FileDetails

type Flags

type Flags struct {
	ArtDetails   *ArtifactoryDetails
	DryRun       bool
	Props        string
	Deb          string
	Recursive    bool
	Flat         bool
	UseRegExp    bool
	Threads      int
	MinSplitSize int64
	SplitCount   int
	Interactive  bool
	EncPassword  bool
}

type PathFilePair

type PathFilePair struct {
	// contains filtered or unexported fields
}

type SshAuthResult

type SshAuthResult struct {
	Href    string
	Headers map[string]string
}

Jump to

Keyboard shortcuts

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