Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ParsePInt64s ¶
ParsePInt64s parses a slice of strings into a slice of int64 pointers.
func ParseUint32s ¶
ParseUint32s parses a slice of strings into a slice of uint32s.
func ParseUint64s ¶
ParseUint64s parses a slice of strings into a slice of uint64s.
func ReadUintFromFile ¶
ReadUintFromFile reads a file and attempts to parse a uint64 from it.
func SysReadFile ¶
SysReadFile is a simplified ioutil.ReadFile that invokes syscall.Read directly. https://github.com/Schneizelw/mtggokit/metrics/metricslog/node_exporter/pull/728/files
Types ¶
type ValueParser ¶
type ValueParser struct {
// contains filtered or unexported fields
}
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.
func NewValueParser ¶
func NewValueParser(v string) *ValueParser
NewValueParser creates a ValueParser using the input string.
func (*ValueParser) Err ¶
func (vp *ValueParser) Err() error
Err returns the last error, if any, encountered by the ValueParser.
func (*ValueParser) PInt64 ¶
func (vp *ValueParser) PInt64() *int64
PInt64 interprets the underlying value as an int64 and returns a pointer to that value.
func (*ValueParser) PUInt64 ¶
func (vp *ValueParser) PUInt64() *uint64
PUInt64 interprets the underlying value as an uint64 and returns a pointer to that value.