Documentation
¶
Index ¶
- Constants
- func CPUSetParse(s string) (sets.Int, error)
- func CheckIfProcCommRunning(procComm string) (bool, error)
- func Dial(unixSocketPath string, timeout time.Duration, opts ...grpc.DialOption) (*grpc.ClientConn, error)
- func GetAndUnmarshal(url string, v interface{}) error
- func GetProcessNameSpaceInode(pid int, ns NameSpaceKind) (uint64, error)
- func GetProcessNice(pid int) (int, error)
- func IsCommandInDState(command string) bool
- func IsKernelThread(pid int) (bool, error)
- func ListKsoftirqdProcesses() (map[int64]int, error)
- func NewDefaultHTTPClient() *http.Client
- func SetProcessNice(pid int, niceness int) error
- func SetupSignalHandler() context.Context
- type HTTPHandler
- type NameSpaceKind
- type StopControl
Constants ¶
const ( HTTPChainCredential = "credential" HTTPChainRateLimiter = "rateLimiter" HTTPChainMonitor = "monitor" )
const ( HTTPRequestCount = "http_request_count" HTTPAuthenticateFailed = "http_request_authenticate_failed" HTTPNoPermission = "http_request_no_permission" HTTPThrottled = "http_request_throttled" UserUnknown = "unknown" )
const (
KeyAuthInfo contextKey = "auth"
)
const PF_KTHREAD = 0x00200000
Variables ¶
This section is empty.
Functions ¶
func CPUSetParse ¶
CPUSetParse constructs an integer cpu set from a Linux CPU list formatted string. See: http://man7.org/linux/man-pages/man7/cpuset.7.html#FORMATS
func CheckIfProcCommRunning ¶ added in v0.5.32
CheckIfProcCommRunning check if there is a running process with specified proc comm
func Dial ¶
func Dial(unixSocketPath string, timeout time.Duration, opts ...grpc.DialOption) (*grpc.ClientConn, error)
func GetAndUnmarshal ¶
GetAndUnmarshal gets data from the given url and unmarshal it into the given struct.
func GetProcessNameSpaceInode ¶ added in v0.5.32
func GetProcessNameSpaceInode(pid int, ns NameSpaceKind) (uint64, error)
func GetProcessNice ¶ added in v0.5.32
func IsCommandInDState ¶ added in v0.5.12
IsCommandInDState checks if the specified command is in the D (uninterruptible sleep) state.
func IsKernelThread ¶ added in v0.5.32
func ListKsoftirqdProcesses ¶ added in v0.5.32
ListKsoftirqdProcesses list ksoftirqd processes, return value: cpu id as map key, ksoftirq pid as value
func NewDefaultHTTPClient ¶
NewDefaultHTTPClient returns a raw HTTP client.
func SetProcessNice ¶ added in v0.5.32
func SetupSignalHandler ¶
SetupSignalHandler registered for SIGTERM and SIGINT. A stop channel is returned which is closed on one of these signals. If a second signal is caught, the program is terminated with exit code 1.
Types ¶
type HTTPHandler ¶
type HTTPHandler struct {
// contains filtered or unexported fields
}
func NewHTTPHandler ¶
func NewHTTPHandler(enabled []string, skipAuthURLPrefix []string, strictAuthentication bool, emitter metrics.MetricEmitter) *HTTPHandler
func (*HTTPHandler) Run ¶
func (h *HTTPHandler) Run(ctx context.Context)
func (*HTTPHandler) WithAuthorization ¶ added in v0.4.0
func (h *HTTPHandler) WithAuthorization(auth authorization.AccessControl) error
func (*HTTPHandler) WithCredential ¶ added in v0.4.0
func (h *HTTPHandler) WithCredential(cred credential.Credential) error
func (*HTTPHandler) WithHandleChain ¶
func (h *HTTPHandler) WithHandleChain(f http.Handler) http.Handler
WithHandleChain builds handler chains for http.Handler
type NameSpaceKind ¶ added in v0.5.32
type NameSpaceKind string
const ( NetNS NameSpaceKind = "net" PidNS NameSpaceKind = "pid" MntNS NameSpaceKind = "mnt" UserNS NameSpaceKind = "user" UtsNS NameSpaceKind = "uts" IpcNS NameSpaceKind = "ipc" CgroupNS NameSpaceKind = "cgroup" )
type StopControl ¶
func NewStopControl ¶
func NewStopControl(stopTime time.Time) *StopControl
func (*StopControl) IsStopped ¶
func (sc *StopControl) IsStopped() bool
func (*StopControl) Stop ¶
func (sc *StopControl) Stop()
func (*StopControl) StopGracePeriodExpired ¶
func (sc *StopControl) StopGracePeriodExpired() bool