Documentation ¶
Index ¶
- Constants
- Variables
- func AbsPath(filePath string) (string, error)
- func BasicToken(user string, pwd string) string
- func CheckErr(err error, msg string, a ...interface{})
- func CopyFile(src, dst string) error
- func Curl(uri string, method string, token string, validCodes []int, payload string, ...)
- func Debug(msg string, a ...interface{})
- func Encode(value string) string
- func EnsureRegistryPath(path string) error
- func Extract(content, prefix, suffix string, n int) []string
- func FilenameWithoutExtension(fn string) string
- func FilesPath(path string) string
- func FindFiles(root, extPattern string) ([]string, error)
- func Get(url, user, pwd string) (*http.Response, error)
- func HandleCtrlC(err error)
- func HasFunction(value string) (bool, string)
- func HasShell(value string) (bool, string, string)
- func HomeDir() string
- func InDebugMode() bool
- func Infof(msg string, a ...interface{})
- func IsJSON(s string) bool
- func IsPackageName(val interface{}) error
- func IsPath(val interface{}) error
- func IsURI(val interface{}) error
- func LangExists(path string)
- func LangPath(path string) string
- func MergeEnvironmentVars(args []string, env conf.Configuration, interactive bool) ([]string, conf.Configuration)
- func NewTempDir(artHome string) (string, error)
- func QualifyRuntime(runtime string) string
- func RaiseErr(msg string, a ...interface{})
- func RandomName(number int) string
- func RandomPwd(length int, addSymbols bool) string
- func RandomString(n int) string
- func RegUserPwd(creds string) (user, pwd string)
- func RegistryPath(path string) string
- func RemoveElement(a []string, value string) []string
- func RunPath(path string) string
- func RunPathExists(path string)
- func Tar(files []TarFile, buf io.Writer, preserveDirStruct bool, artHome string) error
- func TmpExists(path string)
- func TmpPath(path string) string
- func ToAbs(path string) string
- func ToAbsPath(flowPath string) string
- func ToElapsedLabel(rfc850time string) string
- func ToJsonBytes(s interface{}) []byte
- func ToYamlBytes(s interface{}) ([]byte, error)
- func TrimNewline(s string) string
- func Untar(tarballReader io.Reader, outputPath string) error
- func UserPwd(creds string) (user, pwd string)
- func Wait(uri, filter, token string, maxAttempts int)
- func WorkDir() string
- type Log
- type PackageName
- func (a *PackageName) FullyQualifiedGroup() string
- func (a *PackageName) FullyQualifiedName() string
- func (a *PackageName) FullyQualifiedNameTag() string
- func (a *PackageName) IsInTheSameRepositoryAs(name *PackageName) bool
- func (a *PackageName) NormalString() string
- func (a *PackageName) Repository() string
- func (a *PackageName) String() string
- type Table
- type TarFile
Constants ¶
const ( // ArtDebug the global flag used to switch on debug / verbose mode ArtDebug = "ART_DEBUG" // ArtPackageFQDN the env var that defines the name of the artisan package to run ArtPackageFQDN = "ART_PACKAGE_FQDN" // ArtPackageDomain the domain portion specified in the artisan package name ArtPackageDomain = "ART_PACKAGE_DOMAIN" // ArtPackageGroup the group portion specified in the artisan package name ArtPackageGroup = "ART_PACKAGE_GROUP" // ArtPackageName the name portion specified in the artisan package name ArtPackageName = "ART_PACKAGE_NAME" // ArtPackageTag the tag portion specified in the artisan package name ArtPackageTag = "ART_PACKAGE_TAG" // ArtFxName the env var that defines the name of the package function to run ArtFxName = "ART_FX_NAME" // ArtPackageSource the env var that defines the type of source a runner pipeline should use ArtPackageSource = "ART_PACKAGE_SOURCE" // ArtRegUser the name of the env variable that holds the artisan registry user to authenticate with a remote registry // when registry related commands are executed and no specific credentials are provided via command flag ArtRegUser = "ART_REG_USER" // ArtRegPassword1 the name of the env variable that holds the artisan registry password to authenticate with a remote registry // when registry related commands are executed and no specific credentials are provided via command flag ArtRegPassword1 = "ART_REG_PWD" ArtRegPassword2 = "ART_REG_PASS" // ArtDefaultHome the default artisan home ArtDefaultHome = "" ArtReference = "ART_REF" ArtBuildPath = "ART_BUILD_PATH" ArtGitCommit = "ART_GIT_COMMIT" ArtWorkDir = "ART_WORK_DIR" ArtFromUri = "ART_FROM_URI" ArtOS = "ART_OS" ArtArch = "ART_ARCH" ArtShell = "ART_SHELL" // ArtExeWd the path from where a package was run ArtExeWd = "ART_EXE_WD" )
const ( RegDomain = "artr.gdn" RegGroup = "lib" )
const AppName = "artisan"
Variables ¶
var ( WarningLogger *log.Logger InfoLogger *log.Logger ErrorLogger *log.Logger DebugLogger *log.Logger )
var Version = "0.0.0"
Version placeholder variable for the version number displayed on cli this value gets overridden at build time with the correct version in the build file
Functions ¶
func BasicToken ¶
BasicToken creates a basic authentication token
func EnsureRegistryPath ¶
EnsureRegistryPath check the local registry directory exists and if not creates it
func Extract ¶
Extract up to a maximum of "n" occurrences of a string that has a "prefix" and a "suffix" in "content" prefix and suffix can be golang regex, for example using suffix = "$" means match up to the end of the line
func FindFiles ¶
FindFiles return a list of file names matching the specified regular expression pattern recursively checking all subfolders in the specified root
func HandleCtrlC ¶
func HandleCtrlC(err error)
func HasFunction ¶
func InDebugMode ¶
func InDebugMode() bool
func IsPackageName ¶
func IsPackageName(val interface{}) error
IsPackageName requires the value conforms to an Artisan package name
func LangExists ¶
func LangExists(path string)
func MergeEnvironmentVars ¶
func MergeEnvironmentVars(args []string, env conf.Configuration, interactive bool) ([]string, conf.Configuration)
MergeEnvironmentVars merges environment variables in the arguments returns the merged command list and the updated environment variables map if interactive mode is used
func NewTempDir ¶
NewTempDir will create a temp folder with a random name and return the path
func QualifyRuntime ¶
defaults to quay.io/artisan root if not specified
func RandomString ¶
RandomString gets a random string of specified length
func RegUserPwd ¶
RegUserPwd returns username and password from a username:password formatted string if the passed-in creds string is empty then it checks if the artisan registry env variables have been set and if so, use their values as creds note: this function should be used any time remote artisan registry operations are required
func RegistryPath ¶
RegistryPath gets the root path of the local registry
func RemoveElement ¶
RemoveElement remove an element in a slice
func RunPathExists ¶
func RunPathExists(path string)
func ToElapsedLabel ¶
ToElapsedLabel returns the elapsed time until now in human friendly format
func ToJsonBytes ¶
func ToJsonBytes(s interface{}) []byte
ToJsonBytes convert the passed in parameter to a Json Byte Array
func ToYamlBytes ¶
ToYamlBytes convert the passed in parameter to a Yaml Byte Array
func TrimNewline ¶
Types ¶
type PackageName ¶
PackageName defines the name of a package following the format: domain/group/name:tag
func ParseName ¶
func ParseName(packageName string) (*PackageName, error)
func ValidateNames ¶
func ValidateNames(packages []string) ([]PackageName, error)
ValidateNames get a list of qualified package names from their string representation
func (*PackageName) FullyQualifiedGroup ¶
func (a *PackageName) FullyQualifiedGroup() string
func (*PackageName) FullyQualifiedName ¶
func (a *PackageName) FullyQualifiedName() string
func (*PackageName) FullyQualifiedNameTag ¶
func (a *PackageName) FullyQualifiedNameTag() string
func (*PackageName) IsInTheSameRepositoryAs ¶
func (a *PackageName) IsInTheSameRepositoryAs(name *PackageName) bool
func (*PackageName) NormalString ¶
func (a *PackageName) NormalString() string
func (*PackageName) Repository ¶
func (a *PackageName) Repository() string
func (*PackageName) String ¶
func (a *PackageName) String() string