Documentation
¶
Index ¶
- func AddOutputFlags(cmd *cobra.Command, flags *OutputFlags)
- func AddPaginationFlags(cmd *cobra.Command, flags *PaginationFlags, defaultLimit int32)
- func AddSuggestFlags(cmd *cobra.Command, flags *SuggestFlags)
- func AddTimeRangeFlags(cmd *cobra.Command, flags *TimeRangeFlags, defaultStart string)
- func CreatePrinter(printFlags *genericclioptions.PrintFlags) (printers.ResourcePrinter, error)
- func CreateTablePrinter(noHeaders bool) printers.ResourcePrinter
- func EscapeCELString(s string) string
- func EscapeFieldSelectorValue(s string) (string, error)
- func IsDefaultOutputFormat(printFlags *genericclioptions.PrintFlags) bool
- func PrintActivityFacets(ctx context.Context, client *clientset.Clientset, ...) error
- func PrintAuditLogFacets(ctx context.Context, client *clientset.Clientset, ...) error
- func PrintEventFacets(ctx context.Context, client *clientset.Clientset, ...) error
- func PrintFacetTable(facet activityv1alpha1.FacetResult, out io.Writer) error
- func SupportsColor(out io.Writer) bool
- func ValidateEventType(t string) error
- type OutputFlags
- type PaginationFlags
- type SuggestFlags
- type TablePrinter
- type TimeRangeFlags
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddOutputFlags ¶
func AddOutputFlags(cmd *cobra.Command, flags *OutputFlags)
AddOutputFlags adds output flags to a command
func AddPaginationFlags ¶
func AddPaginationFlags(cmd *cobra.Command, flags *PaginationFlags, defaultLimit int32)
AddPaginationFlags adds pagination flags to a command
func AddSuggestFlags ¶
func AddSuggestFlags(cmd *cobra.Command, flags *SuggestFlags)
AddSuggestFlags adds suggest flag to a command
func AddTimeRangeFlags ¶
func AddTimeRangeFlags(cmd *cobra.Command, flags *TimeRangeFlags, defaultStart string)
AddTimeRangeFlags adds time range flags to a command
func CreatePrinter ¶
func CreatePrinter(printFlags *genericclioptions.PrintFlags) (printers.ResourcePrinter, error)
CreatePrinter creates a printer based on output format
func CreateTablePrinter ¶
func CreateTablePrinter(noHeaders bool) printers.ResourcePrinter
CreateTablePrinter creates a configured table printer for consistent table output
func EscapeCELString ¶
EscapeCELString escapes single quotes in a string to make it safe for use in a CEL string literal. Single quotes are escaped by replacing ' with \' to prevent CEL filter injection attacks.
Example:
EscapeCELString("my-namespace") -> "my-namespace"
EscapeCELString("prod' || true || '") -> "prod\\' || true || \\'"
func EscapeFieldSelectorValue ¶
EscapeFieldSelectorValue escapes special characters in a field selector value to prevent field selector injection. Field selectors use = and , as delimiters, so these must be escaped or rejected.
Example:
EscapeFieldSelectorValue("Normal") -> "Normal"
EscapeFieldSelectorValue("type=Warning") -> error
func IsDefaultOutputFormat ¶
func IsDefaultOutputFormat(printFlags *genericclioptions.PrintFlags) bool
IsDefaultOutputFormat checks if using default (table) output
func PrintActivityFacets ¶
func PrintActivityFacets(ctx context.Context, client *clientset.Clientset, field, startTime, endTime, filter string, out io.Writer) error
PrintActivityFacets executes and prints an activity facet query
func PrintAuditLogFacets ¶
func PrintAuditLogFacets(ctx context.Context, client *clientset.Clientset, field, startTime, endTime, filter string, out io.Writer) error
PrintAuditLogFacets executes and prints an audit log facet query
func PrintEventFacets ¶
func PrintEventFacets(ctx context.Context, client *clientset.Clientset, field, startTime, endTime string, out io.Writer) error
PrintEventFacets executes and prints an event facet query
func PrintFacetTable ¶
func PrintFacetTable(facet activityv1alpha1.FacetResult, out io.Writer) error
PrintFacetTable prints a facet result as a table
func SupportsColor ¶
SupportsColor checks if the output stream supports ANSI color codes
func ValidateEventType ¶
ValidateEventType validates that an event type is one of the allowed values. Kubernetes only supports "Normal" and "Warning" event types.
Types ¶
type OutputFlags ¶
OutputFlags contains common output flags
type PaginationFlags ¶
PaginationFlags contains common pagination flags
func (*PaginationFlags) Validate ¶
func (f *PaginationFlags) Validate() error
Validate checks that pagination flags are valid
type SuggestFlags ¶
type SuggestFlags struct {
Suggest string
}
SuggestFlags contains facet query flags
func (*SuggestFlags) IsSuggestMode ¶
func (f *SuggestFlags) IsSuggestMode() bool
IsSuggestMode returns true if suggest mode is active
type TablePrinter ¶
type TablePrinter struct {
PrintFlags *genericclioptions.PrintFlags
IOStreams genericclioptions.IOStreams
NoHeaders bool
}
TablePrinter wraps the Kubernetes table printer with helper methods
func NewTablePrinter ¶
func NewTablePrinter(printFlags *genericclioptions.PrintFlags, ioStreams genericclioptions.IOStreams, noHeaders bool) *TablePrinter
NewTablePrinter creates a new table printer
func (*TablePrinter) PrintAllPagesInfo ¶
func (p *TablePrinter) PrintAllPagesInfo(totalCount int)
PrintAllPagesInfo prints info about fetched results
func (*TablePrinter) PrintPaginationInfo ¶
func (p *TablePrinter) PrintPaginationInfo(continueToken string, resultCount int)
PrintPaginationInfo prints pagination information to stderr
func (*TablePrinter) PrintTable ¶
func (p *TablePrinter) PrintTable(table *metav1.Table) error
PrintTable prints a table to the output stream
type TimeRangeFlags ¶
TimeRangeFlags contains common time range flags
func (*TimeRangeFlags) Validate ¶
func (f *TimeRangeFlags) Validate() error
Validate checks that time range flags are valid