package util

Import Path
	github.com/prometheus/procfs/internal/util (on go.dev)

Dependency Relation
	imports 6 packages, and imported by one package


Package-Level Type Names (only one, which is exported)
/* sort exporteds by: | */
A ValueParser enables parsing a single string into a variety of data types in a concise and safe way. The Err method must be invoked after invoking any other methods to ensure a value was successfully parsed. Err returns the last error, if any, encountered by the ValueParser. Int interprets the underlying value as an int and returns that value. PInt64 interprets the underlying value as an int64 and returns a pointer to that value. PUInt64 interprets the underlying value as an uint64 and returns a pointer to that value. func NewValueParser(v string) *ValueParser
Package-Level Functions (total 8, all are exported)
NewValueParser creates a ValueParser using the input string.
ParseBool parses a string into a boolean pointer.
ParsePInt64s parses a slice of strings into a slice of int64 pointers.
ParseUint32s parses a slice of strings into a slice of uint32s.
ParseUint64s parses a slice of strings into a slice of uint64s.
ReadFileNoStat uses ioutil.ReadAll to read contents of entire file. This is similar to ioutil.ReadFile but without the call to os.Stat, because many files in /proc and /sys report incorrect file sizes (either 0 or 4096). Reads a max file size of 512kB. For files larger than this, a scanner should be used.
ReadUintFromFile reads a file and attempts to parse a uint64 from it.
SysReadFile is here implemented as a noop for builds that do not support the read syscall. For example Windows, or Linux on Google App Engine.