Documentation ¶
Index ¶
Constants ¶
const ( // fixed width version of time.RFC3339Nano RFC3339NanoFixed = "2006-01-02T15:04:05.000000000Z07:00" // variable width RFC3339 time format for lenient parsing of strings into timestamps RFC3339NanoLenient = "2006-01-02T15:04:05.999999999Z07:00" )
Variables ¶
This section is empty.
Functions ¶
func FindTailLineStartIndex ¶
func FindTailLineStartIndex(f io.ReadSeeker, n int64) (int64, error)
FindTailLineStartIndex returns the start of last nth line. * If n < 0, return the beginning of the file. * If n >= 0, return the beginning of last nth line. Notice that if the last line is incomplete (no end-of-line), it will not be counted as one line.
func ReadAtMost ¶
ReadAtMost reads at most max bytes from the end of the file identified by path or returns an error. It returns true if the file was longer than max. It will allocate up to max bytes.
func ReadLogs ¶
func ReadLogs(ctx context.Context, path, containerID string, opts *LogOptions, runtimeService runtimeapi.RuntimeServiceClient, stdout, stderr io.Writer) error
Readlogs read the container log and redirect into stdout and stderr. Note that containerID is only needed when following the log, or else just pass in empty string "".
Types ¶
type LogOptions ¶
type LogOptions struct {
// contains filtered or unexported fields
}
LogOptions is the CRI interval type of all log options.
func NewLogOptions ¶
func NewLogOptions(apiOpts *compute.PodLogOptions, now time.Time) *LogOptions
NewLogOptions convert the PodLogOptions to CRI internal LogOptions.