Documentation ¶
Index ¶
- Constants
- func ExpandContainerCommandOnlyStatic(containerCommand []string, envs []corev1.EnvVar) (command []string)
- func ExpandContainerVolumeMounts(mount corev1.VolumeMount, envs []corev1.EnvVar) (string, error)
- func GetTailLog(path string, tail int) ([]string, error)
- type LogLine
- type LogOptions
- type ReverseReader
Constants ¶
const ( // LogTimeFormat is the time format used in the log. // It is a modified version of RFC3339Nano that guarantees trailing // zeroes are not trimmed, taken from // https://github.com/golang/go/issues/19635 LogTimeFormat = "2006-01-02T15:04:05.000000000Z07:00" // PartialLogType signifies a log line that exceeded the buffer // length and needed to spill into a new line PartialLogType = "P" // FullLogType signifies a log line is full FullLogType = "F" // ANSIEscapeResetCode is a code that resets all colors and text effects ANSIEscapeResetCode = "\033[0m" )
Variables ¶
This section is empty.
Functions ¶
func ExpandContainerCommandOnlyStatic ¶
func ExpandContainerCommandOnlyStatic(containerCommand []string, envs []corev1.EnvVar) (command []string)
ExpandContainerCommandOnlyStatic substitutes only static environment variable values from the container environment definitions. This does *not* include valueFrom substitutions. TODO: callers should use ExpandContainerCommandAndArgs with a fully resolved list of environment.
func ExpandContainerVolumeMounts ¶
ExpandContainerVolumeMounts expands the subpath of the given VolumeMount by replacing variable references with the values of given EnvVar.
Types ¶
type LogLine ¶ added in v0.1.2
type LogLine struct { Device string ParseLogType string Time time.Time Msg string CID string CName string ColorID int64 }
LogLine describes the information for each line of a log
func NewLogLine ¶ added in v0.1.2
NewLogLine creates a logLine struct from a container log string
func (*LogLine) Partial ¶ added in v0.1.2
Partial returns a bool if the log line is a partial log type
func (*LogLine) Since ¶ added in v0.1.2
Since returns a bool as to whether a log line occurred after a given time
func (*LogLine) String ¶ added in v0.1.2
func (l *LogLine) String(options *LogOptions) string
String converts a log line to a string for output given whether a detail bool is specified.
type LogOptions ¶ added in v0.1.2
type LogOptions struct { Details bool Follow bool Since time.Time Until time.Time Tail int64 Timestamps bool Colors bool Multi bool WaitGroup *sync.WaitGroup UseName bool }
LogOptions is the options you can use for logs
type ReverseReader ¶ added in v0.1.2
type ReverseReader struct {
// contains filtered or unexported fields
}
ReverseReader structure for reading a file backwards
func NewReverseReader ¶ added in v0.1.2
func NewReverseReader(reader *os.File) (*ReverseReader, error)
NewReverseReader returns a reader that reads from the end of a file rather than the beginning. It sets the readsize to pagesize and determines the first offset using modulus.
func (*ReverseReader) Read ¶ added in v0.1.2
func (r *ReverseReader) Read() (string, error)
ReverseReader reads from a given offset to the previous offset and then sets the newoff set one pagesize less than the previous read.