Documentation ¶
Index ¶
- Constants
- type Bus
- func (b *Bus) AddFormattedSubscriber(sub Subscriber)
- func (b *Bus) AddRawSubscriber(sub Subscriber)
- func (b *Bus) AddSubscriber(sub Subscriber)
- func (b *Bus) CreatedAt() time.Time
- func (b *Bus) FormattedWriter(targetID, commandID string) *FormattedWriter
- func (b *Bus) NowUnixNanos() uint64
- func (b *Bus) RemoveFormattedSubscriber(sub Subscriber)
- func (b *Bus) RemoveRawSubscriber(sub Subscriber)
- func (b *Bus) RemoveSubscriber(sub Subscriber)
- func (b *Bus) Run() *Run
- func (b *Bus) TsUnixNanos(t2 time.Time) uint64
- func (b *Bus) WriteDeltaManifest(dm *logstream.DeltaManifest)
- func (b *Bus) WriteFormattedLog(dfl *logstream.DeltaFormattedLog)
- func (b *Bus) WriteRawLog(dl *logstream.DeltaLog)
- type Command
- func (t *Command) AddDependsOn(targetID, refName string)
- func (c *Command) SetCached(cached bool)
- func (c *Command) SetEnd(end time.Time, status logstream.RunStatus, errorStr string)
- func (c *Command) SetEndError(err error)
- func (c *Command) SetName(name string)
- func (c *Command) SetProgress(progress int32)
- func (c *Command) SetStart(start time.Time)
- func (c *Command) TailOutput() []byte
- func (c *Command) Write(dt []byte, ts time.Time, stream int32) (int, error)
- type FormattedWriter
- type Generic
- type Run
- func (run *Run) Command(commandID string) (*Command, bool)
- func (run *Run) Generic() *Generic
- func (run *Run) NewCommand(commandID, command string, targetID, category, platform string, ...) (*Command, error)
- func (run *Run) NewTarget(targetID string, target domain.Target, overrideArgs []string, ...) (*Target, error)
- func (run *Run) SetEnd(end time.Time, status logstream.RunStatus)
- func (run *Run) SetFatalError(end time.Time, targetID string, commandID string, ...)
- func (run *Run) SetGenericFatalError(end time.Time, failureType logstream.FailureType, helpMsg, errorMsg string)
- func (run *Run) SetStart(start time.Time)
- func (run *Run) Target(targetID string) (*Target, bool)
- type Subscriber
- type Target
Constants ¶
const GenericDefault = "_generic:default"
GenericDefault is the internal name used to identify messages unrelated to a specific target or command.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Bus ¶
type Bus struct {
// contains filtered or unexported fields
}
Bus is a build log data bus. It listens for raw deltas via WriteDeltaManifest and WriteRawLog, passes them on to raw subscribers, who can then write formatted deltas back to the bus via WriteFormattedLog. The formatted deltas are then passed on to formatted subscribers.
func (*Bus) AddFormattedSubscriber ¶
func (b *Bus) AddFormattedSubscriber(sub Subscriber)
AddFormattedSubscriber adds a formatted subscriber to the bus. A formatted subscriber receives only the formatted deltas: DeltaFormattedLog.
func (*Bus) AddRawSubscriber ¶
func (b *Bus) AddRawSubscriber(sub Subscriber)
AddRawSubscriber adds a raw subscriber to the bus. A raw subscriber only receives the raw deltas: DeltaManifest and DeltaLog.
func (*Bus) AddSubscriber ¶
func (b *Bus) AddSubscriber(sub Subscriber)
AddSubscriber adds a subscriber to the bus. A subscriber receives both the raw and formatted deltas.
func (*Bus) FormattedWriter ¶
func (b *Bus) FormattedWriter(targetID, commandID string) *FormattedWriter
FormattedWriter returns a writer that writes formatted deltas to the bus.
func (*Bus) NowUnixNanos ¶
NowUnixNanos returns the current time in unix nanoseconds, ensuring monotonically increasing time.
func (*Bus) RemoveFormattedSubscriber ¶
func (b *Bus) RemoveFormattedSubscriber(sub Subscriber)
RemoveFormattedSubscriber removes a formatted subscriber from the bus.
func (*Bus) RemoveRawSubscriber ¶
func (b *Bus) RemoveRawSubscriber(sub Subscriber)
RemoveRawSubscriber removes a raw subscriber from the bus.
func (*Bus) RemoveSubscriber ¶
func (b *Bus) RemoveSubscriber(sub Subscriber)
RemoveSubscriber removes a subscriber from the bus.
func (*Bus) TsUnixNanos ¶
TsUnixNanos returns a given timestamp in unix nanoseconds, ensuring monotonically increasing time.
func (*Bus) WriteDeltaManifest ¶
func (b *Bus) WriteDeltaManifest(dm *logstream.DeltaManifest)
WriteDeltaManifest write a raw delta log to the bus.
func (*Bus) WriteFormattedLog ¶
func (b *Bus) WriteFormattedLog(dfl *logstream.DeltaFormattedLog)
WriteFormattedLog writes a formatted delta to the bus.
func (*Bus) WriteRawLog ¶
WriteRawLog write a raw delta log to the bus.
type Command ¶
type Command struct {
// contains filtered or unexported fields
}
Command is a build log writer for a command.
func (*Command) AddDependsOn ¶ added in v0.8.4
AddDependsOn creates a delta that will be used to merge the specified target ID & name into the command's list of targets on which it depends.
func (*Command) SetEndError ¶ added in v0.8.4
SetEndError is a helper that allows for setting expected end metadata on a command based on whether there was an error. Note, this method assumes the status values.
func (*Command) SetProgress ¶
SetProgress sets the progress of the command.
func (*Command) TailOutput ¶
TailOutput returns the tail of the output.
type FormattedWriter ¶
type FormattedWriter struct {
// contains filtered or unexported fields
}
FormattedWriter is a writer that produces DeltaFormattedLog messages.
func NewFormattedWriter ¶
func NewFormattedWriter(bus *Bus, targetID, commandID string) *FormattedWriter
NewFormattedWriter creates a new FormattedWriter.
type Generic ¶
type Generic struct {
// contains filtered or unexported fields
}
Generic is a generic writer for build output unrelated to a specific target.
func (*Generic) WithPrefix ¶
func (g *Generic) WithPrefix(category string) conslogging.PrefixWriter
WithPrefix returns a new Generic with the given prefix. This satisfies the conslogging.PrefixWriter interface.
type Run ¶
type Run struct {
// contains filtered or unexported fields
}
Run is a run logstream delta generator for a run.
func (*Run) Generic ¶
Generic returns a generic writer for build output unrelated to a specific target.
func (*Run) NewCommand ¶
func (run *Run) NewCommand(commandID, command string, targetID, category, platform string, cached, local, interactive bool, sourceLocation *spec.SourceLocation, repoURL, repoHash, fileRelToRepo string) (*Command, error)
NewCommand creates a new command printer.
func (*Run) NewTarget ¶
func (run *Run) NewTarget(targetID string, target domain.Target, overrideArgs []string, initialPlatform string, runner string) (*Target, error)
NewTarget creates a new target printer.
func (*Run) SetFatalError ¶
func (run *Run) SetFatalError(end time.Time, targetID string, commandID string, failureType logstream.FailureType, helpMsg, errorMsg string)
SetFatalError sets a fatal error for the build.
func (*Run) SetGenericFatalError ¶ added in v0.7.22
func (run *Run) SetGenericFatalError(end time.Time, failureType logstream.FailureType, helpMsg, errorMsg string)
SetGenericFatalError sets a fatal error for the build with an empty target id and a command id indicating not to prefix the error with target info.
type Subscriber ¶
Subscriber is an object that can receive deltas.
type Target ¶
type Target struct {
// contains filtered or unexported fields
}
Target is a delta generator for a target.
func (*Target) AddDependsOn ¶ added in v0.8.0
AddDependsOn creates a delta that will be used to merge the specified target ID into the current target's list of targets on which it depends.