Documentation ¶
Index ¶
- Constants
- Variables
- func CheckRecommendedBinaries(binaries ...string)
- func CheckRequiredBinaries(binaries ...string) error
- func CheckTarantoolBinaries() error
- func ClearDir(dirPath string) error
- func CompressGzip(srcFilePath string, destFilePath string) error
- func ConcatBuffers(dest *bytes.Buffer, sources ...*bytes.Buffer) error
- func ContainsUpperSymbols(src string) bool
- func ConvertToSlice(raw interface{}) ([]interface{}, error)
- func ConvertToStringsSlice(s interface{}) ([]string, error)
- func DecodeMsgpackStruct(d *msgpack.Decoder, v interface{}) error
- func ErrWrapCheckInstanceNameCommonMisprint(instanceNames []string, projectName string, err error) error
- func FileLinesScanner(file *os.File) *bufio.Scanner
- func FileMD5(path string) ([]byte, error)
- func FileMD5Hex(path string) (string, error)
- func FileSHA1Hex(path string) (string, error)
- func FileSHA256Hex(path string) (string, error)
- func FindRockspec(path string) (string, error)
- func FormatStringStringMap(mapStringString map[string]string) string
- func GetCartridgeVersionStr(conn *connector.Conn) (string, error)
- func GetCurrentUserID() (string, error)
- func GetFileContent(path string) (string, error)
- func GetFileContentBytes(path string) ([]byte, error)
- func GetHomeDir() (string, error)
- func GetInstancesFromArgs(args []string) ([]string, error)
- func GetLastNLines(filepath string, linesN int) ([]string, error)
- func GetLastNLinesBegin(filepath string, lines int) (int64, error)
- func GetMajorCartridgeVersion(conn *connector.Conn) (int, error)
- func GetMajorMinorVersion(version string) string
- func GetMinimalRequiredVersion(ver TarantoolVersion) (string, error)
- func GetMissedBinaries(binaries ...string) []string
- func GetNextMajorVersion(ver TarantoolVersion) string
- func GetOutput(cmd *exec.Cmd, dir *string) (string, error)
- func GetStringSlicesDifference(s1, s2 []string) []string
- func GetTarantoolDir() (string, error)
- func GetTarantoolVersion(tarantoolDir string) (string, error)
- func GetTarantoolVersionFromFile(tarantoolVersionFilePath string) (string, error)
- func GitIsInstalled() bool
- func HasPerm(fileInfo os.FileInfo, perm os.FileMode) bool
- func InsertInStringSlice(s []string, i int, elem string) []string
- func IntsToStrings(numbers []int) []string
- func IsExecOwner(path string) (bool, error)
- func IsGitProject(path string) bool
- func IsSocket(path string) (bool, error)
- func IsSubDir(subdir string, dir string) (bool, error)
- func LuaReadStringVar(filePath string, varName string) (string, error)
- func MergeFiles(destFilePath string, srcFilePaths ...string) error
- func OnlyOneIsTrue(values ...bool) bool
- func OptValue(opt OptionalUint64) (uint64, bool)
- func ParseYmlFile(path string) (map[string]interface{}, error)
- func PrintFromStart(file *os.File) error
- func Prompt(text, defaultValue string) string
- func RandomString(n int) string
- func RemoveFromStringSlice(s []string, i int) []string
- func ReplaceFileLinesByRe(filePath string, re *regexp.Regexp, repl string) error
- func RunCommand(cmd *exec.Cmd, dir string, showOutput bool) error
- func RunFunctionWithSpinner(f func() error, prefix string) error
- func RunHook(hookPath string, showOutput bool) error
- func SendReady(c ReadyChan)
- func StartCommandSpinner(c ReadyChan, wg *sync.WaitGroup, prefix string)
- func StdinHasUnreadData() (bool, error)
- func StringSHA1Hex(source string) string
- func StringSliceContains(s []string, elem string) bool
- func StringsSliceElemIndex(s []string, elem string) int
- func TarantoolIsEnterprise(tarantoolDir string) (bool, error)
- func TrimSince(s string, since string) string
- func WriteTarArchive(srcDirPath string, compressWriter io.Writer) error
- func WriteTgzArchive(srcDirPath string, destFilePath string) error
- type DepRelation
- type OptionalUint64
- type PackDependencies
- type PackDependency
- type ReadyChan
- type ResChan
- type ResMessageType
- type ResStatusType
- type Result
- type ResultMessage
- func GetDebugMessage(format string, a ...interface{}) ResultMessage
- func GetErrMessage(format string, a ...interface{}) ResultMessage
- func GetInfoMessage(format string, a ...interface{}) ResultMessage
- func GetMessage(msgType ResMessageType, format string, a ...interface{}) ResultMessage
- func GetWarnMessage(format string, a ...interface{}) ResultMessage
- type RocksVersions
- type TarantoolVersion
Constants ¶
const (
TarantoolVersionFileName = "tarantool.txt"
)
Variables ¶
var ( ColorErr *color.Color ColorWarn *color.Color ColorOk *color.Color ColorRed *color.Color ColorYellow *color.Color ColorGreen *color.Color ColorCyan *color.Color ColorHiCyan *color.Color ColorMagenta *color.Color ColorHiMagenta *color.Color ColorBlue *color.Color ColorHiBlue *color.Color )
Functions ¶
func CheckRecommendedBinaries ¶
func CheckRecommendedBinaries(binaries ...string)
CheckRecommendedBinaries warns if some binaries not found in PATH
func CheckRequiredBinaries ¶
CheckRequiredBinaries returns an error if some binaries not found in PATH
func CheckTarantoolBinaries ¶
func CheckTarantoolBinaries() error
CheckTarantoolBinaries returns an error if tarantool or tarantoolctl is not found in PATH
func CompressGzip ¶
CompressGzip compresses specified file with gzip.BestCompression level
func ConcatBuffers ¶
ConcatBuffers appends sources content to dest
func ContainsUpperSymbols ¶
func ConvertToSlice ¶
func ConvertToSlice(raw interface{}) ([]interface{}, error)
func ConvertToStringsSlice ¶
func DecodeMsgpackStruct ¶
func DecodeMsgpackStruct(d *msgpack.Decoder, v interface{}) error
func FileLinesScanner ¶
FileLinesScanner returns scanner for file
func FileMD5Hex ¶
FileMD5Hex computes MD5 for a given file. The result is returned in a hex form
func FileSHA1Hex ¶
FileSHA1Hex computes SHA1 for a given file. The result is returned in a hex form
func FileSHA256Hex ¶
FileSHA256Hex computes SHA256 for a given file. The result is returned in a hex form
func FindRockspec ¶
FindRockspec finds *.rockspec file in specified path
func FormatStringStringMap ¶
func GetCurrentUserID ¶
GetCurrentUserID returns current user UID
func GetFileContent ¶
GetFileContent returns file content as a string
func GetFileContentBytes ¶
GetFileContent returns file content as a bytes slice
func GetInstancesFromArgs ¶
func GetLastNLinesBegin ¶
GetLastNLinesBegin return the position of last lines begin
func GetMajorMinorVersion ¶
GetMajorMinorVersion computes returns `<major>.<minor>` string for a given version
func GetMinimalRequiredVersion ¶
func GetMinimalRequiredVersion(ver TarantoolVersion) (string, error)
GetMinimalRequiredVersion computes minimal required Tarantool version for a package (rpm, deb).
func GetMissedBinaries ¶
GetMissedBinaries returns list of binaries not found in PATH
func GetNextMajorVersion ¶
func GetNextMajorVersion(ver TarantoolVersion) string
GetNextMajorVersion computes next Major version for a given one. For example, for 1.10.3 it's 2 .
func GetTarantoolDir ¶
GetTarantoolDir returns Tarantool executable directory.
func GetTarantoolVersion ¶
GetTarantoolVersion gets Tarantool version from the environment.
func GetTarantoolVersionFromFile ¶
GetTarantoolVersionFromFile gets Tarantool version from config file.
func IntsToStrings ¶
IntsToStrings converts int slice to strings slice
func IsExecOwner ¶
IsExecOwner checks if specified file has owner execute permissions
func IsGitProject ¶
IsGitProject checks if specified path is a git project
func LuaReadStringVar ¶
LuaReadStringVar reads global string variable from specified Lua file
func MergeFiles ¶
MergeFiles creates a file that is a concatenation of srcFilePaths
func OnlyOneIsTrue ¶
OnlyOneIsTrue checks if one and only one of boolean values is true
func OptValue ¶
func OptValue(opt OptionalUint64) (uint64, bool)
OptFrom returns Optional value and "is set" flag.
func ParseYmlFile ¶
ParseYmlFile reads YAML file and returns it's content as a map
func PrintFromStart ¶
func RemoveFromStringSlice ¶
func ReplaceFileLinesByRe ¶
func RunCommand ¶
RunCommand runs specified command and returns an error If showOutput is set to true, command output is shown Else spinner is shown while command is running
func RunFunctionWithSpinner ¶
RunFunctionWithSpinner executes function and starts a spinner with specified prefix in a background until function returns
func RunHook ¶
RunHook runs specified hook and returns an error If showOutput is set to true, command output is shown
func StartCommandSpinner ¶
StartCommandSpinner starts running spinner until `ready` flag is received from the channel
func StdinHasUnreadData ¶
func StringSHA1Hex ¶
StringSHA1Hex computes SHA1 for a given string The result is returned in a hex form
func StringSliceContains ¶
func StringsSliceElemIndex ¶
func TarantoolIsEnterprise ¶
TarantoolIsEnterprise checks if Tarantool is Enterprise
func TrimSince ¶
TrimSince trims a string starts with a given substring. For example, TrimSince("a = 1 # comment", "#") is "a = 1 "
func WriteTarArchive ¶
WriteTarArchive creates Tar archive of specified path using specified writer
func WriteTgzArchive ¶
WriteTgzArchive creates TGZ archive of specified path
Types ¶
type DepRelation ¶
type OptionalUint64 ¶
type OptionalUint64 struct {
// contains filtered or unexported fields
}
OptionalUint64 is optional value.
func OptFrom ¶
func OptFrom(newValue uint64) OptionalUint64
OptFrom initializes Optional struct with provided value.
type PackDependencies ¶
type PackDependencies []PackDependency
func ParseDependencies ¶
func ParseDependencies(rawDeps []string) (PackDependencies, error)
func (*PackDependencies) AddTarantool ¶
func (deps *PackDependencies) AddTarantool(minVersion, maxVersion string)
type PackDependency ¶
type PackDependency struct { Name string `@Ident` Relations []DepRelation `(@@ ( "," @@ )?)?` }
type ResMessageType ¶
type ResMessageType int
const ( ResMessageWarn ResMessageType = iota + 10 ResMessageDebug ResMessageInfo ResMessageErr )
type ResStatusType ¶
type ResStatusType int
const ( ResStatusOk ResStatusType = iota ResStatusSkipped ResStatusFailed ResStatusExited ResStatusUpdated ResStatusCreated )
type Result ¶
type Result struct { ID string Status ResStatusType Error error Messages []ResultMessage }
func (*Result) FormatError ¶
type ResultMessage ¶
type ResultMessage struct { Type ResMessageType Text string }
func GetDebugMessage ¶
func GetDebugMessage(format string, a ...interface{}) ResultMessage
func GetErrMessage ¶
func GetErrMessage(format string, a ...interface{}) ResultMessage
func GetInfoMessage ¶
func GetInfoMessage(format string, a ...interface{}) ResultMessage
func GetMessage ¶
func GetMessage(msgType ResMessageType, format string, a ...interface{}) ResultMessage
func GetWarnMessage ¶
func GetWarnMessage(format string, a ...interface{}) ResultMessage
type RocksVersions ¶
func LuaGetRocksVersions ¶
func LuaGetRocksVersions(appDirPath string) (RocksVersions, error)
LuaGetRocksVersions gets map which contains {name: versions} from rocks manifest
type TarantoolVersion ¶
type TarantoolVersion struct { Major uint64 Minor OptionalUint64 Patch OptionalUint64 TagSuffix string CommitsSinceTag uint64 CommitHashId string EnterpriseSDKRevision string EnterpriseIsOnMacOS bool IsDevelopmentBuild bool }
func ParseShortTarantoolVersion ¶
func ParseShortTarantoolVersion(version string) (TarantoolVersion, error)
ParseShortTarantoolVersion parse Tarantool version provided by user.
func ParseTarantoolVersion ¶
func ParseTarantoolVersion(version string) (TarantoolVersion, error)
ParseTarantoolVersion extracts Tarantool version string to a TarantoolVersion struct.