{"modulePath":"github.com/CS-SI/SafeScale/v21","version":"v21.11.1","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package utils\n\n## Constants\n\n```go\nconst (\n\tBaseFolder  = \"/opt/safescale\"     // is the path of the base folder containing safescale data on cloud provider instances\n\tEtcFolder   = BaseFolder + \"/etc\"  // is the path of the folder containing safescale configurations\n\tBinFolder   = BaseFolder + \"/bin\"  // is the path of the folder containing safescale binaries on cloud provider instances\n\tVarFolder   = BaseFolder + \"/var\"  // is the path of the folder containing safescale equivalent of /var\n\tLogFolder   = VarFolder + \"/log\"   // is the path of the folder containing safescale logs\n\tTempFolder  = VarFolder + \"/tmp\"   // is the path of the folder containing safescale temporary files\n\tStateFolder = VarFolder + \"/state\" // is the path of the folder containing safescale states\n)\n```\n\n## Functions\n\n```go\nfunc AbsPathify(inPath string) string\n```\nAbsPathify ...\n\n```go\nfunc ExtractRetCode(err error) (_ string, _ int, ferr fail.Error)\n```\nExtractRetCode extracts info from the error\n\n```go\nfunc GeneratePassword(length uint8) (string, error)\n```\nGeneratePassword generates a password with length at least 12\n\n```go\nfunc IsEmpty(v interface{}) bool\n```\nIsEmpty checks whether v is an empty struct Note:because IsEmpty uses reflect package, it may be slow. Use with parsimony\n\n```go\nfunc LazyRemove(path string) fail.Error\n```\nLazyRemove is identical to os.Remove, but doesn't raise an error, and log.Warn every error except \"file not found\" which is ignored\n\n```go\nfunc UserConfirmed(msg string) bool\n```\nUserConfirmed asks user to confirm\n\n## Types\n\n```go\ntype Valid interface {\n\tOK() bool\n}\n```\nValid interface is used to check data validity\n\n","path":"github.com/CS-SI/SafeScale/v21/lib/utils","name":"utils","synopsis":"","isRedistributable":true}
