Documentation
¶
Index ¶
- Constants
- Variables
- func AppendStringToFile(filename string, content string) error
- func Atoi(s string, retOnError int) int
- func Atoi64(s string, retOnError int64) int64
- func BlankIsNA(s string) string
- func BoolColor(b bool) string
- func BuildVersion() string
- func BuildVersionWithMainBranch(mainbranch string) string
- func CSVtoArray(tagcsv string) []string
- func CalculateETARaw(remaining int64, rateOfChange float64) int64
- func CalculatePartSize(objectSize int64) int64
- func CalculateRateOfChange(unitsProcessed int64, startTime int64, endTime int64) float64
- func CalculateTotalParts(objectSize, partSize int64) int64
- func CapturePids(main string, hint string) ([]int, error)
- func Chain(handler http.HandlerFunc, middlewares ...Middleware) http.HandlerFunc
- func CheckOpenPortIPV4(address string, port int) bool
- func CheckOpenPortIPV6(address string, port int) bool
- func CheckSpaceForPath(rootPath, bindPath string, thresholdBytes uint64) (bool, error)
- func CheckSpaceForPathUpToOneGiB(rootPath, bindPath string) bool
- func CheckSpaceForPathUpToOneTiB(rootPath, bindPath string) bool
- func CommentPrintf(format string, a ...any)
- func CommentPrintln(cmd string)
- func CompareMaps(mapA, mapB map[string]string) []string
- func CompareS3ObjectLists(mapA, mapB []S3Objects) []string
- func Concurrent(f func(string) bool, remoteFile string, x int) []bool
- func ContentTypeJSON() (string, string)
- func CopyFile(src, dst string) (int64, error)
- func CountObjectsAndSize(objects []*s3.Object) (int64, int64)
- func CountVersionsAndSize(versions []*s3.ObjectVersion, deleteMarkers []*s3.DeleteMarkerEntry) (int64, int64)
- func CreateGrant(id string, perm string) grantBucketACLStruct
- func CreateTempFile(size int64, sparse bool) (string, error)
- func DDHumanReadableStorageSize(size int64) string
- func DaysUntilExpiration(compileTime time.Time, daysInFuture int) int
- func DbSelfTest(dbPath string, query string) error
- func DebugPrintf(format string, a ...any)
- func DebugPrintln(cmd string)
- func DeepCopyStringToPointer(s string) *string
- func DiffAny(a, b any) []string
- func DiffSlices(a, b []string) []string
- func DiffStringBlobs(a, b string) string
- func DiffStringContainers(aLines, bLines []string) string
- func DiffStrings(a, b string) []string
- func DiskDuplicatorArgs(device string, outputFile string, blockSize int64, count int64) []string
- func DmidecodeProduct() (string, error)
- func EasyBoolErrIsFalse(r bool, err error) bool
- func EatError(s string, e error) string
- func EatErrorAndReturnInt(i int, e error, retOnError int) int
- func EatErrorReturnBytes(b []byte, e error) []byte
- func EatErrorReturnString(s string, e error) string
- func EmptyString(s string) bool
- func Error2ExitCode(err error) int
- func ExecToFile(cli string, ofile string) (err error)
- func ExecToFileAndSpin(cmd string, redirect string) (err error)
- func ExpandTilde(f string) string
- func FileAuthenticate(username, password, filename string) bool
- func FileAuthenticatePasscode(passcode, filename string) bool
- func FileBaseContainsDate(f string) bool
- func FileExists(filename string) (bool, error)
- func FileExistsEasy(p string) bool
- func FindFiles(symlinkedRoot string, pattern string, inType INodeType) []string
- func FixURI(u string) string
- func FormatBytes(bytes int64) string
- func GenerateJWTKey() string
- func GenerateMoveCLI(f string, suffix string) string
- func GenerateRandomAlphanumString(n int) string
- func GenerateSignature(sts, secret string) string
- func GetArgsFromPid(pid int) ([]string, error)
- func GetBaseName(f string) string
- func GetClassName(fields []string) string
- func GetClassNameLastSegment(className string) string
- func GetDebug() bool
- func GetDryRun() bool
- func GetExperimental() bool
- func GetFileFindCLI(directoryPath string, prefix string, glob string) string
- func GetFileSize(localFile string) (int64, error)
- func GetFileSizeEasy(localFile string) int64
- func GetFindFileCLI(root string, pattern string, inType INodeType) string
- func GetFirstFile(rootpath string, hint string) string
- func GetFirstLineFromFile(f string) string
- func GetFirstLineFromSlice(content string, needle string) string
- func GetFirstOfMonthTimestamp() string
- func GetForce() bool
- func GetFormattedTime(fmt string) string
- func GetFormattedTime1() string
- func GetLastModifiedTime(localFile string) (time.Time, error)
- func GetNewFilenameWithDateStamp(originalFilename string) (string, error)
- func GetNewFilenameWithDateStampEasy(originalFilename string) string
- func GetOutboundIP() string
- func GetPanic() bool
- func GetPassCode(filename string) (string, error)
- func GetPrivateSSHKey() string
- func GetProcessList(mainHint string) ([]string, error)
- func GetQuiet() bool
- func GetRandomInt64InRange(min, max int64) int64
- func GetShortHostName(fqdn string) string
- func GetStringListFromJPS(jlist []jpsProcStruct) []string
- func GetThreadCount(pid int) (int, error)
- func GetTopLevelDir() string
- func GetVerbose() bool
- func GoFuncAndSpin(cb interface{}, params ...interface{}) error
- func Grep(path string, musthave string, mustnothave string) ([]string, error)
- func Gunzip(dst string, r io.Reader) error
- func HasBase(filename string, base string) bool
- func HighLight(a string, b string, hl string) string
- func Hostname() (string, error)
- func HumanReadableBigNumber(n int64) string
- func HumanReadableSeconds(s int64) string
- func HumanReadableStorageCapacity(b int64) string
- func HumanReadableTimeStamp(t int64) string
- func IsCgoEnabled() bool
- func IsIPAddress(s string) bool
- func IsMonth(m string) bool
- func IsMounted(mntpt string) bool
- func IsTokenExpired(tokenString string) (bool, error)
- func IsTokenExpiredEasy(tokenString string) bool
- func JPSStructListToIntList(jps []jpsProcStruct, classname string) []int
- func JsonDeepCopy(input interface{}) (interface{}, error)
- func LoadCredFileMap(filename string) (map[string]string, error)
- func LoadFileIntoSlice(f string) ([]string, error)
- func LocalExecuteAndSpin(cli string) error
- func MD5SumBA(ba []byte) string
- func MD5SumFile(s string) string
- func MD5SumString(s string) string
- func MD5sumChunk(filePath string, chunkSize int64)
- func MD5sumFile(filePath string) (string, error)
- func MapToSlice(data map[string]string) []string
- func MapToTableSlice(data map[string]string) []string
- func MapToTableSliceOrdered(data map[string]string, order []string) []string
- func MkdirAll(path string) error
- func MoveDirs(needleSuffix string, st int, target string) error
- func MoveFile(src string, dst string) error
- func MoveFiles(needleSuffix string, st int, target string) error
- func NotBlankIsMasked(s string) string
- func OccurredXDaysAgo(dateStr string, x int) bool
- func PairToMap(k, v string) map[string]string
- func PanicError(msg string) error
- func ParseCustomTimestamp(dateStr string) (time.Time, error)
- func ParseKeyList(key string) (string, int64)
- func ParseThreadCount(status string) (int, error)
- func Popen3(output_buffer *bytes.Buffer, stack ...*exec.Cmd) (err error)
- func Popen3Grep(cmd string, musthave string, mustnothave string) ([]string, error)
- func Popen3Grep2(cmd string, musthave string, mustnothave string) ([]string, error)
- func Popen3GrepFast(cmd string, musthave string, mustnothave string) ([]string, error)
- func PopentoString(cmd string) (string, error)
- func PopentoStringAwk(cmd string, awk int) (string, error)
- func PrettyPrint(v any) string
- func PrettyPrintJSONFile(filePath string)
- func PrintSortedMap[K comparable, V any](m map[K]V)
- func PromptPasscode(prompt string) (string, error)
- func ReadFileToSlice(filename string, force bool) ([]string, error)
- func ReadStructFromCommand(cli string, structure interface{}) error
- func ReadStructFromCommandOverSSH(ssh SSHStruct, cli string, structure interface{}) error
- func ReadStructFromJSONFile(filePath string, structure interface{}) error
- func ReadStructFromString(content string, structure interface{}) error
- func RecursiveDelete(path string) error
- func ReduceToBlockSize(size int64, blockSize int64) int64
- func RemoveFile(path string) error
- func RemoveFiles(directoryPath string, prefix string) error
- func RemoveGlob(glob string) error
- func RemoveKeyPartialFromSlice(s string, slice []string) []string
- func RemoveTag(l []string, s string) []string
- func RunJPSExample()
- func RunToLess(cmd1 *exec.Cmd) error
- func RunVerification(srcs3c, tgts3c *S3ClientSession, UseSourceAsPrefixOnTarget bool, out io.Writer) error
- func S3HelperScript(profile string, region string, endpoint string) string
- func S3HelperScriptBuiltInCreds(region string, endpoint string, ak string, sk string) string
- func S3HelperScriptBuiltInCredsCreateBucket(region string, endpoint string, ak string, sk string, bucket string) string
- func S3HelperScriptBuiltInCredsDeepClean(region string, endpoint string, ak string, sk string) string
- func S3HelperScriptBuiltInCredsDeepCleanCommon(region string, endpoint string, ak string, sk string, profile string) string
- func S3HelperScriptDeepClean(profile string, region string, endpoint string) string
- func S3ObjectListToMap(s3ObjectList []S3Objects) map[string]string
- func SSHPopenToString(hostname string, command string) (string, error)
- func Sanitized(s string) string
- func SecondsToTimestamp(seconds int64) string
- func SetDebug(b bool)
- func SetDryRun(d bool)
- func SetEnvironment(v *bool, env_var string)
- func SetExperimental(e bool)
- func SetForce(f bool)
- func SetPanic(p bool)
- func SetPrivateSSHKey(newkey string)
- func SetQuiet(q bool)
- func SetStringIfNotSet(v string, d string) string
- func SetVerbose(v bool)
- func SliceContains(haystack []string, needle string) bool
- func SliceToDoc(s []string) string
- func SlicetoJPSStruct(lines []string, hint string) []jpsProcStruct
- func Spinny(sigChan chan bool)
- func StringColor(s string, colorCode int) string
- func StringContainsInCSV(s string, csv string) bool
- func StringToFileOverSSH(outputContent string, remoteserver string, outputfile string) error
- func StripProtocol(httpAddr string) string
- func SummarizeField(filepath string, delim string, fieldNum int) ([]string, error)
- func System3(cmd string) error
- func System3toCapturedString(s *string, cmd string) error
- func Tail(filePath string, numLines int) ([]string, error)
- func Targz(sourceDir string, outputFilename string, leaveout string) error
- func TestEndpoint(url string) bool
- func TestHost(host string) error
- func Touch(fileName string) error
- func TranslateSimilarStructure(input interface{}, output *interface{}) error
- func TrimQuotes(s string) string
- func TrimSuffix(s, suffix string) string
- func TrimTrailingEmptyLines(lines []string) []string
- func TrueIsYes(b bool) string
- func UniqTagSet(l []string) []string
- func Untar(dst string, r io.Reader) error
- func Unzip(destination string, r *zip.ReadCloser) error
- func VerbosePrintf(format string, a ...any)
- func VerbosePrintln(cmd string)
- func WillOccurYDaysFromNow(dateStr string, y int) bool
- func WriteLineToFile(filePath, line string) error
- func WriteSliceToFile(filename string, content []string) error
- func WriteSparseFile(f string, sizeMin int, sizeMax int, r int) error
- func WriteStringToFile(filename string, content string) error
- func WriteStructToJSONFile(filePath string, structure interface{}) error
- func WriteStructToJSONFilePP(filePath string, structure interface{}) error
- func YoungestFileTime() string
- type AWSProfile
- type BoolMapContainer
- func (m *BoolMapContainer) Disable(key string)
- func (m *BoolMapContainer) DisableItems(itemsCSV string)
- func (m *BoolMapContainer) Enable(key string)
- func (m *BoolMapContainer) EnableItems(itemsCSV string)
- func (m *BoolMapContainer) FromCSV(itemsCSV string, s bool)
- func (m BoolMapContainer) IsEnabled(key string) bool
- func (m BoolMapContainer) ToCSV() string
- func (m BoolMapContainer) ToSlice() []string
- type BucketACLStruct
- type BucketSummary
- type CLIExecutor
- func (c *CLIExecutor) AsLongRunning() CLIExecutorIface
- func (exe *CLIExecutor) BackgroundCommand(outputFile string, countdown bool) int
- func (c *CLIExecutor) CaptureJavaProcessList(jvm string) error
- func (exe *CLIExecutor) CheckAndKillProcess(procName string) error
- func (c *CLIExecutor) CountDrivesOverThreshold(threshold int, filter string, count *int) error
- func (c *CLIExecutor) CreateDirectory(dir string, chown string) error
- func (c *CLIExecutor) CreateSymlink(fromFile, toLink string) error
- func (c *CLIExecutor) DownloadFile(fromFile, toPath string) error
- func (c *CLIExecutor) DropSSH() CLIExecutorIface
- func (c *CLIExecutor) DumpOutput() CLIExecutorIface
- func (c *CLIExecutor) Execute() error
- func (c *CLIExecutor) FileExists(path string) bool
- func (c *CLIExecutor) FindFiles(path, prefix, suffix string) CLIExecutorIface
- func (c *CLIExecutor) GetCli() string
- func (c *CLIExecutor) GetCommand() string
- func (c *CLIExecutor) GetCommandWithSub() string
- func (c *CLIExecutor) GetDirectory() string
- func (c *CLIExecutor) GetProcListFromResponseBody() []ProcessInfo
- func (c *CLIExecutor) GetRequestPayload() string
- func (c *CLIExecutor) GetResponseBody() string
- func (c *CLIExecutor) GetResponseBodyAsInt64() int64
- func (c *CLIExecutor) GetResponseBodyAsSlice() []string
- func (c *CLIExecutor) GetSSH() SSHStruct
- func (c *CLIExecutor) GetStatusCode() int
- func (c *CLIExecutor) GetTrimWhiteSpace() bool
- func (c *CLIExecutor) Gunzip(filePath string) error
- func (c *CLIExecutor) Gzip(filePath string) error
- func (c *CLIExecutor) HasSSH() bool
- func (c *CLIExecutor) HashFile(fileName string) string
- func (c *CLIExecutor) InsecureMode() CLIExecutorIface
- func (c *CLIExecutor) InstallPublicKeyFileToRemote(publicKeyFile string) error
- func (c *CLIExecutor) InstallPublicKeyToRemote(publicKey string) error
- func (c *CLIExecutor) IsPortOpen() bool
- func (c *CLIExecutor) IsThisPortOpenIPV4(ip string, port int) CLIExecutorIface
- func (c *CLIExecutor) NormalizeName(fuzzy string) error
- func (exe *CLIExecutor) ProcAlive(pid int) bool
- func (c *CLIExecutor) ReadStructFromJSONFile(path string, v interface{}) error
- func (exe *CLIExecutor) ResponseHasKeyword(keyword string) bool
- func (c *CLIExecutor) SSHKeyGen(keyFile string, bits int, passphrase string) CLIExecutorIface
- func (c *CLIExecutor) SecureMode() CLIExecutorIface
- func (exe *CLIExecutor) TailLog(logPath string) CLIExecutorIface
- func (c *CLIExecutor) TotalSpaceAvailable(filter string) error
- func (c *CLIExecutor) TotalSpaceUsed(filter string) error
- func (c *CLIExecutor) UploadFile(fromPath, toPath string) error
- func (exe *CLIExecutor) WaitForKeyword(keyword string, interval time.Duration) error
- func (exe *CLIExecutor) WaitForKeywordInLog(logPath, keyword string, interval time.Duration) error
- func (exe *CLIExecutor) WatchForProcessToDie(pid int, checkInterval time.Duration) error
- func (c *CLIExecutor) WithCaptureStderr(capture bool) CLIExecutorIface
- func (c *CLIExecutor) WithCaptureStdout(capture bool) CLIExecutorIface
- func (c *CLIExecutor) WithCommand(command string) CLIExecutorIface
- func (c *CLIExecutor) WithContext(ctx context.Context) CLIExecutorIface
- func (c *CLIExecutor) WithDirectory(directory string) CLIExecutorIface
- func (c *CLIExecutor) WithExitOneIsNotOK() CLIExecutorIface
- func (c *CLIExecutor) WithExitOneIsOK() CLIExecutorIface
- func (c *CLIExecutor) WithRequestPayload(payload string) CLIExecutorIface
- func (c *CLIExecutor) WithResponseBody(responseBody string) CLIExecutorIface
- func (c *CLIExecutor) WithSSH(host, key, user string) CLIExecutorIface
- func (c *CLIExecutor) WithSSHDebug(b bool) CLIExecutorIface
- func (c *CLIExecutor) WithSSHStruct(s SSHStruct) CLIExecutorIface
- func (c *CLIExecutor) WithSpinny(show bool) CLIExecutorIface
- func (c *CLIExecutor) WithStatusCode(statusCode int) CLIExecutorIface
- func (c *CLIExecutor) WithSubCommand(subcommand string) CLIExecutorIface
- func (c *CLIExecutor) WithSudo(s bool) CLIExecutorIface
- func (c *CLIExecutor) WithTimeout(timeout time.Duration) CLIExecutorIface
- func (c *CLIExecutor) WithTrimWhiteSpace(trim bool) CLIExecutorIface
- type CLIExecutorIface
- type CaptureType
- type CopyResult
- type CrossCopyModeType
- type DatabaseConfig
- type DatabaseStruct
- func (db *DatabaseStruct) Avg(sel string, where string) error
- func (db *DatabaseStruct) AvgPayload(c string, where string) string
- func (db *DatabaseStruct) CLItarget() string
- func (db *DatabaseStruct) Count(sel string, where string) error
- func (db *DatabaseStruct) CountPayload(c string, where string) string
- func (db *DatabaseStruct) Delete(where string) error
- func (db *DatabaseStruct) DeletePayload(where string) string
- func (db *DatabaseStruct) Execute() error
- func (db *DatabaseStruct) GetPayload() string
- func (db *DatabaseStruct) GetResult() string
- func (db *DatabaseStruct) GetResultAsJson() string
- func (db *DatabaseStruct) GetResultAsSlice() []string
- func (db *DatabaseStruct) GetResultFloat() float64
- func (db *DatabaseStruct) GetResultInt() int
- func (db *DatabaseStruct) GetResultInt64() int64
- func (db *DatabaseStruct) GetTable() string
- func (db *DatabaseStruct) Insert(values string) error
- func (db *DatabaseStruct) InsertPayload(values string) string
- func (db *DatabaseStruct) LoadConfig(filePath string) error
- func (db *DatabaseStruct) Query(query string) error
- func (db *DatabaseStruct) QueryPayload(sel string, where string) string
- func (db *DatabaseStruct) Sum(sel string, where string) error
- func (db *DatabaseStruct) SumPayload(c string, where string) string
- func (db *DatabaseStruct) Update(set string, where string) error
- func (db *DatabaseStruct) UpdatePayload(set string, where string) string
- func (db *DatabaseStruct) WithDbPath(path string) *DatabaseStruct
- func (db *DatabaseStruct) WithSSH(host string, key string) *DatabaseStruct
- func (db *DatabaseStruct) WithTable(table string) *DatabaseStruct
- type Diff
- type DiffType
- type EpochTime
- type ExecCallBackFunc
- type ExecStruct
- func (ex *ExecStruct) Execute() error
- func (ex *ExecStruct) ExecuteOLD() error
- func (ex *ExecStruct) ExecutePRE17Jan2025() error
- func (ex *ExecStruct) ExecuteSTILLBROKEN() error
- func (ex ExecStruct) GetBody() string
- func (ex ExecStruct) GetIface() interface{}
- func (ex ExecStruct) GetMainCli() string
- func (ex ExecStruct) GetRequest() string
- func (ex ExecStruct) GetSSH() SSHStruct
- func (ex ExecStruct) GetWatcherPayload() []byte
- func (ex *ExecStruct) Init() *ExecStruct
- func (ex ExecStruct) OkToSpin() bool
- func (ex ExecStruct) OkToWatch() bool
- func (ex *ExecStruct) WithCapture(c bool) *ExecStruct
- func (ex *ExecStruct) WithCaptureBoth() *ExecStruct
- func (ex *ExecStruct) WithDirectory(d string) *ExecStruct
- func (ex *ExecStruct) WithHintInterface(i interface{}) *ExecStruct
- func (ex *ExecStruct) WithMainCli(cli string) *ExecStruct
- func (ex *ExecStruct) WithMainExecFunc(cb ExecCallBackFunc, cli string) *ExecStruct
- func (ex *ExecStruct) WithProgressExecFunc(cb ProgressCallBackFunc) *ExecStruct
- func (ex *ExecStruct) WithRequest(r string) *ExecStruct
- func (ex *ExecStruct) WithSSH(ssh SSHStruct) *ExecStruct
- func (ex *ExecStruct) WithSpinny(b bool) *ExecStruct
- func (ex *ExecStruct) WithWatcherExecFunc(cb WatcherCallBackFunc, payload []byte) *ExecStruct
- type FilenameStruct
- func (fns FilenameStruct) GetBase() string
- func (fns FilenameStruct) GetExt() string
- func (fns FilenameStruct) GetFullName() string
- func (fns FilenameStruct) GetHasDate() bool
- func (fns FilenameStruct) GetModTime() string
- func (fns FilenameStruct) GetPath() string
- func (fns *FilenameStruct) GetStat() error
- func (fns *FilenameStruct) Parse(f string) error
- func (fns *FilenameStruct) SetBase(b string)
- func (fns *FilenameStruct) SetExt(e string)
- func (fns *FilenameStruct) SetFullName(f string)
- func (fns *FilenameStruct) SetHasDate(b bool)
- func (fns *FilenameStruct) SetModTime(mt string)
- func (fns *FilenameStruct) SetPath(p string)
- func (fns FilenameStruct) WithBase(b string) FilenameStruct
- func (fns FilenameStruct) WithExt(e string) FilenameStruct
- func (fns FilenameStruct) WithFullName(f string) FilenameStruct
- func (fns FilenameStruct) WithHasDate(b bool) FilenameStruct
- func (fns FilenameStruct) WithModTime(mt string) FilenameStruct
- func (fns FilenameStruct) WithPath(p string) FilenameStruct
- type HttpApiStruct
- func (has *HttpApiStruct) AcquireTokenFromPasscode(passcode string) error
- func (has HttpApiStruct) BuildCurlCLI(method string, uri string) string
- func (has *HttpApiStruct) GetForceLocal() bool
- func (has HttpApiStruct) GetHeader(n string) string
- func (has HttpApiStruct) GetHeaders() map[string]string
- func (has HttpApiStruct) GetPasscode() string
- func (has HttpApiStruct) GetPayload() []byte
- func (has HttpApiStruct) GetPort() int
- func (has HttpApiStruct) GetProtocol() string
- func (has HttpApiStruct) GetQueryParams() map[string]string
- func (has HttpApiStruct) GetQueryParamsAsCurlParams() string
- func (has HttpApiStruct) GetQueryParamsAsURI() string
- func (has HttpApiStruct) GetResponseBody() []byte
- func (has HttpApiStruct) GetSSH() SSHStruct
- func (has HttpApiStruct) GetSSHEnabled() bool
- func (has HttpApiStruct) GetStatusCode() int
- func (has HttpApiStruct) GetTimeout() int
- func (has HttpApiStruct) GetToken() string
- func (has *HttpApiStruct) HammerTest() error
- func (has HttpApiStruct) HasFqdn() bool
- func (has *HttpApiStruct) HasHeader(n string) bool
- func (has *HttpApiStruct) HttpApiCall(method string, uri string) error
- func (has HttpApiStruct) IsPayloadEmpty() bool
- func (has *HttpApiStruct) Load(filename string) error
- func (has *HttpApiStruct) ParseFromURL(urlStr string) (string, error)
- func (has *HttpApiStruct) SetAcceptHeader(v string)
- func (has *HttpApiStruct) SetAuthorizationHeader(v string)
- func (has *HttpApiStruct) SetContentTypeHeader(v string)
- func (has *HttpApiStruct) SetContentTypeHeaderJSON()
- func (has *HttpApiStruct) SetForceLocal(b bool)
- func (has *HttpApiStruct) SetFqdn(fqdn string)
- func (has *HttpApiStruct) SetHeader(n string, v string)
- func (has *HttpApiStruct) SetHeaders(h map[string]string)
- func (has *HttpApiStruct) SetPasscode(passcode string) *HttpApiStruct
- func (has *HttpApiStruct) SetPayload(p []byte)
- func (has *HttpApiStruct) SetPayloadAny(v any) error
- func (has *HttpApiStruct) SetPort(p int)
- func (has *HttpApiStruct) SetQueryPair(n string, v string)
- func (has *HttpApiStruct) SetQueryPairBool(n string, v bool)
- func (has *HttpApiStruct) SetQueryPairFloat(n string, v float64)
- func (has *HttpApiStruct) SetQueryPairInt(n string, v int)
- func (has *HttpApiStruct) SetQueryPairInt64(n string, v int64)
- func (has *HttpApiStruct) SetQueryParams(qp map[string]string)
- func (has *HttpApiStruct) SetQueryParamsByURI(uri string)
- func (has *HttpApiStruct) SetResponseBody(b []byte)
- func (has *HttpApiStruct) SetSSH(s SSHStruct)
- func (has *HttpApiStruct) SetStatusCode(s int)
- func (has *HttpApiStruct) SetTimeout(t int)
- func (has *HttpApiStruct) SetToken(t string)
- func (has HttpApiStruct) WithFqdn(fqdn string) HttpApiStruct
- func (has HttpApiStruct) WithHeaders(h map[string]string) HttpApiStruct
- func (has HttpApiStruct) WithPayload(p []byte) HttpApiStruct
- func (has HttpApiStruct) WithPayloadAny(v any) HttpApiStruct
- func (has HttpApiStruct) WithPort(p int) HttpApiStruct
- func (has HttpApiStruct) WithQueryParams(qp map[string]string) HttpApiStruct
- func (has HttpApiStruct) WithQueryParamsByURI(uri string) HttpApiStruct
- func (has HttpApiStruct) WithResponseBody(b []byte) HttpApiStruct
- func (has HttpApiStruct) WithSSH(s SSHStruct) HttpApiStruct
- func (has HttpApiStruct) WithStatusCode(s int) HttpApiStruct
- func (has HttpApiStruct) WithTimeout(t int) HttpApiStruct
- type HttpMethod
- type INodeType
- type JWTServer
- func (s *JWTServer) AddRoute(pattern string, handler http.HandlerFunc, protected bool, ...)
- func (s *JWTServer) JWTMiddleware(next http.HandlerFunc) http.HandlerFunc
- func (s *JWTServer) MiddleWareRequireRole(role string) Middleware
- func (s *JWTServer) NoopMiddleware() Middleware
- func (s *JWTServer) ServeStaticDirectory(pattern string, dir string)
- func (s *JWTServer) ServeStaticFile(pattern string, fileName string)
- func (s *JWTServer) Start() error
- type JwtClaims
- type JwtCredentials
- type JwtHttpsServerStruct
- func (jhs *JwtHttpsServerStruct) AcquireKey(f string)
- func (jhs *JwtHttpsServerStruct) AuthMiddleware(next http.HandlerFunc) http.HandlerFunc
- func (jhs JwtHttpsServerStruct) GetCertFiles() (string, string)
- func (jhs JwtHttpsServerStruct) GetKey() []byte
- func (jhs JwtHttpsServerStruct) GetPort() int
- func (jhs JwtHttpsServerStruct) GetStaticDirRoute() string
- func (jhs *JwtHttpsServerStruct) Init(port int)
- func (jhs JwtHttpsServerStruct) RouteExists(r string) bool
- func (jhs *JwtHttpsServerStruct) SetCertFiles(priv, pub string)
- func (jhs *JwtHttpsServerStruct) SetKey(k []byte)
- func (jhs *JwtHttpsServerStruct) SetPort(p int)
- func (jhs *JwtHttpsServerStruct) SetStaticDirRoute(dir string)
- func (jhs *JwtHttpsServerStruct) SetupStaticRoutes(index string)
- func (jhs *JwtHttpsServerStruct) StartServer() error
- func (jhs *JwtHttpsServerStruct) UpdateClaims(username string, w http.ResponseWriter)
- func (jhs JwtHttpsServerStruct) ValidateBearerToken(w http.ResponseWriter, r *http.Request) bool
- func (jhs JwtHttpsServerStruct) WithKey(k []byte) JwtHttpsServerStruct
- func (jhs JwtHttpsServerStruct) WithPort(p int) JwtHttpsServerStruct
- func (jhs JwtHttpsServerStruct) WithStaticDirRoute(dir string) JwtHttpsServerStruct
- type LoginResponse
- type MPUUpload
- type MemoryManagementOptions
- func (options *MemoryManagementOptions) WithDefaultLogger() *MemoryManagementOptions
- func (options *MemoryManagementOptions) WithForceGC(forceGC bool) *MemoryManagementOptions
- func (options *MemoryManagementOptions) WithInterval(interval time.Duration) *MemoryManagementOptions
- func (options *MemoryManagementOptions) WithLogger(logger *log.Logger) *MemoryManagementOptions
- func (options *MemoryManagementOptions) WithMemoryThreshold(threshold uint64) *MemoryManagementOptions
- type MemoryManager
- type MemoryStats
- type Middleware
- type MigrationMgrStruct
- func (mgr *MigrationMgrStruct) CopyObjectBetweenBucketsMPU() error
- func (mgr *MigrationMgrStruct) CopyObjectBetweenBucketsRegular() error
- func (mgr *MigrationMgrStruct) DeepCopy() *MigrationMgrStruct
- func (mgr *MigrationMgrStruct) IsDone() bool
- func (mgr *MigrationMgrStruct) Lock()
- func (mgr *MigrationMgrStruct) MigrateObject(size int64) error
- func (mgr *MigrationMgrStruct) MigrationBatch(keys []string, wg *sync.WaitGroup, ResultsChan *chan CopyResult) error
- func (mgr *MigrationMgrStruct) MigrationLoop(wg *sync.WaitGroup, ResultsChan *chan CopyResult) error
- func (mgr *MigrationMgrStruct) Unlock()
- func (mgr *MigrationMgrStruct) WithUseSourceAsPrefixOnTarget(usePrefix bool) *MigrationMgrStruct
- type ObjectIter
- type ProcessInfo
- type ProgressCallBackFunc
- type ProgressReader
- type ProgressTracker
- type S3ClientSession
- func (s3c S3ClientSession) AbortMultipartUploads(uploads []MPUUpload, cutoff time.Duration) error
- func (s3c *S3ClientSession) AddLifecycleRule(newrule *s3.LifecycleRule) error
- func (s3c *S3ClientSession) AddLifecycleRuleCustomHeaders(newRule *s3.LifecycleRule, customHeaders map[string]string) error
- func (s3c *S3ClientSession) ClearEndpoint(sep string)
- func (sourceS3 *S3ClientSession) CopyAllObjectsBatch(targetS3 *S3ClientSession, progress *ProgressTracker, successLog *log.Logger, ...) error
- func (sourceS3 S3ClientSession) CopyAllObjectsDoNotUse(targetS3 *S3ClientSession, progress *ProgressTracker) error
- func (sourceS3 S3ClientSession) CopyObjectBetweenBuckets(targetS3 *S3ClientSession, sourceKey string, targetKey string, ...) error
- func (s3c *S3ClientSession) CreateBucket() error
- func (s3c S3ClientSession) CreateIncompleteMultipartUpload(key string, numParts int, partSize int64) (string, error)
- func (s3c *S3ClientSession) DeepCopy() S3ClientSession
- func (s3c *S3ClientSession) DeleteEntireBucketLifeCyclePolicy() error
- func (s3c S3ClientSession) DeleteObject(object string) error
- func (s3c S3ClientSession) DeleteObjectVersions(object string) error
- func (s3c *S3ClientSession) DoNotForceSSL()
- func (s3c *S3ClientSession) EnableLogging(l bool)
- func (s3c *S3ClientSession) EstablishSession() error
- func (s3c *S3ClientSession) ForceSSL()
- func (s3c *S3ClientSession) GenerateStaleMPUCleanUpRule(days int) s3.LifecycleRule
- func (s3c *S3ClientSession) GenerateTieringRule(days int) s3.LifecycleRule
- func (sourceS3 S3ClientSession) GetBucketACL() (string, error)
- func (s3c *S3ClientSession) GetBucketDefaultRetention() (*s3.DefaultRetention, error)
- func (s3c *S3ClientSession) GetBucketLifecycleRules() ([]*s3.LifecycleRule, error)
- func (s3c *S3ClientSession) GetBucketSummary(prefix string) (BucketSummary, error)
- func (s3c *S3ClientSession) GetBucketSummaryWithVersions(prefix string) (BucketSummary, error)
- func (s3c *S3ClientSession) GetConcurrency() int
- func (s3c *S3ClientSession) GetHashOfObjectRange(fromChunk int64, chunkSize int64) (string, error)
- func (s3c *S3ClientSession) GetObject() ([]byte, error)
- func (s3c *S3ClientSession) GetObjectHash() (string, error)
- func (s3c *S3ClientSession) GetObjectRetention(key, versionID string) (*s3.GetObjectRetentionOutput, error)
- func (s3c *S3ClientSession) GetS3Ptr() s3iface.S3API
- func (s3c *S3ClientSession) GetSession() *session.Session
- func (s3c *S3ClientSession) GetSizeOfObject() (int64, error)
- func (s3c S3ClientSession) GetSkipSize() int64
- func (s3c *S3ClientSession) GetURL() string
- func (this S3ClientSession) HeadBucket() (bool, error)
- func (s3c *S3ClientSession) HeadObject() (bool, error)
- func (s3c *S3ClientSession) IsObjectLockEnabled() error
- func (s3c *S3ClientSession) IsVersioningEnabled() error
- func (s3c S3ClientSession) KeepBucket() S3ClientSession
- func (s3c *S3ClientSession) ListBuckets() []string
- func (s3c S3ClientSession) ListBucketsOLD() []string
- func (s3c S3ClientSession) ListMultipartUploads() ([]MPUUpload, error)
- func (s3c S3ClientSession) ListObjectsWithSizeFilter(bucket string, sizeFilter int64) ([]S3Objects, error)
- func (s3c *S3ClientSession) Load(filename string) error
- func (s3c *S3ClientSession) LoadCredentials(f string) error
- func (s3c *S3ClientSession) LoadUserCredentialsForProfile() error
- func (s3c *S3ClientSession) ObjectExists() bool
- func (s3c *S3ClientSession) ParseFromURL(url string) error
- func (s3c *S3ClientSession) PresignedURL(expiredHours int) (string, error)
- func (s3c *S3ClientSession) PrintBucketSummary(prefix string, includeVersions bool) error
- func (s3c *S3ClientSession) PutLifecycleRules(rules []*s3.LifecycleRule) error
- func (s3c *S3ClientSession) PutLifecycleRulesCustomHeaders(rules []*s3.LifecycleRule, customHeaders map[string]string) error
- func (s3c *S3ClientSession) PutObjectLockConfigurationCompliance(retentionDays int64) error
- func (s3c *S3ClientSession) PutObjectLockConfigurationGovernance(retentionDays int64) error
- func (s3c *S3ClientSession) PutObjectRetentionComplianceDays(key, versionID string, days int) error
- func (s3c *S3ClientSession) PutObjectRetentionGovernanceDays(key, versionID string, days int) error
- func (s3c S3ClientSession) RecursiveBucketDelete() error
- func (s3c S3ClientSession) RecursiveBucketDeleteAlt() error
- func (s3c *S3ClientSession) RemoveBucket() error
- func (s3c *S3ClientSession) RemoveLifecycleRule(ruleID string) error
- func (s3c S3ClientSession) S3SyncDirectoryToBucket(dirPath string, progress *ProgressTracker) error
- func (s3c S3ClientSession) Save(filename string) error
- func (s3c *S3ClientSession) SetBucket(b string)
- func (sourceS3 S3ClientSession) SetBucketACL(aclJson string) error
- func (s3c *S3ClientSession) SetConcurrency(c int)
- func (s3c *S3ClientSession) SetRegion(r string)
- func (s3c *S3ClientSession) SetSession(s *session.Session)
- func (s3c *S3ClientSession) SetSkipSize(sz int64)
- func (this S3ClientSession) SetVersioning(v bool) S3ClientSession
- func (this S3ClientSession) Sync(localPath string) error
- func (this S3ClientSession) SyncInner(trimsz int, localPath string) error
- func (s3c *S3ClientSession) WithBucket(b string) *S3ClientSession
- func (s3c *S3ClientSession) WithCertificateEnforcement(enforce bool) *S3ClientSession
- func (s3c *S3ClientSession) WithCredentials(cred S3credStruct) *S3ClientSession
- func (s3c *S3ClientSession) WithEndpoint(sep string) *S3ClientSession
- func (s3c *S3ClientSession) WithRegion(r string) *S3ClientSession
- func (s3c S3ClientSession) WithSkipSize(sz int64) S3ClientSession
- type S3Iter
- type S3Objects
- type S3credStruct
- type SSHStruct
- func (s SSHStruct) BackgroundedRemoteExecute(cli string) (SSHStruct, error)
- func (s SSHStruct) ChangePassword(newPass string) error
- func (s SSHStruct) Chown(uid int, gid int, path string) error
- func (s *SSHStruct) CreateClientConfig() ssh.ClientConfig
- func (srcssh *SSHStruct) CrossCopy(srcFile string, tgtssh SSHStruct, tgtFile string) error
- func (srcssh *SSHStruct) CrossCopyCLI(srcFile string, tgtssh SSHStruct, tgtFile string) string
- func (s SSHStruct) DeepCopy() SSHStruct
- func (s SSHStruct) DownloadCLI(src string, tgt string) string
- func (s *SSHStruct) Execute(cli string) error
- func (s SSHStruct) GenerateRemoteGoBuildCLI(binary string) string
- func (s SSHStruct) GetBody() string
- func (s SSHStruct) GetBodyBytes() []byte
- func (s *SSHStruct) GetExitCode() int
- func (s *SSHStruct) GetLastModifiedTime(remoteFile string) (time.Time, error)
- func (s SSHStruct) GetRemoteDir() string
- func (s SSHStruct) GetRemoteFileHash(path string) (string, error)
- func (s *SSHStruct) GetRemoteFileSize(remoteFile string) (int64, error)
- func (s SSHStruct) GetRemoteHostname() (string, error)
- func (s SSHStruct) GetRequest() string
- func (s SSHStruct) GetSSHCli() string
- func (s SSHStruct) GetSSHOptionsAsString() string
- func (s SSHStruct) GetStderr() string
- func (s SSHStruct) GetStdout() string
- func (s SSHStruct) HammerTest() error
- func (s SSHStruct) IsUp() bool
- func (s *SSHStruct) Load(fileName string) error
- func (s SSHStruct) MkdirAll(dir string) error
- func (s SSHStruct) NotConfigured() bool
- func (s SSHStruct) RemoteCapturePid(jvm string, hint string) (int, error)
- func (s *SSHStruct) RemoteExecuteAndSpin(cli string) error
- func (ssh SSHStruct) RemoteFileCount(sdirectoryPath string, prefix string, glob string) (int, error)
- func (s SSHStruct) RemoteFileExists(path string) bool
- func (ssh SSHStruct) RemoteFindFiles(sdirectoryPath string, prefix string, glob string) ([]string, error)
- func (s SSHStruct) RemoteGetArgsFromPid(pid int) ([]string, error)
- func (s *SSHStruct) RemoteGetRelease() int
- func (s SSHStruct) RemoteGetThreadCount(pid int) (int, error)
- func (s *SSHStruct) RemoteGetVersion() string
- func (s *SSHStruct) RemoteGit(gitargs string) string
- func (s *SSHStruct) RemoteGitBranch() string
- func (s *SSHStruct) RemoteGitRev() string
- func (s *SSHStruct) RemoteJPS() ([]string, error)
- func (s *SSHStruct) RemotePopenGrep(cli string, musthave string, mustnothave string) ([]string, error)
- func (s *SSHStruct) RemoteReadFile(f string) error
- func (ssh SSHStruct) RemoteRemoveFiles(sdirectoryPath string, prefix string, glob string) error
- func (s *SSHStruct) RemoteTail(file string, lines int) ([]string, error)
- func (s *SSHStruct) RemoveDirAndContent(d string) error
- func (ssh SSHStruct) RemoveRemoteDir(dir string) error
- func (ssh SSHStruct) RemoveRemoteFile(file string) error
- func (ssh SSHStruct) RenameRemoteFile(oldfile string, newfile string) error
- func (s SSHStruct) ReportHammerResults(results []bool, e error) error
- func (s *SSHStruct) Rsync(source string, target string) error
- func (s *SSHStruct) RsyncWithSwitches(switches string, source string, target string) error
- func (s SSHStruct) SecureDownload(remoteFilePath string, localFilePath string) errordeprecated
- func (s SSHStruct) SecureDownloadAndSpin(remoteFilePath string, localFilePath string) errordeprecated
- func (s *SSHStruct) SecureRemoteExecution(cli string) error
- func (s *SSHStruct) SecureRemotePipeExecution(content []byte, cli string) error
- func (s SSHStruct) SecureUpload(localFilePath string, remoteFilePath string) errordeprecated
- func (s SSHStruct) SecureUploadAndSpin(localFilePath string, remoteFilePath string) error
- func (s *SSHStruct) SecureUploadContent(content []byte, remoteFilePath string) error
- func (s *SSHStruct) SecureUploadContent2(content []byte, remoteFilePath string) error
- func (s *SSHStruct) SetCapture(c bool) SSHStruct
- func (ssh *SSHStruct) SetDefaults()
- func (s *SSHStruct) SetHost(h string) SSHStruct
- func (s *SSHStruct) SetRemoteDir(r string) SSHStruct
- func (s *SSHStruct) SetRequest(r string)
- func (s *SSHStruct) SyncFileWithRemote(localFile string, remoteFile string, hashValidation bool, ...) error
- func (this SSHStruct) UploadCLI(src string, tgt string) string
- func (s SSHStruct) WithCapture(c bool) SSHStruct
- func (s SSHStruct) WithHost(h string) SSHStruct
- func (s SSHStruct) WithKey(k string) SSHStruct
- func (s SSHStruct) WithRemoteDir(rd string) SSHStruct
- func (s SSHStruct) WithRequest(r string) SSHStruct
- func (s SSHStruct) WithSilent(c bool) SSHStruct
- func (s SSHStruct) WithUser(u string) SSHStruct
- func (s SSHStruct) WriteSparseFile(f string, sizeMin int, sizeMax int, r int) error
- type ServerBuilder
- func (b *ServerBuilder) Build() *JWTServer
- func (b *ServerBuilder) WithAddress(addr string, port int) *ServerBuilder
- func (b *ServerBuilder) WithCertificateFiles(cert, key string) *ServerBuilder
- func (b *ServerBuilder) WithJWTKey(keyPath string) *ServerBuilder
- func (b *ServerBuilder) WithLogger(logger *log.Logger) *ServerBuilder
- func (b *ServerBuilder) WithPasscode(passcode string) *ServerBuilder
- func (b *ServerBuilder) WithSSL(cert, key string) *ServerBuilder
- func (b *ServerBuilder) WithStaticDir(dir string) *ServerBuilder
- func (b *ServerBuilder) WithTokenTTL(minutes int) *ServerBuilder
- type ServerConfig
- type TaskStatusType
- type TaskStruct
- type TokenType
- type WatcherCallBackFunc
- type WebHookStruct
Constants ¶
const ( ALFREDO_VERSION = "5Apr2024 - 2000" NOT_AVAILABLE = "N/A" VERBOSE_ENV = "VERBOSE" )
const ( OneKiB = 1 << 10 // 1024 bytes OneMiB = 1 << 20 // 1,048,576 bytes OneGiB = 1 << 30 // 1,073,741,824 bytes OneTiB = 1 << 40 // 1,099,511,627,776 bytes )
const ( HEADER_AUTHORIZATION = "Authorization" HEADER_CONTENT_TYPE = "Content-Type" HEADER_ACCEPT = "Accept" CONTENT_TYPE_JSON = "application/json" )
const ( DefaultUserCredsConfig = "usercreds.conf" ContentType = "Content-Type" ApplicationJson = "application/json" LoginRoute = "/login" LogoutRoute = "/logout" StaticRoute = "/*" //StaticDirRoute = "./static" ExpireTime = 120 //expire JWT token in 120 minutes )
const ( VERSION_FILE = "VERSION" RELEASE_FILE = "RELEASE" )
const ( ColorReset = 0 ColorRed = 31 ColorGreen = 32 ColorYellow = 33 ColorBlue = 34 ColorPurple = 35 ColorCyan = 36 ColorWhite = 37 )
const DefaultExeTimeout = 5 * time.Second
const S3_default_credentials_file = "~/.aws/credentials"
const (
SSH_DEFAULT_KEY = "~/.ssh/id_rsa"
)
const (
TIME_FORMAT_1 = "02Jan06-03:04PM"
)
Variables ¶
var GitBranch string
var GitProduction string
var GitRevision string
GitBranch will be injected with the current git branch name
var GitTimestamp string
var GitVersion string
Functions ¶
func AppendStringToFile ¶ added in v0.1.2
func BuildVersion ¶ added in v0.1.2
func BuildVersion() string
func BuildVersionWithMainBranch ¶ added in v0.5.0
func CSVtoArray ¶
func CalculateETARaw ¶ added in v0.5.0
func CalculatePartSize ¶ added in v0.4.1
func CalculateRateOfChange ¶ added in v0.5.0
func CalculateTotalParts ¶ added in v0.4.1
func Chain ¶ added in v0.5.3
func Chain(handler http.HandlerFunc, middlewares ...Middleware) http.HandlerFunc
func CheckOpenPortIPV4 ¶ added in v0.5.0
func CheckOpenPortIPV6 ¶ added in v0.5.0
func CheckSpaceForPath ¶ added in v0.7.0
CheckSpaceForPath checks whether the effective filesystem for bindPath (falling back to rootPath when they are the same FS) has at least thresholdBytes of free space.
func CheckSpaceForPathUpToOneGiB ¶ added in v0.7.0
func CheckSpaceForPathUpToOneTiB ¶ added in v0.7.0
func CommentPrintf ¶ added in v0.1.2
func CommentPrintln ¶ added in v0.1.2
func CommentPrintln(cmd string)
func CompareMaps ¶ added in v0.4.0
func CompareS3ObjectLists ¶ added in v0.5.0
func Concurrent ¶ added in v0.4.0
Concurrent executes the given function `f` concurrently `x` times and returns the results
func ContentTypeJSON ¶ added in v0.4.0
func CountObjectsAndSize ¶ added in v0.5.3
Alternative: If you already have pagination logic, here's a simple counter approach
func CountVersionsAndSize ¶ added in v0.5.3
func CountVersionsAndSize(versions []*s3.ObjectVersion, deleteMarkers []*s3.DeleteMarkerEntry) (int64, int64)
For object versions
func CreateGrant ¶ added in v0.4.2
func DDHumanReadableStorageSize ¶ added in v0.4.5
func DaysUntilExpiration ¶ added in v0.7.0
func DbSelfTest ¶ added in v0.5.0
func DebugPrintf ¶ added in v0.1.2
func DebugPrintln ¶ added in v0.1.2
func DebugPrintln(cmd string)
func DeepCopyStringToPointer ¶ added in v0.4.2
func DiffSlices ¶ added in v0.7.0
DiffSlices compares two string slices and returns a diff similar to "diff -rbB". Lines from 'a' are prefixed with "< ", lines from 'b' with "> ". Blank lines are ignored in comparison (like -B flag).
func DiffStringBlobs ¶ added in v0.5.0
func DiffStringContainers ¶ added in v0.5.0
func DiffStrings ¶ added in v0.7.0
func DiskDuplicatorArgs ¶ added in v0.4.5
func DmidecodeProduct ¶
func EasyBoolErrIsFalse ¶ added in v0.5.0
func EatErrorAndReturnInt ¶ added in v0.5.3
func EatErrorReturnBytes ¶ added in v0.7.0
func EatErrorReturnString ¶ added in v0.4.1
func EmptyString ¶
func Error2ExitCode ¶
func ExecToFile ¶
func ExecToFileAndSpin ¶ added in v0.5.0
func ExpandTilde ¶ added in v0.1.3
func FileAuthenticate ¶ added in v0.4.0
func FileAuthenticatePasscode ¶ added in v0.5.0
func FileBaseContainsDate ¶ added in v0.4.0
FileBaseContainsDate : f contains a date
func FileExists ¶
func FileExistsEasy ¶
func FormatBytes ¶ added in v0.5.3
FormatBytes converts bytes to human-readable format matching AWS CLI
func GenerateJWTKey ¶ added in v0.4.0
func GenerateJWTKey() string
func GenerateMoveCLI ¶ added in v0.4.0
func GenerateRandomAlphanumString ¶ added in v0.1.3
func GenerateSignature ¶ added in v0.1.2
func GetArgsFromPid ¶ added in v0.1.3
func GetBaseName ¶ added in v0.1.3
func GetClassName ¶ added in v0.1.3
func GetClassNameLastSegment ¶ added in v0.1.3
getLastSegment returns the last segment of a dot-separated class name
func GetExperimental ¶ added in v0.1.3
func GetExperimental() bool
func GetFileFindCLI ¶ added in v0.1.2
func GetFileSize ¶ added in v0.7.0
func GetFileSizeEasy ¶ added in v0.7.0
func GetFindFileCLI ¶ added in v0.1.3
func GetFirstFile ¶
func GetFirstLineFromFile ¶ added in v0.1.3
func GetFirstLineFromSlice ¶ added in v0.1.3
func GetFirstOfMonthTimestamp ¶ added in v0.4.4
func GetFirstOfMonthTimestamp() string
func GetFormattedTime ¶ added in v0.1.3
func GetFormattedTime1 ¶ added in v0.1.3
func GetFormattedTime1() string
func GetLastModifiedTime ¶ added in v0.5.0
should stat the file and return the last modified time
func GetNewFilenameWithDateStamp ¶ added in v0.7.0
func GetNewFilenameWithDateStampEasy ¶ added in v0.7.0
func GetOutboundIP ¶ added in v0.4.0
func GetOutboundIP() string
func GetPassCode ¶ added in v0.4.4
func GetPrivateSSHKey ¶
func GetPrivateSSHKey() string
func GetProcessList ¶ added in v0.4.3
func GetRandomInt64InRange ¶ added in v0.5.0
func GetShortHostName ¶ added in v0.7.0
func GetStringListFromJPS ¶ added in v0.1.3
func GetStringListFromJPS(jlist []jpsProcStruct) []string
func GetThreadCount ¶ added in v0.1.3
func GetTopLevelDir ¶ added in v0.5.3
func GetTopLevelDir() string
func GetVerbose ¶ added in v0.1.2
func GetVerbose() bool
func GoFuncAndSpin ¶ added in v0.4.5
func GoFuncAndSpin(cb interface{}, params ...interface{}) error
func Gunzip ¶
Untar takes a destination path and a reader; a tar reader loops over the tarfile creating the file structure at 'dst' along the way, and writing any files
func HumanReadableBigNumber ¶
func HumanReadableSeconds ¶
func HumanReadableTimeStamp ¶ added in v0.5.0
func IsCgoEnabled ¶ added in v0.4.0
func IsCgoEnabled() bool
func IsIPAddress ¶ added in v0.5.3
func IsTokenExpired ¶ added in v0.5.3
IsTokenExpired checks if a JWT token has expired on the client side Returns true if the token is expired, false if still valid, and error if token is malformed
func IsTokenExpiredEasy ¶ added in v0.5.3
func JPSStructListToIntList ¶ added in v0.1.3
func JsonDeepCopy ¶ added in v0.5.0
func JsonDeepCopy(input interface{}) (interface{}, error)
func LoadCredFileMap ¶ added in v0.4.0
func LoadFileIntoSlice ¶
load a file with lines that \n terminated into a slice (used by the syslog self-test)
func LocalExecuteAndSpin ¶ added in v0.1.3
func MD5SumFile ¶ added in v0.4.1
func MD5SumString ¶ added in v0.1.3
func MD5sumChunk ¶
work in progress; want to return string of hash for a partial file
func MD5sumFile ¶
func MapToSlice ¶ added in v0.7.0
func MapToTableSlice ¶ added in v0.4.1
func MapToTableSliceOrdered ¶ added in v0.4.1
func NotBlankIsMasked ¶ added in v0.1.2
func OccurredXDaysAgo ¶ added in v0.7.0
func PanicError ¶ added in v0.1.2
func ParseCustomTimestamp ¶ added in v0.7.0
func ParseKeyList ¶ added in v0.4.5
func ParseThreadCount ¶ added in v0.1.3
func Popen3Grep ¶
func Popen3Grep2 ¶ added in v0.4.3
func Popen3GrepFast ¶
func PopentoString ¶
func PrettyPrintJSONFile ¶ added in v0.1.2
func PrettyPrintJSONFile(filePath string)
func PrintSortedMap ¶ added in v0.4.0
func PrintSortedMap[K comparable, V any](m map[K]V)
func PromptPasscode ¶ added in v0.7.0
func ReadStructFromCommand ¶
func ReadStructFromJSONFile ¶
simply reads JSON data from a file and populates the provided structure.
func ReadStructFromString ¶
func RecursiveDelete ¶
func ReduceToBlockSize ¶ added in v0.4.5
func RemoveFile ¶
func RemoveFiles ¶ added in v0.1.2
func RemoveGlob ¶
func RemoveKeyPartialFromSlice ¶ added in v0.5.0
func RunJPSExample ¶ added in v0.5.0
func RunJPSExample()
func RunVerification ¶ added in v0.7.0
func RunVerification(srcs3c, tgts3c *S3ClientSession, UseSourceAsPrefixOnTarget bool, out io.Writer) error
func S3HelperScript ¶ added in v0.1.2
func S3HelperScriptBuiltInCreds ¶ added in v0.4.0
func S3HelperScriptBuiltInCredsCreateBucket ¶ added in v0.4.0
func S3HelperScriptBuiltInCredsDeepClean ¶ added in v0.5.0
func S3HelperScriptBuiltInCredsDeepCleanCommon ¶ added in v0.5.0
func S3HelperScriptDeepClean ¶ added in v0.5.0
func S3ObjectListToMap ¶ added in v0.5.0
func SecondsToTimestamp ¶ added in v0.5.0
func SetEnvironment ¶
func SetExperimental ¶ added in v0.1.3
func SetExperimental(e bool)
func SetPrivateSSHKey ¶
func SetPrivateSSHKey(newkey string)
func SetStringIfNotSet ¶ added in v0.1.2
func SetVerbose ¶
func SetVerbose(v bool)
func SliceContains ¶
func SliceToDoc ¶ added in v0.4.4
func SlicetoJPSStruct ¶ added in v0.1.3
func StringColor ¶ added in v0.8.0
func StringContainsInCSV ¶ added in v0.4.4
func StringToFileOverSSH ¶
write otuput content (including new lines) to file outputfile (including full absolute path) on remoteserver over SSH
func StripProtocol ¶ added in v0.7.0
func SummarizeField ¶ added in v0.7.0
func System3toCapturedString ¶ added in v0.1.2
func Tail ¶ added in v0.4.1
Tail reads the last numLines from the file, ignoring Java stack trace lines.
func TestEndpoint ¶ added in v0.4.0
func TranslateSimilarStructure ¶ added in v0.4.2
func TranslateSimilarStructure(input interface{}, output *interface{}) error
func TrimQuotes ¶
func TrimSuffix ¶
func TrimTrailingEmptyLines ¶ added in v0.5.0
func UniqTagSet ¶ added in v0.1.2
func Untar ¶
Untar takes a destination path and a reader; a tar reader loops over the tarfile creating the file structure at 'dst' along the way, and writing any files
func Unzip ¶
func Unzip(destination string, r *zip.ReadCloser) error
Untar takes a destination path and a reader; a tar reader loops over the tarfile creating the file structure at 'dst' along the way, and writing any files
func VerbosePrintf ¶ added in v0.1.2
func VerbosePrintln ¶
func VerbosePrintln(cmd string)
for debugging purposes, a more verbose output to catch attention
func WillOccurYDaysFromNow ¶ added in v0.7.0
func WriteLineToFile ¶ added in v0.5.0
func WriteSliceToFile ¶
func WriteSparseFile ¶
write a sparse file f of size, randomly between sizeMin and sizeMax, r random 1's in the 0's. Seek for 0's
func WriteStringToFile ¶
func WriteStructToJSONFile ¶
simply write a data interface to a json file; shamelessly picked off the internet
func WriteStructToJSONFilePP ¶ added in v0.1.2
simply write a data interface to a json file; shamelessly picked off the internet
func YoungestFileTime ¶ added in v0.1.2
func YoungestFileTime() string
Types ¶
type AWSProfile ¶ added in v0.1.3
type BoolMapContainer ¶ added in v0.4.0
type BoolMapContainer struct {
// contains filtered or unexported fields
}
func (*BoolMapContainer) Disable ¶ added in v0.4.0
func (m *BoolMapContainer) Disable(key string)
func (*BoolMapContainer) DisableItems ¶ added in v0.4.0
func (m *BoolMapContainer) DisableItems(itemsCSV string)
func (*BoolMapContainer) Enable ¶ added in v0.4.0
func (m *BoolMapContainer) Enable(key string)
func (*BoolMapContainer) EnableItems ¶ added in v0.4.0
func (m *BoolMapContainer) EnableItems(itemsCSV string)
func (*BoolMapContainer) FromCSV ¶ added in v0.4.0
func (m *BoolMapContainer) FromCSV(itemsCSV string, s bool)
func (BoolMapContainer) IsEnabled ¶ added in v0.4.0
func (m BoolMapContainer) IsEnabled(key string) bool
func (BoolMapContainer) ToCSV ¶ added in v0.4.0
func (m BoolMapContainer) ToCSV() string
func (BoolMapContainer) ToSlice ¶ added in v0.4.0
func (m BoolMapContainer) ToSlice() []string
type BucketACLStruct ¶ added in v0.4.2
type BucketACLStruct struct {
Owner ownerBucketACLStruct `json:"Owner"`
Grants []grantBucketACLStruct `json:"Grants"`
}
func GenerateDefaultBucketPolicy ¶ added in v0.5.0
func GenerateDefaultBucketPolicy(existingAcl BucketACLStruct) BucketACLStruct
func GenerateROBucketPolicy ¶ added in v0.4.2
func GenerateROBucketPolicy(existingAcl BucketACLStruct) BucketACLStruct
type BucketSummary ¶ added in v0.5.3
BucketSummary holds the summary statistics
type CLIExecutor ¶ added in v0.4.4
type CLIExecutor struct {
// contains filtered or unexported fields
}
func NewCLIExecutor ¶ added in v0.4.4
func NewCLIExecutor() *CLIExecutor
func (*CLIExecutor) AsLongRunning ¶ added in v0.4.5
func (c *CLIExecutor) AsLongRunning() CLIExecutorIface
stick around for 100 days
func (*CLIExecutor) BackgroundCommand ¶ added in v0.7.0
func (exe *CLIExecutor) BackgroundCommand(outputFile string, countdown bool) int
func (*CLIExecutor) CaptureJavaProcessList ¶ added in v0.5.0
func (c *CLIExecutor) CaptureJavaProcessList(jvm string) error
use this instead of execute or local java processes
func (*CLIExecutor) CheckAndKillProcess ¶ added in v0.7.0
func (exe *CLIExecutor) CheckAndKillProcess(procName string) error
func (*CLIExecutor) CountDrivesOverThreshold ¶ added in v0.7.0
func (c *CLIExecutor) CountDrivesOverThreshold(threshold int, filter string, count *int) error
if err := exe.CountDrivesOverThreshold(threshold, filter, &count); err != nil {
func (*CLIExecutor) CreateDirectory ¶ added in v0.7.0
func (c *CLIExecutor) CreateDirectory(dir string, chown string) error
func (*CLIExecutor) CreateSymlink ¶ added in v0.5.0
func (c *CLIExecutor) CreateSymlink(fromFile, toLink string) error
func (*CLIExecutor) DownloadFile ¶ added in v0.8.0
func (c *CLIExecutor) DownloadFile(fromFile, toPath string) error
fromPath is remote toPath is assumed to be local how this works:
sudo copy file to ~/.tempdir/ on remote host use sudo to chown the file as the user download per usual remove evidence of temporary file
func (*CLIExecutor) DropSSH ¶ added in v0.7.0
func (c *CLIExecutor) DropSSH() CLIExecutorIface
func (*CLIExecutor) DumpOutput ¶ added in v0.5.0
func (c *CLIExecutor) DumpOutput() CLIExecutorIface
func (*CLIExecutor) Execute ¶ added in v0.4.4
func (c *CLIExecutor) Execute() error
func (*CLIExecutor) FileExists ¶ added in v0.8.0
func (c *CLIExecutor) FileExists(path string) bool
func (*CLIExecutor) FindFiles ¶ added in v0.8.0
func (c *CLIExecutor) FindFiles(path, prefix, suffix string) CLIExecutorIface
find /opt -iname "prefix*suffix""
func (*CLIExecutor) GetCli ¶ added in v0.4.4
func (c *CLIExecutor) GetCli() string
func (*CLIExecutor) GetCommand ¶ added in v0.5.0
func (c *CLIExecutor) GetCommand() string
func (*CLIExecutor) GetCommandWithSub ¶ added in v0.7.0
func (c *CLIExecutor) GetCommandWithSub() string
func (*CLIExecutor) GetDirectory ¶ added in v0.5.0
func (c *CLIExecutor) GetDirectory() string
func (*CLIExecutor) GetProcListFromResponseBody ¶ added in v0.5.0
func (c *CLIExecutor) GetProcListFromResponseBody() []ProcessInfo
func (*CLIExecutor) GetRequestPayload ¶ added in v0.5.0
func (c *CLIExecutor) GetRequestPayload() string
func (*CLIExecutor) GetResponseBody ¶ added in v0.4.4
func (c *CLIExecutor) GetResponseBody() string
func (*CLIExecutor) GetResponseBodyAsInt64 ¶ added in v0.7.0
func (c *CLIExecutor) GetResponseBodyAsInt64() int64
func (*CLIExecutor) GetResponseBodyAsSlice ¶ added in v0.7.0
func (c *CLIExecutor) GetResponseBodyAsSlice() []string
func (*CLIExecutor) GetSSH ¶ added in v0.5.0
func (c *CLIExecutor) GetSSH() SSHStruct
func (*CLIExecutor) GetStatusCode ¶ added in v0.4.4
func (c *CLIExecutor) GetStatusCode() int
func (*CLIExecutor) GetTrimWhiteSpace ¶ added in v0.4.4
func (c *CLIExecutor) GetTrimWhiteSpace() bool
func (*CLIExecutor) Gunzip ¶ added in v0.7.0
func (c *CLIExecutor) Gunzip(filePath string) error
func (*CLIExecutor) Gzip ¶ added in v0.7.0
func (c *CLIExecutor) Gzip(filePath string) error
func (*CLIExecutor) HasSSH ¶ added in v0.7.0
func (c *CLIExecutor) HasSSH() bool
func (*CLIExecutor) HashFile ¶ added in v0.5.0
func (c *CLIExecutor) HashFile(fileName string) string
func (*CLIExecutor) InsecureMode ¶ added in v0.7.0
func (c *CLIExecutor) InsecureMode() CLIExecutorIface
func (*CLIExecutor) InstallPublicKeyFileToRemote ¶ added in v0.7.0
func (c *CLIExecutor) InstallPublicKeyFileToRemote(publicKeyFile string) error
func (*CLIExecutor) InstallPublicKeyToRemote ¶ added in v0.7.0
func (c *CLIExecutor) InstallPublicKeyToRemote(publicKey string) error
func (*CLIExecutor) IsPortOpen ¶ added in v0.5.0
func (c *CLIExecutor) IsPortOpen() bool
func (*CLIExecutor) IsThisPortOpenIPV4 ¶ added in v0.5.0
func (c *CLIExecutor) IsThisPortOpenIPV4(ip string, port int) CLIExecutorIface
nc -zv 192.168.1.100 80 && echo "Port is open" || echo "Port is closed"
func (*CLIExecutor) NormalizeName ¶ added in v0.5.3
func (c *CLIExecutor) NormalizeName(fuzzy string) error
func (*CLIExecutor) ProcAlive ¶ added in v0.7.0
func (exe *CLIExecutor) ProcAlive(pid int) bool
func (*CLIExecutor) ReadStructFromJSONFile ¶ added in v0.8.0
func (c *CLIExecutor) ReadStructFromJSONFile(path string, v interface{}) error
func (*CLIExecutor) ResponseHasKeyword ¶ added in v0.7.0
func (exe *CLIExecutor) ResponseHasKeyword(keyword string) bool
func (*CLIExecutor) SSHKeyGen ¶ added in v0.7.0
func (c *CLIExecutor) SSHKeyGen(keyFile string, bits int, passphrase string) CLIExecutorIface
func (*CLIExecutor) SecureMode ¶ added in v0.7.0
func (c *CLIExecutor) SecureMode() CLIExecutorIface
func (*CLIExecutor) TailLog ¶ added in v0.7.0
func (exe *CLIExecutor) TailLog(logPath string) CLIExecutorIface
func (*CLIExecutor) TotalSpaceAvailable ¶ added in v0.7.0
func (c *CLIExecutor) TotalSpaceAvailable(filter string) error
func (*CLIExecutor) TotalSpaceUsed ¶ added in v0.7.0
func (c *CLIExecutor) TotalSpaceUsed(filter string) error
func (*CLIExecutor) UploadFile ¶ added in v0.8.0
func (c *CLIExecutor) UploadFile(fromPath, toPath string) error
fromPath is local toPath is assumed to be remote how this works: replace toPath with /home/USER/.tempdir/filename, then use sudo mv to move it to where it should go
func (*CLIExecutor) WaitForKeyword ¶ added in v0.7.0
func (exe *CLIExecutor) WaitForKeyword(keyword string, interval time.Duration) error
TailLogAndWaitForKeyword tails the last 10 lines of a log file over SSH until it finds the keyword or returns an error if execution fails.
func (*CLIExecutor) WaitForKeywordInLog ¶ added in v0.7.0
func (exe *CLIExecutor) WaitForKeywordInLog(logPath, keyword string, interval time.Duration) error
func (*CLIExecutor) WatchForProcessToDie ¶ added in v0.7.0
func (exe *CLIExecutor) WatchForProcessToDie(pid int, checkInterval time.Duration) error
func (*CLIExecutor) WithCaptureStderr ¶ added in v0.4.4
func (c *CLIExecutor) WithCaptureStderr(capture bool) CLIExecutorIface
func (*CLIExecutor) WithCaptureStdout ¶ added in v0.4.4
func (c *CLIExecutor) WithCaptureStdout(capture bool) CLIExecutorIface
func (*CLIExecutor) WithCommand ¶ added in v0.4.4
func (c *CLIExecutor) WithCommand(command string) CLIExecutorIface
func (*CLIExecutor) WithContext ¶ added in v0.7.0
func (c *CLIExecutor) WithContext(ctx context.Context) CLIExecutorIface
func (*CLIExecutor) WithDirectory ¶ added in v0.4.5
func (c *CLIExecutor) WithDirectory(directory string) CLIExecutorIface
func (*CLIExecutor) WithExitOneIsNotOK ¶ added in v0.5.0
func (c *CLIExecutor) WithExitOneIsNotOK() CLIExecutorIface
func (*CLIExecutor) WithExitOneIsOK ¶ added in v0.5.0
func (c *CLIExecutor) WithExitOneIsOK() CLIExecutorIface
func (*CLIExecutor) WithRequestPayload ¶ added in v0.4.4
func (c *CLIExecutor) WithRequestPayload(payload string) CLIExecutorIface
func (*CLIExecutor) WithResponseBody ¶ added in v0.4.4
func (c *CLIExecutor) WithResponseBody(responseBody string) CLIExecutorIface
func (*CLIExecutor) WithSSH ¶ added in v0.4.4
func (c *CLIExecutor) WithSSH(host, key, user string) CLIExecutorIface
func (*CLIExecutor) WithSSHDebug ¶ added in v0.5.0
func (c *CLIExecutor) WithSSHDebug(b bool) CLIExecutorIface
func (*CLIExecutor) WithSSHStruct ¶ added in v0.5.0
func (c *CLIExecutor) WithSSHStruct(s SSHStruct) CLIExecutorIface
func (*CLIExecutor) WithSpinny ¶ added in v0.4.4
func (c *CLIExecutor) WithSpinny(show bool) CLIExecutorIface
func (*CLIExecutor) WithStatusCode ¶ added in v0.4.4
func (c *CLIExecutor) WithStatusCode(statusCode int) CLIExecutorIface
func (*CLIExecutor) WithSubCommand ¶ added in v0.7.0
func (c *CLIExecutor) WithSubCommand(subcommand string) CLIExecutorIface
func (*CLIExecutor) WithSudo ¶ added in v0.7.0
func (c *CLIExecutor) WithSudo(s bool) CLIExecutorIface
func (*CLIExecutor) WithTimeout ¶ added in v0.4.4
func (c *CLIExecutor) WithTimeout(timeout time.Duration) CLIExecutorIface
func (*CLIExecutor) WithTrimWhiteSpace ¶ added in v0.4.4
func (c *CLIExecutor) WithTrimWhiteSpace(trim bool) CLIExecutorIface
type CLIExecutorIface ¶ added in v0.8.0
type CLIExecutorIface interface {
WithCommand(command string) CLIExecutorIface
WithSubCommand(subcommand string) CLIExecutorIface
WithRequestPayload(payload string) CLIExecutorIface
WithSSH(host, key, user string) CLIExecutorIface
WithSSHStruct(s SSHStruct) CLIExecutorIface
WithSSHDebug(b bool) CLIExecutorIface
WithContext(ctx context.Context) CLIExecutorIface
WithDirectory(directory string) CLIExecutorIface
WithExitOneIsOK() CLIExecutorIface
WithExitOneIsNotOK() CLIExecutorIface
WithTimeout(timeout time.Duration) CLIExecutorIface
WithSudo(s bool) CLIExecutorIface
WithCaptureStdout(capture bool) CLIExecutorIface
WithCaptureStderr(capture bool) CLIExecutorIface
WithSpinny(show bool) CLIExecutorIface
WithTrimWhiteSpace(trim bool) CLIExecutorIface
WithResponseBody(responseBody string) CLIExecutorIface
AsLongRunning() CLIExecutorIface
WaitForKeyword(keyword string, interval time.Duration) error
WaitForKeywordInLog(logPath string, keyword string, interval time.Duration) error
Execute() error
GetResponseBody() string
GetResponseBodyAsSlice() []string
GetResponseBodyAsInt64() int64
BackgroundCommand(logPath string, countdown bool) int
CaptureJavaProcessList(jvm string) error
GetProcListFromResponseBody() []ProcessInfo
GetStatusCode() int
GetCli() string
DumpOutput() CLIExecutorIface
HashFile(fileName string) string
TailLog(logPath string) CLIExecutorIface
NormalizeName(fuzzy string) error
GetSSH() SSHStruct
CheckAndKillProcess(procName string) error
GetCommand() string
CreateSymlink(fromFile, toLink string) error
IsThisPortOpenIPV4(ip string, port int) CLIExecutorIface
FindFiles(path, prefix, suffix string) CLIExecutorIface
ReadStructFromJSONFile(path string, v interface{}) error
FileExists(path string) bool
DropSSH() CLIExecutorIface
UploadFile(fromPath, toPath string) error
DownloadFile(fromPath, toPath string) error
}
type CaptureType ¶ added in v0.4.4
type CaptureType int
const ( CapNone CaptureType = iota CapBoth CapStdout CapStderr )
type CopyResult ¶ added in v0.4.0
type CopyResult struct {
SourceKey string
TargetKey string
Bucket string
Success bool
Error error
BytesCopied int64
Duration time.Duration
WasSkipped bool
}
func (*CopyResult) ProcessError ¶ added in v0.7.0
func (result *CopyResult) ProcessError(fl *log.Logger)
type CrossCopyModeType ¶ added in v0.1.3
type CrossCopyModeType int64
const ( CCMVIAMEMORY CrossCopyModeType = iota CCMVIASHELL CCMTEMPFILE )
func GetCCTypeOf ¶ added in v0.1.3
func GetCCTypeOf(cc string) CrossCopyModeType
func (CrossCopyModeType) String ¶ added in v0.1.3
func (cc CrossCopyModeType) String() string
type DatabaseConfig ¶ added in v0.4.4
type DatabaseStruct ¶ added in v0.4.4
type DatabaseStruct struct {
DbPath string `json:"db_path"`
Table string `json:"table"`
// contains filtered or unexported fields
}
func NewSQLiteDB ¶ added in v0.4.4
func NewSQLiteDB() *DatabaseStruct
func (*DatabaseStruct) Avg ¶ added in v0.4.4
func (db *DatabaseStruct) Avg(sel string, where string) error
func (*DatabaseStruct) AvgPayload ¶ added in v0.4.4
func (db *DatabaseStruct) AvgPayload(c string, where string) string
func (*DatabaseStruct) CLItarget ¶ added in v0.4.4
func (db *DatabaseStruct) CLItarget() string
func (*DatabaseStruct) Count ¶ added in v0.4.4
func (db *DatabaseStruct) Count(sel string, where string) error
func (*DatabaseStruct) CountPayload ¶ added in v0.4.4
func (db *DatabaseStruct) CountPayload(c string, where string) string
func (*DatabaseStruct) Delete ¶ added in v0.4.4
func (db *DatabaseStruct) Delete(where string) error
func (*DatabaseStruct) DeletePayload ¶ added in v0.4.4
func (db *DatabaseStruct) DeletePayload(where string) string
func (*DatabaseStruct) Execute ¶ added in v0.4.4
func (db *DatabaseStruct) Execute() error
func (*DatabaseStruct) GetPayload ¶ added in v0.5.0
func (db *DatabaseStruct) GetPayload() string
func (*DatabaseStruct) GetResult ¶ added in v0.4.4
func (db *DatabaseStruct) GetResult() string
func (*DatabaseStruct) GetResultAsJson ¶ added in v0.7.0
func (db *DatabaseStruct) GetResultAsJson() string
func (*DatabaseStruct) GetResultAsSlice ¶ added in v0.7.0
func (db *DatabaseStruct) GetResultAsSlice() []string
func (*DatabaseStruct) GetResultFloat ¶ added in v0.4.4
func (db *DatabaseStruct) GetResultFloat() float64
func (*DatabaseStruct) GetResultInt ¶ added in v0.4.4
func (db *DatabaseStruct) GetResultInt() int
func (*DatabaseStruct) GetResultInt64 ¶ added in v0.4.4
func (db *DatabaseStruct) GetResultInt64() int64
func (*DatabaseStruct) GetTable ¶ added in v0.7.0
func (db *DatabaseStruct) GetTable() string
func (*DatabaseStruct) Insert ¶ added in v0.7.0
func (db *DatabaseStruct) Insert(values string) error
func (*DatabaseStruct) InsertPayload ¶ added in v0.7.0
func (db *DatabaseStruct) InsertPayload(values string) string
func (*DatabaseStruct) LoadConfig ¶ added in v0.4.4
func (db *DatabaseStruct) LoadConfig(filePath string) error
func (*DatabaseStruct) Query ¶ added in v0.4.4
func (db *DatabaseStruct) Query(query string) error
func (*DatabaseStruct) QueryPayload ¶ added in v0.4.4
func (db *DatabaseStruct) QueryPayload(sel string, where string) string
func (*DatabaseStruct) Sum ¶ added in v0.4.4
func (db *DatabaseStruct) Sum(sel string, where string) error
func (*DatabaseStruct) SumPayload ¶ added in v0.4.4
func (db *DatabaseStruct) SumPayload(c string, where string) string
func (*DatabaseStruct) Update ¶ added in v0.4.4
func (db *DatabaseStruct) Update(set string, where string) error
func (*DatabaseStruct) UpdatePayload ¶ added in v0.4.4
func (db *DatabaseStruct) UpdatePayload(set string, where string) string
func (*DatabaseStruct) WithDbPath ¶ added in v0.4.4
func (db *DatabaseStruct) WithDbPath(path string) *DatabaseStruct
func (*DatabaseStruct) WithSSH ¶ added in v0.4.4
func (db *DatabaseStruct) WithSSH(host string, key string) *DatabaseStruct
func (*DatabaseStruct) WithTable ¶ added in v0.4.4
func (db *DatabaseStruct) WithTable(table string) *DatabaseStruct
type EpochTime ¶ added in v0.7.0
func EpochTimeFromTime ¶ added in v0.7.0
func (EpochTime) MarshalJSON ¶ added in v0.7.0
func (*EpochTime) UnmarshalJSON ¶ added in v0.7.0
type ExecCallBackFunc ¶ added in v0.1.2
type ExecStruct ¶ added in v0.1.2
type ExecStruct struct {
SpinSigChan chan bool
WatchSigChan chan bool
ErrChan chan error
// contains filtered or unexported fields
}
func (*ExecStruct) Execute ¶ added in v0.1.2
func (ex *ExecStruct) Execute() error
func (*ExecStruct) ExecuteOLD ¶ added in v0.4.4
func (ex *ExecStruct) ExecuteOLD() error
func (*ExecStruct) ExecutePRE17Jan2025 ¶ added in v0.4.4
func (ex *ExecStruct) ExecutePRE17Jan2025() error
func (*ExecStruct) ExecuteSTILLBROKEN ¶ added in v0.4.4
func (ex *ExecStruct) ExecuteSTILLBROKEN() error
func (ExecStruct) GetBody ¶ added in v0.1.2
func (ex ExecStruct) GetBody() string
func (ExecStruct) GetIface ¶ added in v0.1.2
func (ex ExecStruct) GetIface() interface{}
func (ExecStruct) GetMainCli ¶ added in v0.4.4
func (ex ExecStruct) GetMainCli() string
func (ExecStruct) GetRequest ¶ added in v0.4.4
func (ex ExecStruct) GetRequest() string
func (ExecStruct) GetSSH ¶ added in v0.4.4
func (ex ExecStruct) GetSSH() SSHStruct
func (ExecStruct) GetWatcherPayload ¶ added in v0.5.0
func (ex ExecStruct) GetWatcherPayload() []byte
func (*ExecStruct) Init ¶ added in v0.1.2
func (ex *ExecStruct) Init() *ExecStruct
func (ExecStruct) OkToSpin ¶ added in v0.1.2
func (ex ExecStruct) OkToSpin() bool
func (ExecStruct) OkToWatch ¶ added in v0.1.2
func (ex ExecStruct) OkToWatch() bool
func (*ExecStruct) WithCapture ¶ added in v0.1.2
func (ex *ExecStruct) WithCapture(c bool) *ExecStruct
func (*ExecStruct) WithCaptureBoth ¶ added in v0.4.4
func (ex *ExecStruct) WithCaptureBoth() *ExecStruct
func (*ExecStruct) WithDirectory ¶ added in v0.1.2
func (ex *ExecStruct) WithDirectory(d string) *ExecStruct
func (*ExecStruct) WithHintInterface ¶ added in v0.1.2
func (ex *ExecStruct) WithHintInterface(i interface{}) *ExecStruct
func (*ExecStruct) WithMainCli ¶ added in v0.4.4
func (ex *ExecStruct) WithMainCli(cli string) *ExecStruct
func (*ExecStruct) WithMainExecFunc ¶ added in v0.1.2
func (ex *ExecStruct) WithMainExecFunc(cb ExecCallBackFunc, cli string) *ExecStruct
func (*ExecStruct) WithProgressExecFunc ¶ added in v0.1.2
func (ex *ExecStruct) WithProgressExecFunc(cb ProgressCallBackFunc) *ExecStruct
func (*ExecStruct) WithRequest ¶ added in v0.4.4
func (ex *ExecStruct) WithRequest(r string) *ExecStruct
func (*ExecStruct) WithSSH ¶ added in v0.1.2
func (ex *ExecStruct) WithSSH(ssh SSHStruct) *ExecStruct
func (*ExecStruct) WithSpinny ¶ added in v0.1.2
func (ex *ExecStruct) WithSpinny(b bool) *ExecStruct
func (*ExecStruct) WithWatcherExecFunc ¶ added in v0.1.2
func (ex *ExecStruct) WithWatcherExecFunc(cb WatcherCallBackFunc, payload []byte) *ExecStruct
type FilenameStruct ¶ added in v0.1.2
type FilenameStruct struct {
// contains filtered or unexported fields
}
func GenerateFilename ¶ added in v0.4.0
func GenerateFilename(f string, suffix string) FilenameStruct
func (FilenameStruct) GetBase ¶ added in v0.1.2
func (fns FilenameStruct) GetBase() string
func (FilenameStruct) GetExt ¶ added in v0.1.2
func (fns FilenameStruct) GetExt() string
func (FilenameStruct) GetFullName ¶ added in v0.1.2
func (fns FilenameStruct) GetFullName() string
func (FilenameStruct) GetHasDate ¶ added in v0.1.2
func (fns FilenameStruct) GetHasDate() bool
func (FilenameStruct) GetModTime ¶ added in v0.1.2
func (fns FilenameStruct) GetModTime() string
func (FilenameStruct) GetPath ¶ added in v0.1.2
func (fns FilenameStruct) GetPath() string
func (*FilenameStruct) GetStat ¶ added in v0.1.2
func (fns *FilenameStruct) GetStat() error
func (*FilenameStruct) Parse ¶ added in v0.1.2
func (fns *FilenameStruct) Parse(f string) error
func (*FilenameStruct) SetBase ¶ added in v0.1.2
func (fns *FilenameStruct) SetBase(b string)
func (*FilenameStruct) SetExt ¶ added in v0.1.2
func (fns *FilenameStruct) SetExt(e string)
func (*FilenameStruct) SetFullName ¶ added in v0.1.2
func (fns *FilenameStruct) SetFullName(f string)
func (*FilenameStruct) SetHasDate ¶ added in v0.1.2
func (fns *FilenameStruct) SetHasDate(b bool)
func (*FilenameStruct) SetModTime ¶ added in v0.1.2
func (fns *FilenameStruct) SetModTime(mt string)
func (*FilenameStruct) SetPath ¶ added in v0.1.2
func (fns *FilenameStruct) SetPath(p string)
func (FilenameStruct) WithBase ¶ added in v0.1.2
func (fns FilenameStruct) WithBase(b string) FilenameStruct
func (FilenameStruct) WithExt ¶ added in v0.1.2
func (fns FilenameStruct) WithExt(e string) FilenameStruct
func (FilenameStruct) WithFullName ¶ added in v0.1.2
func (fns FilenameStruct) WithFullName(f string) FilenameStruct
func (FilenameStruct) WithHasDate ¶ added in v0.1.2
func (fns FilenameStruct) WithHasDate(b bool) FilenameStruct
func (FilenameStruct) WithModTime ¶ added in v0.1.2
func (fns FilenameStruct) WithModTime(mt string) FilenameStruct
func (FilenameStruct) WithPath ¶ added in v0.1.2
func (fns FilenameStruct) WithPath(p string) FilenameStruct
type HttpApiStruct ¶ added in v0.4.4
type HttpApiStruct struct {
UserName string `json:"userName"`
Password string `json:"password"`
Fqdn string `json:"fqdn"`
Timeout int `json:"timeout"`
QueryParams map[string]string `json:"queryParams"`
Headers map[string]string `json:"headers"`
Secure bool `json:"secure"`
Port int `json:"port"`
IgnoreConflict bool `json:"ignoreConflict"`
Passcode string `json:"passcode"`
// contains filtered or unexported fields
}
func (*HttpApiStruct) AcquireTokenFromPasscode ¶ added in v0.4.4
func (has *HttpApiStruct) AcquireTokenFromPasscode(passcode string) error
func (HttpApiStruct) BuildCurlCLI ¶ added in v0.4.4
func (has HttpApiStruct) BuildCurlCLI(method string, uri string) string
func (*HttpApiStruct) GetForceLocal ¶ added in v0.4.4
func (has *HttpApiStruct) GetForceLocal() bool
func (HttpApiStruct) GetHeader ¶ added in v0.4.4
func (has HttpApiStruct) GetHeader(n string) string
func (HttpApiStruct) GetHeaders ¶ added in v0.4.4
func (has HttpApiStruct) GetHeaders() map[string]string
func (HttpApiStruct) GetPasscode ¶ added in v0.5.3
func (has HttpApiStruct) GetPasscode() string
func (HttpApiStruct) GetPayload ¶ added in v0.4.4
func (has HttpApiStruct) GetPayload() []byte
func (HttpApiStruct) GetPort ¶ added in v0.4.4
func (has HttpApiStruct) GetPort() int
func (HttpApiStruct) GetProtocol ¶ added in v0.4.4
func (has HttpApiStruct) GetProtocol() string
func (HttpApiStruct) GetQueryParams ¶ added in v0.4.4
func (has HttpApiStruct) GetQueryParams() map[string]string
func (HttpApiStruct) GetQueryParamsAsCurlParams ¶ added in v0.4.4
func (has HttpApiStruct) GetQueryParamsAsCurlParams() string
func (HttpApiStruct) GetQueryParamsAsURI ¶ added in v0.4.4
func (has HttpApiStruct) GetQueryParamsAsURI() string
func (HttpApiStruct) GetResponseBody ¶ added in v0.4.4
func (has HttpApiStruct) GetResponseBody() []byte
func (HttpApiStruct) GetSSH ¶ added in v0.4.4
func (has HttpApiStruct) GetSSH() SSHStruct
func (HttpApiStruct) GetSSHEnabled ¶ added in v0.4.4
func (has HttpApiStruct) GetSSHEnabled() bool
func (HttpApiStruct) GetStatusCode ¶ added in v0.4.4
func (has HttpApiStruct) GetStatusCode() int
func (HttpApiStruct) GetTimeout ¶ added in v0.4.4
func (has HttpApiStruct) GetTimeout() int
func (HttpApiStruct) GetToken ¶ added in v0.5.0
func (has HttpApiStruct) GetToken() string
func (*HttpApiStruct) HammerTest ¶ added in v0.4.4
func (has *HttpApiStruct) HammerTest() error
func (HttpApiStruct) HasFqdn ¶ added in v0.4.4
func (has HttpApiStruct) HasFqdn() bool
func (*HttpApiStruct) HasHeader ¶ added in v0.4.4
func (has *HttpApiStruct) HasHeader(n string) bool
func (*HttpApiStruct) HttpApiCall ¶ added in v0.4.4
func (has *HttpApiStruct) HttpApiCall(method string, uri string) error
func (HttpApiStruct) IsPayloadEmpty ¶ added in v0.4.4
func (has HttpApiStruct) IsPayloadEmpty() bool
func (*HttpApiStruct) Load ¶ added in v0.4.4
func (has *HttpApiStruct) Load(filename string) error
func (*HttpApiStruct) ParseFromURL ¶ added in v0.4.4
func (has *HttpApiStruct) ParseFromURL(urlStr string) (string, error)
func (*HttpApiStruct) SetAcceptHeader ¶ added in v0.4.4
func (has *HttpApiStruct) SetAcceptHeader(v string)
func (*HttpApiStruct) SetAuthorizationHeader ¶ added in v0.4.4
func (has *HttpApiStruct) SetAuthorizationHeader(v string)
func (*HttpApiStruct) SetContentTypeHeader ¶ added in v0.4.4
func (has *HttpApiStruct) SetContentTypeHeader(v string)
func (*HttpApiStruct) SetContentTypeHeaderJSON ¶ added in v0.4.4
func (has *HttpApiStruct) SetContentTypeHeaderJSON()
func (*HttpApiStruct) SetForceLocal ¶ added in v0.4.4
func (has *HttpApiStruct) SetForceLocal(b bool)
func (*HttpApiStruct) SetFqdn ¶ added in v0.4.4
func (has *HttpApiStruct) SetFqdn(fqdn string)
func (*HttpApiStruct) SetHeader ¶ added in v0.4.4
func (has *HttpApiStruct) SetHeader(n string, v string)
func (*HttpApiStruct) SetHeaders ¶ added in v0.4.4
func (has *HttpApiStruct) SetHeaders(h map[string]string)
func (*HttpApiStruct) SetPasscode ¶ added in v0.5.3
func (has *HttpApiStruct) SetPasscode(passcode string) *HttpApiStruct
func (*HttpApiStruct) SetPayload ¶ added in v0.4.4
func (has *HttpApiStruct) SetPayload(p []byte)
func (*HttpApiStruct) SetPayloadAny ¶ added in v0.4.4
func (has *HttpApiStruct) SetPayloadAny(v any) error
func (*HttpApiStruct) SetPort ¶ added in v0.4.4
func (has *HttpApiStruct) SetPort(p int)
func (*HttpApiStruct) SetQueryPair ¶ added in v0.4.4
func (has *HttpApiStruct) SetQueryPair(n string, v string)
func (*HttpApiStruct) SetQueryPairBool ¶ added in v0.4.4
func (has *HttpApiStruct) SetQueryPairBool(n string, v bool)
func (*HttpApiStruct) SetQueryPairFloat ¶ added in v0.4.4
func (has *HttpApiStruct) SetQueryPairFloat(n string, v float64)
func (*HttpApiStruct) SetQueryPairInt ¶ added in v0.4.4
func (has *HttpApiStruct) SetQueryPairInt(n string, v int)
func (*HttpApiStruct) SetQueryPairInt64 ¶ added in v0.4.4
func (has *HttpApiStruct) SetQueryPairInt64(n string, v int64)
func (*HttpApiStruct) SetQueryParams ¶ added in v0.4.4
func (has *HttpApiStruct) SetQueryParams(qp map[string]string)
func (*HttpApiStruct) SetQueryParamsByURI ¶ added in v0.4.4
func (has *HttpApiStruct) SetQueryParamsByURI(uri string)
func (*HttpApiStruct) SetResponseBody ¶ added in v0.4.4
func (has *HttpApiStruct) SetResponseBody(b []byte)
func (*HttpApiStruct) SetSSH ¶ added in v0.4.4
func (has *HttpApiStruct) SetSSH(s SSHStruct)
func (*HttpApiStruct) SetStatusCode ¶ added in v0.4.4
func (has *HttpApiStruct) SetStatusCode(s int)
func (*HttpApiStruct) SetTimeout ¶ added in v0.4.4
func (has *HttpApiStruct) SetTimeout(t int)
func (*HttpApiStruct) SetToken ¶ added in v0.5.3
func (has *HttpApiStruct) SetToken(t string)
func (HttpApiStruct) WithFqdn ¶ added in v0.4.4
func (has HttpApiStruct) WithFqdn(fqdn string) HttpApiStruct
func (HttpApiStruct) WithHeaders ¶ added in v0.4.4
func (has HttpApiStruct) WithHeaders(h map[string]string) HttpApiStruct
func (HttpApiStruct) WithPayload ¶ added in v0.4.4
func (has HttpApiStruct) WithPayload(p []byte) HttpApiStruct
func (HttpApiStruct) WithPayloadAny ¶ added in v0.4.4
func (has HttpApiStruct) WithPayloadAny(v any) HttpApiStruct
func (HttpApiStruct) WithPort ¶ added in v0.4.4
func (has HttpApiStruct) WithPort(p int) HttpApiStruct
func (HttpApiStruct) WithQueryParams ¶ added in v0.4.4
func (has HttpApiStruct) WithQueryParams(qp map[string]string) HttpApiStruct
func (HttpApiStruct) WithQueryParamsByURI ¶ added in v0.4.4
func (has HttpApiStruct) WithQueryParamsByURI(uri string) HttpApiStruct
func (HttpApiStruct) WithResponseBody ¶ added in v0.4.4
func (has HttpApiStruct) WithResponseBody(b []byte) HttpApiStruct
func (HttpApiStruct) WithSSH ¶ added in v0.4.4
func (has HttpApiStruct) WithSSH(s SSHStruct) HttpApiStruct
func (HttpApiStruct) WithStatusCode ¶ added in v0.4.4
func (has HttpApiStruct) WithStatusCode(s int) HttpApiStruct
func (HttpApiStruct) WithTimeout ¶ added in v0.4.4
func (has HttpApiStruct) WithTimeout(t int) HttpApiStruct
type HttpMethod ¶ added in v0.4.4
type HttpMethod string
const ( HttpGET HttpMethod = "GET" HttpPOST HttpMethod = "POST" HttpPUT HttpMethod = "PUT" HttpDELETE HttpMethod = "DELETE" HttpHEAD HttpMethod = "HEAD" HttpOPTIONS HttpMethod = "OPTIONS" HttpPATCH HttpMethod = "PATCH" )
type JWTServer ¶ added in v0.5.3
type JWTServer struct {
// contains filtered or unexported fields
}
func (*JWTServer) AddRoute ¶ added in v0.5.3
func (s *JWTServer) AddRoute(pattern string, handler http.HandlerFunc, protected bool, middlewares ...Middleware)
func (*JWTServer) JWTMiddleware ¶ added in v0.5.3
func (s *JWTServer) JWTMiddleware(next http.HandlerFunc) http.HandlerFunc
func (*JWTServer) MiddleWareRequireRole ¶ added in v0.5.3
func (s *JWTServer) MiddleWareRequireRole(role string) Middleware
func (*JWTServer) NoopMiddleware ¶ added in v0.5.3
func (s *JWTServer) NoopMiddleware() Middleware
func (*JWTServer) ServeStaticDirectory ¶ added in v0.5.3
func (*JWTServer) ServeStaticFile ¶ added in v0.5.3
func (s *JWTServer) ServeStaticDirectory(pattern string, dir string) {
if len(dir) == 0 {
dir = s.staticDir
}
log.Printf("Serving static files from %s at %s", dir, pattern)
fs := http.FileServer(http.Dir(dir))
s.router.Handle(pattern, http.StripPrefix(pattern, fs))
}
type JwtClaims ¶ added in v0.4.0
type JwtClaims struct {
Username string `json:"username"`
jwt.RegisteredClaims
}
type JwtCredentials ¶ added in v0.4.0
type JwtHttpsServerStruct ¶ added in v0.4.0
type JwtHttpsServerStruct struct {
Port int
Router *chi.Mux
StaticDirRoute string
// contains filtered or unexported fields
}
func (*JwtHttpsServerStruct) AcquireKey ¶ added in v0.4.0
func (jhs *JwtHttpsServerStruct) AcquireKey(f string)
func (*JwtHttpsServerStruct) AuthMiddleware ¶ added in v0.4.0
func (jhs *JwtHttpsServerStruct) AuthMiddleware(next http.HandlerFunc) http.HandlerFunc
func (JwtHttpsServerStruct) GetCertFiles ¶ added in v0.4.0
func (jhs JwtHttpsServerStruct) GetCertFiles() (string, string)
func (JwtHttpsServerStruct) GetKey ¶ added in v0.4.0
func (jhs JwtHttpsServerStruct) GetKey() []byte
func (JwtHttpsServerStruct) GetPort ¶ added in v0.4.0
func (jhs JwtHttpsServerStruct) GetPort() int
func (JwtHttpsServerStruct) GetStaticDirRoute ¶ added in v0.4.4
func (jhs JwtHttpsServerStruct) GetStaticDirRoute() string
func (*JwtHttpsServerStruct) Init ¶ added in v0.4.0
func (jhs *JwtHttpsServerStruct) Init(port int)
func (JwtHttpsServerStruct) RouteExists ¶ added in v0.4.0
func (jhs JwtHttpsServerStruct) RouteExists(r string) bool
func (*JwtHttpsServerStruct) SetCertFiles ¶ added in v0.4.0
func (jhs *JwtHttpsServerStruct) SetCertFiles(priv, pub string)
func (*JwtHttpsServerStruct) SetKey ¶ added in v0.4.0
func (jhs *JwtHttpsServerStruct) SetKey(k []byte)
func (*JwtHttpsServerStruct) SetPort ¶ added in v0.4.0
func (jhs *JwtHttpsServerStruct) SetPort(p int)
func (*JwtHttpsServerStruct) SetStaticDirRoute ¶ added in v0.4.4
func (jhs *JwtHttpsServerStruct) SetStaticDirRoute(dir string)
func (*JwtHttpsServerStruct) SetupStaticRoutes ¶ added in v0.5.0
func (jhs *JwtHttpsServerStruct) SetupStaticRoutes(index string)
func (jhs *JwtHttpsServerStruct) SetLoginHandler(h http.Handler) {
r = chi.NewRouter()
r.Post("/login", h)
return r
// if !jhs.pathMap[LoginRoute] {
// jhs.Router.Post(LoginRoute, h)
// }
}
func (*JwtHttpsServerStruct) StartServer ¶ added in v0.4.0
func (jhs *JwtHttpsServerStruct) StartServer() error
func (*JwtHttpsServerStruct) UpdateClaims ¶ added in v0.4.0
func (jhs *JwtHttpsServerStruct) UpdateClaims(username string, w http.ResponseWriter)
func (JwtHttpsServerStruct) ValidateBearerToken ¶ added in v0.4.0
func (jhs JwtHttpsServerStruct) ValidateBearerToken(w http.ResponseWriter, r *http.Request) bool
func (JwtHttpsServerStruct) WithKey ¶ added in v0.4.0
func (jhs JwtHttpsServerStruct) WithKey(k []byte) JwtHttpsServerStruct
func (JwtHttpsServerStruct) WithPort ¶ added in v0.4.0
func (jhs JwtHttpsServerStruct) WithPort(p int) JwtHttpsServerStruct
func (JwtHttpsServerStruct) WithStaticDirRoute ¶ added in v0.4.4
func (jhs JwtHttpsServerStruct) WithStaticDirRoute(dir string) JwtHttpsServerStruct
type LoginResponse ¶ added in v0.5.3
type LoginResponse struct {
Token string `json:"token"`
}
type MemoryManagementOptions ¶ added in v0.5.0
type MemoryManagementOptions struct {
// Interval between memory checks
Interval time.Duration
// ForceGC determines if garbage collection should be forced
ForceGC bool
// MemoryThreshold in bytes to trigger alerts (0 for disabled)
MemoryThreshold uint64
// Custom logger (optional)
Logger *log.Logger
}
Options for memory manager
func DefaultMMOptions ¶ added in v0.5.0
func DefaultMMOptions() *MemoryManagementOptions
DefaultOptions returns sensible default options
func (*MemoryManagementOptions) WithDefaultLogger ¶ added in v0.5.0
func (options *MemoryManagementOptions) WithDefaultLogger() *MemoryManagementOptions
func (*MemoryManagementOptions) WithForceGC ¶ added in v0.5.0
func (options *MemoryManagementOptions) WithForceGC(forceGC bool) *MemoryManagementOptions
func (*MemoryManagementOptions) WithInterval ¶ added in v0.5.0
func (options *MemoryManagementOptions) WithInterval(interval time.Duration) *MemoryManagementOptions
func (*MemoryManagementOptions) WithLogger ¶ added in v0.5.0
func (options *MemoryManagementOptions) WithLogger(logger *log.Logger) *MemoryManagementOptions
func (*MemoryManagementOptions) WithMemoryThreshold ¶ added in v0.5.0
func (options *MemoryManagementOptions) WithMemoryThreshold(threshold uint64) *MemoryManagementOptions
type MemoryManager ¶ added in v0.5.0
type MemoryManager struct {
// contains filtered or unexported fields
}
MemoryManager manages memory and outputs to logs
func NewMemoryManager ¶ added in v0.5.0
func NewMemoryManager(options MemoryManagementOptions) *MemoryManager
New creates a new memory manager with the given options
func (*MemoryManager) Start ¶ added in v0.5.0
func (mm *MemoryManager) Start()
Start begins memory monitoring in a goroutine
func (*MemoryManager) Stop ¶ added in v0.5.0
func (mm *MemoryManager) Stop()
Stop cancels the memory monitoring goroutine
type MemoryStats ¶ added in v0.5.0
type MemoryStats struct {
Alloc uint64
TotalAlloc uint64
Sys uint64
NumGC uint32
HeapAlloc uint64
HeapSys uint64
HeapIdle uint64
HeapInUse uint64
}
MemoryStats contains memory statistics
type Middleware ¶ added in v0.5.3
type Middleware func(http.HandlerFunc) http.HandlerFunc
func MiddleWareWithLogging ¶ added in v0.5.3
func MiddleWareWithLogging(logger *log.Logger) Middleware
type MigrationMgrStruct ¶ added in v0.4.5
type MigrationMgrStruct struct {
SourceS3 *S3ClientSession
TargetS3 *S3ClientSession
Progress *ProgressTracker
ErrorMsg string
SourceHead *s3.HeadObjectOutput
TargetHead *s3.HeadObjectOutput
WorkerPool chan struct{}
SuccessLog *log.Logger
FailLog *log.Logger
UseSourceAsPrefixOnTarget bool // if true, use source bucket name as prefix on target bucket
// contains filtered or unexported fields
}
func NewMigrationManager ¶ added in v0.4.5
func NewMigrationManager(sourceS3 *S3ClientSession, targetS3 *S3ClientSession, progress *ProgressTracker, sucessLog *log.Logger, failLog *log.Logger, batchSize int) *MigrationMgrStruct
func (*MigrationMgrStruct) CopyObjectBetweenBucketsMPU ¶ added in v0.4.5
func (mgr *MigrationMgrStruct) CopyObjectBetweenBucketsMPU() error
func (*MigrationMgrStruct) CopyObjectBetweenBucketsRegular ¶ added in v0.4.5
func (mgr *MigrationMgrStruct) CopyObjectBetweenBucketsRegular() error
func (*MigrationMgrStruct) DeepCopy ¶ added in v0.4.5
func (mgr *MigrationMgrStruct) DeepCopy() *MigrationMgrStruct
func (*MigrationMgrStruct) IsDone ¶ added in v0.4.5
func (mgr *MigrationMgrStruct) IsDone() bool
func (*MigrationMgrStruct) Lock ¶ added in v0.4.5
func (mgr *MigrationMgrStruct) Lock()
func (*MigrationMgrStruct) MigrateObject ¶ added in v0.4.5
func (mgr *MigrationMgrStruct) MigrateObject(size int64) error
func (*MigrationMgrStruct) MigrationBatch ¶ added in v0.4.5
func (mgr *MigrationMgrStruct) MigrationBatch(keys []string, wg *sync.WaitGroup, ResultsChan *chan CopyResult) error
func (*MigrationMgrStruct) MigrationLoop ¶ added in v0.4.5
func (mgr *MigrationMgrStruct) MigrationLoop(wg *sync.WaitGroup, ResultsChan *chan CopyResult) error
func (*MigrationMgrStruct) Unlock ¶ added in v0.4.5
func (mgr *MigrationMgrStruct) Unlock()
func (*MigrationMgrStruct) WithUseSourceAsPrefixOnTarget ¶ added in v0.7.0
func (mgr *MigrationMgrStruct) WithUseSourceAsPrefixOnTarget(usePrefix bool) *MigrationMgrStruct
type ObjectIter ¶ added in v0.7.0
type ProcessInfo ¶ added in v0.5.0
ProcessInfo holds PID and className
func GetJavaProcesses ¶ added in v0.5.0
func GetJavaProcesses(filterClassName string) ([]ProcessInfo, error)
func GetJavaProcessesFromBytes ¶ added in v0.5.0
func GetJavaProcessesFromBytes(output []byte, filterClassName string) ([]ProcessInfo, error)
getJavaProcesses returns a slice of ProcessInfo, optionally filtered by className sample line looks like this: 65056 /bin/java -Xmx2g -Xmn400m -Dlog4j.configurationFile=log4j-bucket-tools.xml com.cloudian.tools.bucket.BucketMigration -c md -mode rebuild -ip 192.168.1.31 -tmp /opt/migration/_tmp_ -p migration.properties.bucket1 -retry n -valid off -quit n 33423 /bin/java -Xmx2g -Xmn400m --add-opens java.base/java.math=ALL-UNNAMED --add-opens java.base/java.time=ALL-UNNAMED --add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/java.util.concurrent=ALLUNNAMED --add-opens java.base/jdk.internal.misc=ALL-UNNAMED -XX:+EnableDynamicAgentLoading -Dlog4j.configurationFile=log4j-bucket-tools.xml com.cloudian.tools.bucket.BucketMigration -mode collect -c ver -tmp /opt/migration/_tmp_ -ip 192.168.1.31 -p migration.properties.versioning-bucket -retry n -v 3 -valid off -quit n
func JPS ¶ added in v0.1.3
func JPS() ([]ProcessInfo, error)
type ProgressCallBackFunc ¶ added in v0.1.2
type ProgressCallBackFunc func(chan bool)
type ProgressReader ¶ added in v0.4.0
ProgressReader wraps an io.Reader and provides progress updates
type ProgressTracker ¶ added in v0.4.0
type ProgressTracker struct {
TotalObjects int64
MigratedObjects int64
SkippedObjects int64
TotalBytes int64
CompletedBytes int64
FailedObjects map[string]error
// contains filtered or unexported fields
}
func (*ProgressTracker) Lock ¶ added in v0.4.5
func (p *ProgressTracker) Lock()
func (*ProgressTracker) Unlock ¶ added in v0.4.5
func (p *ProgressTracker) Unlock()
type S3ClientSession ¶ added in v0.1.2
type S3ClientSession struct {
Credentials S3credStruct `json:"s3creds"`
Bucket string `json:"bucket"`
Endpoint string `json:"endpoint"`
Region string `json:"region"`
ObjectKey string `json:"key"`
// Client *s3.S3
Client s3iface.S3API
Versioning bool `json:"versioning"`
PolicyId string `json:"policyid"`
Response *http.Response
ContinuationToken *string
BatchSize int `json:"batchSize"`
WasSkipped bool
Owner *s3.Owner `json:"owner,omitempty"`
EnableObjectLock bool `json:"enableObjectLock,omitempty"`
// contains filtered or unexported fields
}
func (S3ClientSession) AbortMultipartUploads ¶ added in v0.7.0
func (s3c S3ClientSession) AbortMultipartUploads(uploads []MPUUpload, cutoff time.Duration) error
AbortMultipartUploads aborts all multipart uploads older than cutoff
func (*S3ClientSession) AddLifecycleRule ¶ added in v0.7.0
func (s3c *S3ClientSession) AddLifecycleRule(newrule *s3.LifecycleRule) error
func (*S3ClientSession) AddLifecycleRuleCustomHeaders ¶ added in v0.7.0
func (s3c *S3ClientSession) AddLifecycleRuleCustomHeaders(newRule *s3.LifecycleRule, customHeaders map[string]string) error
func (*S3ClientSession) ClearEndpoint ¶ added in v0.1.2
func (s3c *S3ClientSession) ClearEndpoint(sep string)
func (*S3ClientSession) CopyAllObjectsBatch ¶ added in v0.4.5
func (sourceS3 *S3ClientSession) CopyAllObjectsBatch( targetS3 *S3ClientSession, progress *ProgressTracker, successLog *log.Logger, failLog *log.Logger, batchSize int) error
func (S3ClientSession) CopyAllObjectsDoNotUse ¶ added in v0.4.5
func (sourceS3 S3ClientSession) CopyAllObjectsDoNotUse( targetS3 *S3ClientSession, progress *ProgressTracker, ) error
CopyAllObjects copies all objects between S3-compatible systems
func (S3ClientSession) CopyObjectBetweenBuckets ¶ added in v0.4.0
func (sourceS3 S3ClientSession) CopyObjectBetweenBuckets( targetS3 *S3ClientSession, sourceKey string, targetKey string, progress *ProgressTracker, ) error
CopyObjectBetweenBuckets copies a single object between S3-compatible systems
func (*S3ClientSession) CreateBucket ¶ added in v0.1.2
func (s3c *S3ClientSession) CreateBucket() error
IMPORTANT: if using object lock, the bucket must be created with object lock
BUT then versioning is applied afterwards
func (S3ClientSession) CreateIncompleteMultipartUpload ¶ added in v0.7.0
func (s3c S3ClientSession) CreateIncompleteMultipartUpload(key string, numParts int, partSize int64) (string, error)
CreateIncompleteMultipartUpload starts a multipart upload and uploads a few parts from memory. It intentionally leaves the upload incomplete so it can be listed and aborted later.
func (*S3ClientSession) DeepCopy ¶ added in v0.4.5
func (s3c *S3ClientSession) DeepCopy() S3ClientSession
deep copy with a clean new session
func (*S3ClientSession) DeleteEntireBucketLifeCyclePolicy ¶ added in v0.7.0
func (s3c *S3ClientSession) DeleteEntireBucketLifeCyclePolicy() error
delete all rules in one shot for the current bucket
func (S3ClientSession) DeleteObject ¶ added in v0.5.0
func (s3c S3ClientSession) DeleteObject(object string) error
func (S3ClientSession) DeleteObjectVersions ¶ added in v0.5.0
func (s3c S3ClientSession) DeleteObjectVersions(object string) error
func (*S3ClientSession) DoNotForceSSL ¶ added in v0.4.0
func (s3c *S3ClientSession) DoNotForceSSL()
func (*S3ClientSession) EnableLogging ¶ added in v0.4.1
func (s3c *S3ClientSession) EnableLogging(l bool)
func (*S3ClientSession) EstablishSession ¶ added in v0.1.2
func (s3c *S3ClientSession) EstablishSession() error
func (*S3ClientSession) ForceSSL ¶ added in v0.4.0
func (s3c *S3ClientSession) ForceSSL()
func (*S3ClientSession) GenerateStaleMPUCleanUpRule ¶ added in v0.7.0
func (s3c *S3ClientSession) GenerateStaleMPUCleanUpRule(days int) s3.LifecycleRule
func (*S3ClientSession) GenerateTieringRule ¶ added in v0.7.0
func (s3c *S3ClientSession) GenerateTieringRule(days int) s3.LifecycleRule
func (S3ClientSession) GetBucketACL ¶ added in v0.4.2
func (sourceS3 S3ClientSession) GetBucketACL() (string, error)
func (*S3ClientSession) GetBucketDefaultRetention ¶ added in v0.7.0
func (s3c *S3ClientSession) GetBucketDefaultRetention() (*s3.DefaultRetention, error)
func (*S3ClientSession) GetBucketLifecycleRules ¶ added in v0.7.0
func (s3c *S3ClientSession) GetBucketLifecycleRules() ([]*s3.LifecycleRule, error)
func (*S3ClientSession) GetBucketSummary ¶ added in v0.5.3
func (s3c *S3ClientSession) GetBucketSummary(prefix string) (BucketSummary, error)
GetBucketSummary retrieves total object count and size for an S3 bucket
func (*S3ClientSession) GetBucketSummaryWithVersions ¶ added in v0.5.3
func (s3c *S3ClientSession) GetBucketSummaryWithVersions(prefix string) (BucketSummary, error)
GetBucketSummaryWithVersions retrieves summary including all object versions
func (*S3ClientSession) GetConcurrency ¶ added in v0.4.1
func (s3c *S3ClientSession) GetConcurrency() int
func (*S3ClientSession) GetHashOfObjectRange ¶ added in v0.4.3
func (s3c *S3ClientSession) GetHashOfObjectRange(fromChunk int64, chunkSize int64) (string, error)
func (*S3ClientSession) GetObject ¶ added in v0.1.3
func (s3c *S3ClientSession) GetObject() ([]byte, error)
func (*S3ClientSession) GetObjectHash ¶ added in v0.1.3
func (s3c *S3ClientSession) GetObjectHash() (string, error)
func (*S3ClientSession) GetObjectRetention ¶ added in v0.7.0
func (s3c *S3ClientSession) GetObjectRetention(key, versionID string, ) (*s3.GetObjectRetentionOutput, error)
func (*S3ClientSession) GetS3Ptr ¶ added in v0.4.0
func (s3c *S3ClientSession) GetS3Ptr() s3iface.S3API
func (*S3ClientSession) GetSession ¶ added in v0.4.0
func (s3c *S3ClientSession) GetSession() *session.Session
func (*S3ClientSession) GetSizeOfObject ¶ added in v0.4.4
func (s3c *S3ClientSession) GetSizeOfObject() (int64, error)
func (S3ClientSession) GetSkipSize ¶ added in v0.4.4
func (s3c S3ClientSession) GetSkipSize() int64
func (*S3ClientSession) GetURL ¶ added in v0.1.3
func (s3c *S3ClientSession) GetURL() string
func (S3ClientSession) HeadBucket ¶ added in v0.1.2
func (this S3ClientSession) HeadBucket() (bool, error)
func (*S3ClientSession) HeadObject ¶ added in v0.1.3
func (s3c *S3ClientSession) HeadObject() (bool, error)
func (*S3ClientSession) IsObjectLockEnabled ¶ added in v0.7.0
func (s3c *S3ClientSession) IsObjectLockEnabled() error
func (*S3ClientSession) IsVersioningEnabled ¶ added in v0.1.2
func (s3c *S3ClientSession) IsVersioningEnabled() error
func (S3ClientSession) KeepBucket ¶ added in v0.1.2
func (s3c S3ClientSession) KeepBucket() S3ClientSession
func (*S3ClientSession) ListBuckets ¶ added in v0.1.2
func (s3c *S3ClientSession) ListBuckets() []string
this is actually list endpoint, we want a listing of buckets, not objects
func (S3ClientSession) ListBucketsOLD ¶ added in v0.7.0
func (s3c S3ClientSession) ListBucketsOLD() []string
func (S3ClientSession) ListMultipartUploads ¶ added in v0.7.0
func (s3c S3ClientSession) ListMultipartUploads() ([]MPUUpload, error)
ListMultipartUploads returns all pending or in-progress multipart uploads for a bucket
func (S3ClientSession) ListObjectsWithSizeFilter ¶ added in v0.5.0
func (s3c S3ClientSession) ListObjectsWithSizeFilter(bucket string, sizeFilter int64) ([]S3Objects, error)
func (*S3ClientSession) Load ¶ added in v0.4.0
func (s3c *S3ClientSession) Load(filename string) error
func (*S3ClientSession) LoadCredentials ¶ added in v0.1.3
func (s3c *S3ClientSession) LoadCredentials(f string) error
f = ~/.aws/credentials
func (*S3ClientSession) LoadUserCredentialsForProfile ¶ added in v0.1.3
func (s3c *S3ClientSession) LoadUserCredentialsForProfile() error
func (*S3ClientSession) ObjectExists ¶ added in v0.1.3
func (s3c *S3ClientSession) ObjectExists() bool
func (*S3ClientSession) ParseFromURL ¶ added in v0.1.3
func (s3c *S3ClientSession) ParseFromURL(url string) error
expected: s3://bucket/object
func (*S3ClientSession) PresignedURL ¶ added in v0.1.3
func (s3c *S3ClientSession) PresignedURL(expiredHours int) (string, error)
func (*S3ClientSession) PrintBucketSummary ¶ added in v0.5.3
func (s3c *S3ClientSession) PrintBucketSummary(prefix string, includeVersions bool) error
PrintBucketSummary prints the summary in AWS CLI format
func (*S3ClientSession) PutLifecycleRules ¶ added in v0.7.0
func (s3c *S3ClientSession) PutLifecycleRules(rules []*s3.LifecycleRule) error
func (*S3ClientSession) PutLifecycleRulesCustomHeaders ¶ added in v0.7.0
func (s3c *S3ClientSession) PutLifecycleRulesCustomHeaders(rules []*s3.LifecycleRule, customHeaders map[string]string) error
PutLifecycleRules uses the AWS SDK to apply a slice of LifecycleRules
func (*S3ClientSession) PutObjectLockConfigurationCompliance ¶ added in v0.7.0
func (s3c *S3ClientSession) PutObjectLockConfigurationCompliance(retentionDays int64) error
func (*S3ClientSession) PutObjectLockConfigurationGovernance ¶ added in v0.7.0
func (s3c *S3ClientSession) PutObjectLockConfigurationGovernance(retentionDays int64) error
func (*S3ClientSession) PutObjectRetentionComplianceDays ¶ added in v0.7.0
func (s3c *S3ClientSession) PutObjectRetentionComplianceDays(key, versionID string, days int) error
func (*S3ClientSession) PutObjectRetentionGovernanceDays ¶ added in v0.7.0
func (s3c *S3ClientSession) PutObjectRetentionGovernanceDays(key, versionID string, days int) error
func (S3ClientSession) RecursiveBucketDelete ¶ added in v0.1.2
func (s3c S3ClientSession) RecursiveBucketDelete() error
func (S3ClientSession) RecursiveBucketDeleteAlt ¶ added in v0.4.0
func (s3c S3ClientSession) RecursiveBucketDeleteAlt() error
func (*S3ClientSession) RemoveBucket ¶ added in v0.1.2
func (s3c *S3ClientSession) RemoveBucket() error
func (*S3ClientSession) RemoveLifecycleRule ¶ added in v0.7.0
func (s3c *S3ClientSession) RemoveLifecycleRule(ruleID string) error
func (S3ClientSession) S3SyncDirectoryToBucket ¶ added in v0.4.0
func (s3c S3ClientSession) S3SyncDirectoryToBucket(dirPath string, progress *ProgressTracker) error
func (S3ClientSession) Save ¶ added in v0.4.0
func (s3c S3ClientSession) Save(filename string) error
func (*S3ClientSession) SetBucket ¶ added in v0.1.2
func (s3c *S3ClientSession) SetBucket(b string)
func (S3ClientSession) SetBucketACL ¶ added in v0.4.2
func (sourceS3 S3ClientSession) SetBucketACL(aclJson string) error
func (*S3ClientSession) SetConcurrency ¶ added in v0.4.1
func (s3c *S3ClientSession) SetConcurrency(c int)
func (*S3ClientSession) SetRegion ¶ added in v0.1.2
func (s3c *S3ClientSession) SetRegion(r string)
func (*S3ClientSession) SetSession ¶ added in v0.4.0
func (s3c *S3ClientSession) SetSession(s *session.Session)
func (*S3ClientSession) SetSkipSize ¶ added in v0.4.4
func (s3c *S3ClientSession) SetSkipSize(sz int64)
func (S3ClientSession) SetVersioning ¶ added in v0.1.2
func (this S3ClientSession) SetVersioning(v bool) S3ClientSession
func (S3ClientSession) Sync ¶ added in v0.1.2
func (this S3ClientSession) Sync(localPath string) error
func (S3ClientSession) SyncInner ¶ added in v0.1.2
func (this S3ClientSession) SyncInner(trimsz int, localPath string) error
func (*S3ClientSession) WithBucket ¶ added in v0.1.2
func (s3c *S3ClientSession) WithBucket(b string) *S3ClientSession
func (*S3ClientSession) WithCertificateEnforcement ¶ added in v0.4.7
func (s3c *S3ClientSession) WithCertificateEnforcement(enforce bool) *S3ClientSession
func (*S3ClientSession) WithCredentials ¶ added in v0.7.0
func (s3c *S3ClientSession) WithCredentials(cred S3credStruct) *S3ClientSession
func (*S3ClientSession) WithEndpoint ¶ added in v0.1.2
func (s3c *S3ClientSession) WithEndpoint(sep string) *S3ClientSession
func (*S3ClientSession) WithRegion ¶ added in v0.1.2
func (s3c *S3ClientSession) WithRegion(r string) *S3ClientSession
func (S3ClientSession) WithSkipSize ¶ added in v0.4.4
func (s3c S3ClientSession) WithSkipSize(sz int64) S3ClientSession
type S3Iter ¶ added in v0.7.0
type S3Iter struct {
// contains filtered or unexported fields
}
func NewS3Iter ¶ added in v0.7.0
func NewS3Iter(s3c *S3ClientSession, input *s3.ListObjectsV2Input) *S3Iter
type S3Objects ¶ added in v0.5.0
type S3credStruct ¶ added in v0.1.2
type S3credStruct struct {
AccessKey string `json:"accessKey"`
Active bool `json:"active"`
CreateDate int64 `json:"createDate"`
ExpireDate int64 `json:"expireDate"`
SecretKey string `json:"secretKey"`
Profile string `json:"profile"`
}
func (S3credStruct) CredentialsS3FSPassword ¶ added in v0.4.5
func (s3c S3credStruct) CredentialsS3FSPassword() string
func (S3credStruct) CredentialsStanza ¶ added in v0.1.2
func (s3c S3credStruct) CredentialsStanza() string
func (S3credStruct) GenerateAWSCLItoString ¶ added in v0.1.2
func (s3c S3credStruct) GenerateAWSCLItoString(endpoint string, region string, useSSL bool) string
func (*S3credStruct) String ¶ added in v0.7.0
func (cred *S3credStruct) String() string
type SSHStruct ¶
type SSHStruct struct {
Key string `json:"key,omitempty"` //ssh key file, if empty, use ~/.ssh/id_rsa
User string `json:"user,omitempty"` //ssh user, if empty, use $USER
Host string `json:"host,omitempty"`
RemoteDir string `json:"remotedir,omitempty"` //remote directory to execute commands in, if empty, use home dir
ConnectTimeout int `json:"connecttimeout,omitempty"` //ssh -o ConnectTimeout=10
// contains filtered or unexported fields
}
func (SSHStruct) BackgroundedRemoteExecute ¶
func (SSHStruct) ChangePassword ¶ added in v0.7.0
func (*SSHStruct) CreateClientConfig ¶ added in v0.1.3
func (s *SSHStruct) CreateClientConfig() ssh.ClientConfig
func (*SSHStruct) CrossCopyCLI ¶ added in v0.1.3
func (SSHStruct) DownloadCLI ¶
remote, local
func (SSHStruct) GenerateRemoteGoBuildCLI ¶ added in v0.1.3
func (SSHStruct) GetBodyBytes ¶ added in v0.1.3
func (*SSHStruct) GetExitCode ¶ added in v0.1.3
func (*SSHStruct) GetLastModifiedTime ¶ added in v0.5.0
func (SSHStruct) GetRemoteDir ¶ added in v0.1.2
func (SSHStruct) GetRemoteFileHash ¶ added in v0.4.1
func (*SSHStruct) GetRemoteFileSize ¶ added in v0.5.3
func (SSHStruct) GetRemoteHostname ¶
func (SSHStruct) GetRequest ¶ added in v0.4.4
func (SSHStruct) GetSSHOptionsAsString ¶ added in v0.1.3
func (SSHStruct) HammerTest ¶ added in v0.4.0
func (SSHStruct) NotConfigured ¶ added in v0.1.2
func (SSHStruct) RemoteCapturePid ¶ added in v0.1.3
func (*SSHStruct) RemoteExecuteAndSpin ¶
func (SSHStruct) RemoteFileCount ¶ added in v0.5.3
func (SSHStruct) RemoteFileExists ¶
return false on error or file doesn't exist (easy mode)
func (SSHStruct) RemoteFindFiles ¶ added in v0.1.2
func (SSHStruct) RemoteGetArgsFromPid ¶ added in v0.1.3
func (*SSHStruct) RemoteGetRelease ¶ added in v0.1.3
func (SSHStruct) RemoteGetThreadCount ¶ added in v0.1.3
func (*SSHStruct) RemoteGetVersion ¶ added in v0.1.3
func (*SSHStruct) RemoteGitBranch ¶ added in v0.1.3
func (*SSHStruct) RemoteGitRev ¶ added in v0.1.3
func (*SSHStruct) RemotePopenGrep ¶ added in v0.1.3
func (*SSHStruct) RemoteReadFile ¶ added in v0.1.3
func (SSHStruct) RemoteRemoveFiles ¶ added in v0.1.2
func (*SSHStruct) RemoteTail ¶ added in v0.5.0
func (*SSHStruct) RemoveDirAndContent ¶ added in v0.1.2
func (SSHStruct) RemoveRemoteDir ¶ added in v0.5.0
func (SSHStruct) RemoveRemoteFile ¶ added in v0.1.2
func (SSHStruct) RenameRemoteFile ¶ added in v0.1.2
func (SSHStruct) ReportHammerResults ¶ added in v0.4.0
func (*SSHStruct) RsyncWithSwitches ¶ added in v0.5.0
func (SSHStruct) SecureDownload
deprecated
func (SSHStruct) SecureDownloadAndSpin
deprecated
func (*SSHStruct) SecureRemoteExecution ¶
func (*SSHStruct) SecureRemotePipeExecution ¶ added in v0.1.2
func (SSHStruct) SecureUpload
deprecated
func (SSHStruct) SecureUploadAndSpin ¶
func (*SSHStruct) SecureUploadContent ¶ added in v0.1.2
func (*SSHStruct) SecureUploadContent2 ¶ added in v0.1.3
func (*SSHStruct) SetCapture ¶ added in v0.1.2
func (*SSHStruct) SetDefaults ¶
func (ssh *SSHStruct) SetDefaults()
func (*SSHStruct) SetRemoteDir ¶ added in v0.1.2
func (*SSHStruct) SetRequest ¶ added in v0.4.4
func (*SSHStruct) SyncFileWithRemote ¶ added in v0.5.0
func (SSHStruct) WithCapture ¶ added in v0.1.2
func (SSHStruct) WithRemoteDir ¶ added in v0.1.2
func (SSHStruct) WithRequest ¶ added in v0.4.4
func (SSHStruct) WithSilent ¶ added in v0.1.2
type ServerBuilder ¶ added in v0.5.3
type ServerBuilder struct {
// contains filtered or unexported fields
}
func NewServerBuilder ¶ added in v0.5.3
func NewServerBuilder() *ServerBuilder
func (*ServerBuilder) Build ¶ added in v0.5.3
func (b *ServerBuilder) Build() *JWTServer
func (*ServerBuilder) WithAddress ¶ added in v0.5.3
func (b *ServerBuilder) WithAddress(addr string, port int) *ServerBuilder
func (*ServerBuilder) WithCertificateFiles ¶ added in v0.5.3
func (b *ServerBuilder) WithCertificateFiles(cert, key string) *ServerBuilder
func (*ServerBuilder) WithJWTKey ¶ added in v0.5.3
func (b *ServerBuilder) WithJWTKey(keyPath string) *ServerBuilder
func (*ServerBuilder) WithLogger ¶ added in v0.5.3
func (b *ServerBuilder) WithLogger(logger *log.Logger) *ServerBuilder
func (*ServerBuilder) WithPasscode ¶ added in v0.5.3
func (b *ServerBuilder) WithPasscode(passcode string) *ServerBuilder
func (*ServerBuilder) WithSSL ¶ added in v0.5.3
func (b *ServerBuilder) WithSSL(cert, key string) *ServerBuilder
func (*ServerBuilder) WithStaticDir ¶ added in v0.5.3
func (b *ServerBuilder) WithStaticDir(dir string) *ServerBuilder
func (*ServerBuilder) WithTokenTTL ¶ added in v0.5.3
func (b *ServerBuilder) WithTokenTTL(minutes int) *ServerBuilder
type ServerConfig ¶ added in v0.5.3
type TaskStatusType ¶ added in v0.4.0
type TaskStatusType int64
const ( TSTNone TaskStatusType = iota TSTQuened TSTRunning TSTCompleted )
func (TaskStatusType) String ¶ added in v0.4.0
func (tst TaskStatusType) String() string
type TaskStruct ¶ added in v0.4.0
type TaskStruct struct {
ID int `json:"id"`
Description string `json:"description"`
Command string `json:"command"`
Status string `json:"status"`
Output []string `json:"output,omitempty"`
Duration time.Duration `json:"duration,omitempty"`
// contains filtered or unexported fields
}
func (*TaskStruct) Init ¶ added in v0.4.0
func (ts *TaskStruct) Init()
type WatcherCallBackFunc ¶ added in v0.1.2
type WatcherCallBackFunc func(*ExecStruct) error
type WebHookStruct ¶ added in v0.1.3
type WebHookStruct struct {
WebHookURL string
}
func (WebHookStruct) SendMsg ¶ added in v0.1.3
func (wh WebHookStruct) SendMsg(msg string) error
Source Files
¶
- aws-s3-blc.go
- aws-s3-migration.go
- aws-s3-mpu.go
- aws-s3-objectlock.go
- aws-s3-verify.go
- aws-s3.go
- constants.go
- dd.go
- diskcheck.go
- exec.go
- exec2.go
- find.go
- gunzip.go
- httpclient.go
- jps.go
- json.go
- jwt.go
- jwt2.go
- math.go
- md5sum.go
- memory.go
- sqlite.go
- ssh.go
- stringlib.go
- taskman.go
- timeanddate.go
- unix.go
- untar.go
- unzip.go
- util.go
- version.go
- webhook.go