config

package
v1.0.9 Latest Latest
Warning

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

Go to latest
Published: May 24, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package config defines the flag plumbing and runtime options shared by torque's logging commands, translating Cobra/Viper flag values into a strongly typed struct that the tailer and capture pipelines consume.

Index

Constants

View Source
const TimestampFormatYouTube = "youtube"

Variables

This section is empty.

Functions

func DefaultTemplate

func DefaultTemplate() string

DefaultTemplate exposes the default log template so other packages can compare against it safely.

Types

type Options

type Options struct {
	PodQuery              string
	Namespaces            []string
	AllNamespaces         bool
	LabelSelector         string
	FieldSelector         string
	ContainerFilters      []string
	ExcludeContainers     []string
	ExcludePods           []string
	ExcludeLine           string
	HighlightTerms        []string
	DiffContainer         bool
	Follow                bool
	NoFollow              bool
	Since                 time.Duration
	SinceRaw              string
	TailLines             int64
	ShowTimestamp         bool
	TimestampFormat       string
	Template              string
	TemplateFile          string
	OnlyLogLines          bool
	NoPrefix              bool
	PlainOutput           bool
	JSONOutput            bool
	ColorMode             string
	PodColorStrings       []string
	ContainerColorStrings []string
	OutputFormat          string
	Events                bool
	EventsOnly            bool
	KubeConfigPath        string
	Context               string
	Stdin                 bool
	ContainerRegex        []*regexp.Regexp
	ExcludeRegex          []*regexp.Regexp
	ExcludeLineRegex      *regexp.Regexp
	ExcludePodRegex       []*regexp.Regexp
	SearchRegex           []*regexp.Regexp
	TimeZone              string
	TimeLocation          *time.Location
	ConditionArgs         []string
	ConditionFilters      map[corev1.PodConditionType]corev1.ConditionStatus
	NodeLogs              bool
	NodeLogFiles          []string
	NodeLogAll            bool
	NodeLogsOnly          bool
	WSListenAddr          string
}

Options holds all CLI configuration used by the tailer.

func NewOptions

func NewOptions() *Options

NewOptions returns Options with defaults applied.

func (*Options) AddFlags

func (o *Options) AddFlags(cmd *cobra.Command)

AddFlags binds configuration flags to the provided Cobra command.

func (*Options) BindFlags

func (o *Options) BindFlags(fs *pflag.FlagSet) []string

BindFlags attaches log flags to an arbitrary FlagSet and returns the flag names for further customization.

func (*Options) Validate

func (o *Options) Validate() error

Validate ensures provided options are coherent and compiles regex inputs.

Jump to

Keyboard shortcuts

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