Documentation
¶
Index ¶
- func AcquireLock(path string) error
- func BreakStaleLock(path string) (bool, error)
- func Chown(path string, uid, gid string) error
- func CliMask(condition bool, textTrue string, textFalse string) string
- func CliRemoveComa(text string) string
- func Confirm(message string) bool
- func Editor(jsonBytes []byte) ([]byte, bool, error)
- func EnforceHTTPS(raw string) (*url.URL, error)
- func GetLogLevel(level string) zapcore.Level
- func GetRealHome() string
- func GetRealUser() (*user.User, error)
- func GetSanitizedDirectoryPath(path string) string
- func IsRunningAsSudo() bool
- func LogIfError(err error)
- func PrintAndExit(err error, code int)
- func PrintBytes(ctx context.Context, reader io.ReadCloser) error
- func PrintBytesDemux(ctx context.Context, reader io.ReadCloser) error
- func ReleaseAllLocks()
- func ReleaseLock(path string) error
- func RemoveElement[T any](slice []T, k int) []T
- func WaitForFileToAppear(ctx context.Context, path string, interval time.Duration) error
- type LockManager
- type LockStatus
- type RealUser
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AcquireLock ¶
func BreakStaleLock ¶
func CliRemoveComa ¶
func GetLogLevel ¶
func GetRealHome ¶
func GetRealHome() string
func GetRealUser ¶
func IsRunningAsSudo ¶
func IsRunningAsSudo() bool
func LogIfError ¶
func LogIfError(err error)
func PrintAndExit ¶
func PrintBytes ¶
func PrintBytes(ctx context.Context, reader io.ReadCloser) error
func PrintBytesDemux ¶
func PrintBytesDemux(ctx context.Context, reader io.ReadCloser) error
func ReleaseAllLocks ¶
func ReleaseAllLocks()
ReleaseAllLocks releases all locks held by this process
func ReleaseLock ¶
func RemoveElement ¶
Types ¶
type LockManager ¶
type LockManager struct {
// contains filtered or unexported fields
}
func NewLockManager ¶
func NewLockManager() *LockManager
func (*LockManager) Acquire ¶
func (lm *LockManager) Acquire(path string) error
func (*LockManager) Release ¶
func (lm *LockManager) Release(path string) error
func (*LockManager) ReleaseAll ¶
func (lm *LockManager) ReleaseAll()
type LockStatus ¶
func CheckLock ¶
func CheckLock(path string) (LockStatus, error)
Click to show internal directories.
Click to hide internal directories.