common

package
v11.3.3 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2022 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ShowClusterAlerts

func ShowClusterAlerts(ctx context.Context, client ClusterAlertGetter, w io.Writer, labels map[string]string, minSeverity, maxSeverity types.AlertSeverity) error

ShowClusterAlerts shows cluster alerts with the given labels and severity.

func ShowSessions

func ShowSessions(events []events.AuditEvent, format string, w io.Writer) error

ShowSessions is a helper function for displaying listed sessions via tsh or tctl.

Types

type ClusterAlertGetter

type ClusterAlertGetter interface {
	GetClusterAlerts(ctx context.Context, query types.GetClusterAlertsRequest) ([]types.ClusterAlert, error)
}

ClusterAlertGetter manages getting cluster alerts.

type ExitCodeError

type ExitCodeError struct {
	// Code is the exit code
	Code int
}

ExitCodeError wraps an exit code as an error.

func (*ExitCodeError) Error

func (e *ExitCodeError) Error() string

Error implements the error interface.

type SessionsCollection

type SessionsCollection struct {
	SessionEvents []events.AuditEvent
}

SessionsCollection is a collection of session end events.

func (*SessionsCollection) WriteJSON

func (e *SessionsCollection) WriteJSON(w io.Writer) error

WriteJSON writes the session collection as JSON to the provided io.Writer.

func (*SessionsCollection) WriteText

func (e *SessionsCollection) WriteText(w io.Writer) error

WriteText writes the session collection as text to the provided io.Writer.

func (*SessionsCollection) WriteYAML

func (e *SessionsCollection) WriteYAML(w io.Writer) error

WriteYAML writes the session collection as YAML to the provided io.Writer.

Jump to

Keyboard shortcuts

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