utils

package
v0.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 20, 2020 License: Apache-2.0 Imports: 12 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DumpJSON

func DumpJSON(r interface{}) string

DumpJSON dumps a json-compatible struct in human-readable form

func GetContainerCgroupDir

func GetContainerCgroupDir(subsystemDir, containerID string) string

GetContainerCgroupDir finds container path in one specified subsystem directory

func GetProcessInContainer

func GetProcessInContainer(cgroupParentDir, containerID string) ([]string, error)

GetProcessInContainer gets the IDs of all processes in the container.

func ParseEnabled

func ParseEnabled(value string) (bool, error)

ParseEnabled returns whether the given string represents an 'enabled' state.

func ServerActiveAt

func ServerActiveAt(socket string) bool

ServerActiveAt checks if a gRPC server is accepting connections at the socket.

func SortUint64s

func SortUint64s(a []uint64)

SortUint64s sorts a slice of uint64 in increasing order.

func WaitForServer

func WaitForServer(socket string, timeout time.Duration, opts ...interface{}) error

WaitForServer waits for a gRPC server to start accepting connections on a socket.

Types

type Uint64Slice

type Uint64Slice []uint64

Uint64Slice implmenents sort.Interface for a slice of uint64.

func (Uint64Slice) Len

func (s Uint64Slice) Len() int

Len returns the length of an UintSlice

func (Uint64Slice) Less

func (s Uint64Slice) Less(i, j int) bool

Less returns true if element at 'i' is less than the element at 'j'

func (Uint64Slice) Swap

func (s Uint64Slice) Swap(i, j int)

Swap swaps the values of two elements

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL