Documentation
¶
Index ¶
- Constants
- func BackoffRetry(ctx context.Context, maxAttempts int, f RetryFunc) error
- func CgroupPath(cgroupRoot, procRoot string, pid int) (string, error)
- func CheckHTTP(ctx context.Context, ID, url string, code int, timeout time.Duration) bool
- func CheckTCP(ctx context.Context, ID string, backends []string, timeout time.Duration) bool
- func GetDevicePath(major, minor uint64) (string, error)
- func GetIP(endpoint string) string
- func LoadConfig(configPath string) (*types.Config, error)
- func ProcRoot() string
- func ReplaceNonUtf8(str string) string
- func UseLabelAsFilter() bool
- func WithTimeout(ctx context.Context, timeout time.Duration, f func(ctx2 context.Context))
- func WritePid(ctx context.Context, path string)
- type DirWatcher
- type GroupCAS
- type HashBackends
- type RetryFunc
- type RetryTask
Constants ¶
const CgroupRoot = "/sys/fs/cgroup"
CgroupRoot is where the unified cgroup v2 hierarchy is mounted.
Variables ¶
This section is empty.
Functions ¶
func BackoffRetry ¶
BackoffRetry runs f up to maxAttempts times, doubling the wait after each failure.
func CgroupPath ¶ added in v0.1.1
CgroupPath returns the absolute cgroup v2 directory of the process pid.
func CheckHTTP ¶
CheckHTTP reports whether url answers with the expected status code; an empty url passes.
func GetDevicePath ¶
func GetIP ¶
GetIP returns the host of a node endpoint, which is the only address a node record carries.
func LoadConfig ¶
LoadConfig loads the agent config from the YAML file at configPath.
func ProcRoot ¶ added in v0.1.1
func ProcRoot() string
ProcRoot returns where this agent reads the host's procfs.
func ReplaceNonUtf8 ¶
ReplaceNonUtf8 replaces non-utf8 characters in \x format.
func UseLabelAsFilter ¶
func UseLabelAsFilter() bool
func WithTimeout ¶
Types ¶
type DirWatcher ¶ added in v0.1.1
type DirWatcher struct {
// contains filtered or unexported fields
}
DirWatcher reports every entry that appears in or goes away from one directory.
func NewDirWatcher ¶ added in v0.1.1
func NewDirWatcher(dir string) (*DirWatcher, error)
NewDirWatcher arms an inotify watch on dir, so nothing that happens after it returns is missed.
type GroupCAS ¶
type GroupCAS struct {
// contains filtered or unexported fields
}
GroupCAS is a set of compare-and-swap locks keyed by string.
func NewGroupCAS ¶
func NewGroupCAS() *GroupCAS
type HashBackends ¶
type HashBackends struct {
// contains filtered or unexported fields
}
func NewHashBackends ¶
func NewHashBackends(data []string) *HashBackends