parse

package
v0.0.0-...-31c1c1e Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2022 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	LogHistory       int
	LogLines         int
	PreludeHeadLines int
	PreludeTailLines int
	Logger           log.Logger
	Collector        session.Collector
}

Config is the config for the Parser implementation

type Duration

type Duration struct {
	time.Duration
}

Duration represents a time.Duration

func (Duration) MarshalJSON

func (d Duration) MarshalJSON() ([]byte, error)

MarshalJSON marshals a time.Duration to JSON

func (*Duration) UnmarshalJSON

func (d *Duration) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals a JSON value to time.Duration. The JSON value can be either a float which is interpreted as seconds or a string that is interpreted as a formatted duration.

type Parser

type Parser interface {
	process.Parser

	// Progress returns the current progress information of the process
	Progress() app.Progress

	// Prelude returns an array of the lines before the progress information started
	Prelude() []string

	// Report returns the current logs
	Report() Report

	// ReportHistory returns an array of previews logs
	ReportHistory() []Report
}

Parser is an extension to the process.Parser interface

func New

func New(config Config) Parser

New returns a Parser that satisfies the Parser interface

type Report

type Report struct {
	CreatedAt time.Time
	Prelude   []string
	Log       []process.Line
}

Report represents a log report, including the prelude and the last log lines of the process.

Jump to

Keyboard shortcuts

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