Documentation ¶
Index ¶
- Constants
- Variables
- func AddTrailingSlashIfNeeded(url string) string
- func Bool2Int(b bool) int
- func BuildTargetPath(pattern, path, target string, ignoreRepo bool) (string, error)
- func CheckErrorWithMessage(err error, message string) error
- func ConvertSliceToMap(slice []string) map[string]bool
- func CopyMap(src map[string]string) (dst map[string]string)
- func GetBoolEnvValue(flagName string, defValue bool) (bool, error)
- func GetLogMsgPrefix(threadId int, dryRun bool) string
- func GetRegExp(regex string) (*regexp.Regexp, error)
- func GetRootPath(path string, useRegExp bool, parentheses ParenthesesSlice) string
- func GetUserAgent() string
- func GetUserHomeDir() string
- func IndentJson(jsonStr []byte) string
- func IndentJsonArray(jsonStr []byte) string
- func IsSlashPrecedeAsterisk(asteriskIndex, slashIndex int) bool
- func IsWindows() bool
- func MaskCredentials(line, credentialsPart string) string
- func MergeMaps(src map[string]string, dst map[string]string)
- func NewGitManager(path string) *manager
- func PrepareLocalPathForUpload(localPath string, useRegExp bool) string
- func RemovePlaceholderParentheses(pattern, target string) string
- func ReplaceTildeWithUserHome(path string) string
- func SetUserAgent(newUserAgent string)
- func SplitWithEscape(str string, separator rune) []string
- func StringToBool(boolVal string, defaultValue bool) (bool, error)
- func TrimPath(path string) string
- type Artifact
- type ErrorsQueue
- type ExecutionHandlerFunc
- type Parentheses
- type ParenthesesSlice
- type RetryExecutor
- type VcsCache
Constants ¶
const ( Development = "development" Agent = "jfrog-client-go" Version = "0.14.1" )
const CredentialsInUrlRegexp = `((http|https):\/\/.+:.*@)`
const MAX_ENTRIES = 10000
Variables ¶
var MaxBufferSize = 50000
In order to limit the number of items loaded from a reader into the memory, we use a buffers with this size limit.
Functions ¶
func BuildTargetPath ¶
Replaces matched regular expression from path to corresponding placeholder {i} at target. Example 1:
pattern = "repoA/1(.*)234" ; path = "repoA/1hello234" ; target = "{1}" ; ignoreRepo = false returns "hello"
Example 2:
pattern = "repoA/1(.*)234" ; path = "repoB/1hello234" ; target = "{1}" ; ignoreRepo = true returns "hello"
func CheckErrorWithMessage ¶
func ConvertSliceToMap ¶
func GetLogMsgPrefix ¶
func GetRootPath ¶
func GetRootPath(path string, useRegExp bool, parentheses ParenthesesSlice) string
Get the local root path, from which to start collecting artifacts to be used for: 1. Uploaded to Artifactory, 2. Adding to the local build-info, to be later published to Artifactory.
func GetUserAgent ¶
func GetUserAgent() string
func GetUserHomeDir ¶
func GetUserHomeDir() string
func IndentJson ¶
func IndentJsonArray ¶
func IsSlashPrecedeAsterisk ¶
func MaskCredentials ¶
Mask the credentials information from the line, contained in credentialsPart. The credentials are built as user:password For example: line = 'This is a line http://user:password@127.0.0.1:8081/artifactory/path/to/repo' credentialsPart = 'http://user:password@' Returned value: 'This is a line http://***:***@127.0.0.1:8081/artifactory/path/to/repo'
func NewGitManager ¶
func NewGitManager(path string) *manager
func SetUserAgent ¶
func SetUserAgent(newUserAgent string)
func SplitWithEscape ¶
Split str by the provided separator, escaping the separator if it is prefixed by a back-slash.
Types ¶
type ErrorsQueue ¶
type ErrorsQueue struct {
// contains filtered or unexported fields
}
func NewErrorsQueue ¶
func NewErrorsQueue(size int) *ErrorsQueue
func (*ErrorsQueue) AddError ¶
func (errQueue *ErrorsQueue) AddError(err error)
func (*ErrorsQueue) GetError ¶
func (errQueue *ErrorsQueue) GetError() error
type ExecutionHandlerFunc ¶
type Parentheses ¶
This struct represents the parentheses used for defining Placeholders (Placeholders is a feature supported by File Specs).
type ParenthesesSlice ¶
type ParenthesesSlice struct {
Parentheses []Parentheses
}
func NewParenthesesSlice ¶
func NewParenthesesSlice(pattern, target string) ParenthesesSlice
func (*ParenthesesSlice) IsPresent ¶
func (p *ParenthesesSlice) IsPresent(index int) bool
type RetryExecutor ¶
type RetryExecutor struct { // The amount of retries to perform. MaxRetries int // Number of seconds to sleep between retries. RetriesInterval int // Message to display when retrying. ErrorMessage string // Prefix to print at the beginning of each log. LogMsgPrefix string // ExecutionHandler is the operation to run with retries. ExecutionHandler ExecutionHandlerFunc }
func (*RetryExecutor) Execute ¶
func (runner *RetryExecutor) Execute() error
type VcsCache ¶
type VcsCache struct {
// contains filtered or unexported fields
}
func NewVcsDetals ¶
func NewVcsDetals() *VcsCache
func (*VcsCache) GetVcsDetails ¶
Search for '.git' directory inside 'path', incase there is one, extract the details and add a new entry to the cache(key:path in the file system ,value: git revision & url). otherwise, search in the parent folder and try: 1. search for .git, and save the details for the current dir and all subpath 2. .git not found, go to parent dir and repeat 3. not found on the root directory, add all subpath to cache with nil as a value