Documentation ¶
Index ¶
- func DeserializeToStruct(filename string, pointerToStructInstance any) error
- func GetPidFromFile(pidFile string) (int, error)
- func GetPidFromFileTimeout(pidFile string, timeoutSeconds uint, wk *WatchdogKicker) (int, error)
- func GetVolumeFormat(log *base.LogObject, fileLocation string) (config.Format, error)
- func GetZipArchive(root string, pe types.PatchEnvelopeInfo) (string, error)
- func IsProcAlive(pid int) bool
- func IsProcAliveTimeout(pid int, timeoutSeconds uint, wk *WatchdogKicker) bool
- func KickWatchdog(wk *WatchdogKicker)
- func LookupDatastoreConfig(sub pubsub.Subscription, dsID uuid.UUID) (*types.DatastoreConfig, error)
- func MaybeInsertSha(name string, sha string) string
- func PkillArgs(log *base.LogObject, match string, printOnError bool, kill bool)
- func RemoteAccessDisabled() bool
- func RoundToMbytes(byteCount uint64) uint64
- func UpdateLedManagerConfig(log *base.LogObject, count types.LedBlinkCount)
- type WatchdogKicker
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DeserializeToStruct ¶
DeserializeToStruct deserializes the given file into the given struct. It returns an error if the file is not accessible or if the file does not contain all the necessary fields (those that are marked as mandatory="true" in the struct definition).
func GetPidFromFile ¶
GetPidFromFile reads a pid from a file.
func GetPidFromFileTimeout ¶
func GetPidFromFileTimeout(pidFile string, timeoutSeconds uint, wk *WatchdogKicker) (int, error)
GetPidFromFileTimeout reads a pid from a file with a timeout.
func GetVolumeFormat ¶
GetVolumeFormat returns format of the volume
func GetZipArchive ¶
func GetZipArchive(root string, pe types.PatchEnvelopeInfo) (string, error)
GetZipArchive archives list of patch envelopes in a given path and returns full path to zip archive
func IsProcAliveTimeout ¶
func IsProcAliveTimeout(pid int, timeoutSeconds uint, wk *WatchdogKicker) bool
IsProcAliveTimeout checks if a process is alive for a given timeout.
func KickWatchdog ¶
func KickWatchdog(wk *WatchdogKicker)
KickWatchdog tells the watchdog agent is still alive.
func LookupDatastoreConfig ¶
func LookupDatastoreConfig(sub pubsub.Subscription, dsID uuid.UUID) (*types.DatastoreConfig, error)
LookupDatastoreConfig get a datastore config based on uuid
func MaybeInsertSha ¶
MaybeInsertSha Check if the OCI name does not include an explicit sha and if not return the name with the sha inserted. Note that the sha must be lower case in the OCI reference.
func RemoteAccessDisabled ¶
func RemoteAccessDisabled() bool
RemoteAccessDisabled checks if remote access is enabled/disabled by checking if the file /config/remote_access_disabled exists or not.
func RoundToMbytes ¶
RoundToMbytes - Byts convert to Mbytes with round-off
func UpdateLedManagerConfig ¶
func UpdateLedManagerConfig(log *base.LogObject, count types.LedBlinkCount)
UpdateLedManagerConfig is used by callers to change the behavior or the LED
Types ¶
type WatchdogKicker ¶
type WatchdogKicker struct {
// contains filtered or unexported fields
}
WatchdogKicker is used in some proc functions that have a timeout, to tell the watchdog agent is still alive.
func NewWatchdogKicker ¶
func NewWatchdogKicker(ps *pubsub.PubSub, agentName string, warnTime time.Duration, errTime time.Duration) *WatchdogKicker
NewWatchdogKicker creates a new WatchdogKick.