Documentation
¶
Index ¶
- Constants
- Variables
- func Pipe() (Reader, Writer)
- func RecorderToContext(ctx context.Context, recorder *Recorder) context.Contextdeprecated
- func RegisterProgressServiceServer(s grpc.ServiceRegistrar, srv ProgressServiceServer)
- func ToContext(ctx context.Context, recorder *Recorder) context.Context
- func WriteMessage(out *termenv.Output, msg *Message) error
- type Discard
- type Group
- func (*Group) Descriptor() ([]byte, []int)deprecated
- func (x *Group) GetCompleted() *timestamppb.Timestamp
- func (x *Group) GetId() string
- func (x *Group) GetLabels() []*Label
- func (x *Group) GetName() string
- func (x *Group) GetParent() string
- func (x *Group) GetStarted() *timestamppb.Timestamp
- func (x *Group) GetWeak() bool
- func (*Group) ProtoMessage()
- func (x *Group) ProtoReflect() protoreflect.Message
- func (x *Group) Reset()
- func (x *Group) String() string
- type GroupOpt
- type Label
- type LogStream
- type Membership
- type Message
- func (*Message) Descriptor() ([]byte, []int)deprecated
- func (x *Message) GetCode() string
- func (x *Message) GetLabels() []*Label
- func (x *Message) GetLevel() MessageLevel
- func (x *Message) GetMessage() string
- func (*Message) ProtoMessage()
- func (x *Message) ProtoReflect() protoreflect.Message
- func (x *Message) Reset()
- func (x *Message) String() string
- type MessageLevel
- func (MessageLevel) Descriptor() protoreflect.EnumDescriptor
- func (x MessageLevel) Enum() *MessageLevel
- func (MessageLevel) EnumDescriptor() ([]byte, []int)deprecated
- func (x MessageLevel) Number() protoreflect.EnumNumber
- func (x MessageLevel) String() string
- func (MessageLevel) Type() protoreflect.EnumType
- type MessageOpt
- type Model
- type MultiWriter
- type ProgressServiceClient
- type ProgressServiceServer
- type ProgressService_WriteUpdatesClient
- type ProgressService_WriteUpdatesServer
- type RPCReceiver
- type RPCWriter
- type Reader
- type Recorder
- func (recorder *Recorder) Close() error
- func (recorder *Recorder) Complete()
- func (recorder *Recorder) Debug(msg string, opts ...MessageOpt)
- func (recorder *Recorder) Error(msg string, opts ...MessageOpt)
- func (recorder *Recorder) Join(vertexes ...digest.Digest)
- func (recorder *Recorder) Record(status *StatusUpdate) error
- func (recorder *Recorder) Vertex(dig digest.Digest, name string, opts ...VertexOpt) *VertexRecorder
- func (recorder *Recorder) Warn(msg string, opts ...MessageOpt)
- func (recorder *Recorder) WithGroup(name string, opts ...GroupOpt) *Recorder
- type RunFunc
- type StatusInfo
- type StatusUpdate
- func (*StatusUpdate) Descriptor() ([]byte, []int)deprecated
- func (x *StatusUpdate) GetGroups() []*Group
- func (x *StatusUpdate) GetLogs() []*VertexLog
- func (x *StatusUpdate) GetMemberships() []*Membership
- func (x *StatusUpdate) GetMessages() []*Message
- func (x *StatusUpdate) GetReceived() *timestamppb.Timestamp
- func (x *StatusUpdate) GetSent() *timestamppb.Timestamp
- func (x *StatusUpdate) GetTasks() []*VertexTask
- func (x *StatusUpdate) GetVertexes() []*Vertex
- func (*StatusUpdate) ProtoMessage()
- func (x *StatusUpdate) ProtoReflect() protoreflect.Message
- func (x *StatusUpdate) Reset()
- func (x *StatusUpdate) String() string
- type Tape
- func (tape *Tape) Activity(vtx *Vertex) VertexActivity
- func (tape *Tape) CachedCount() int
- func (tape *Tape) Close() error
- func (tape *Tape) Closed() bool
- func (tape *Tape) CompletedCount() int
- func (tape *Tape) Duration() time.Duration
- func (tape *Tape) EachVertex(f func(*Vertex, *ui.Vterm) error) error
- func (tape *Tape) ErroredCount() int
- func (tape *Tape) Focus(focused bool)
- func (tape *Tape) MessageLevel(level MessageLevel)
- func (tape *Tape) Render(w io.Writer, u *UI) error
- func (tape *Tape) RevealErrored(reveal bool)
- func (tape *Tape) RunningCount() int
- func (tape *Tape) RunningVertex() *Vertex
- func (tape *Tape) SetWindowSize(w, h int)
- func (tape *Tape) ShowAllOutput(show bool)
- func (tape *Tape) ShowInternal(show bool)
- func (tape *Tape) TotalCount() int
- func (tape *Tape) UncachedCount() int
- func (tape *Tape) VerboseEdges(verbose bool)
- func (tape *Tape) Vertices() []*Vertex
- func (tape *Tape) WriteStatus(status *StatusUpdate) error
- type TaskRecorder
- type TermSetupFunc
- type UI
- func (ui *UI) ParseFS(fs fs.FS, globs ...string) error
- func (u *UI) RenderStatus(w io.Writer, tape *Tape, infos []StatusInfo) error
- func (ui *UI) RenderTask(w io.Writer, v *VertexTask) error
- func (ui *UI) RenderTerm(w io.Writer, term *ui.Vterm) error
- func (ui *UI) RenderTrailer(w io.Writer, infos []StatusInfo) error
- func (ui *UI) RenderVertex(w io.Writer, v *Vertex) error
- func (ui *UI) RenderVertexTree(w io.Writer, v *Vertex) error
- func (u *UI) Run(ctx context.Context, tape *Tape, fn RunFunc) error
- func (ui *UI) SetWindowSize(width, height int)
- type UIClient
- type UnimplementedProgressServiceServer
- type UnsafeProgressServiceServer
- type Vertex
- func (*Vertex) Descriptor() ([]byte, []int)deprecated
- func (vertex *Vertex) Duration() time.Duration
- func (x *Vertex) GetCached() bool
- func (x *Vertex) GetCanceled() bool
- func (x *Vertex) GetCompleted() *timestamppb.Timestamp
- func (x *Vertex) GetError() string
- func (x *Vertex) GetFocused() bool
- func (x *Vertex) GetId() string
- func (x *Vertex) GetInputs() []string
- func (x *Vertex) GetInternal() bool
- func (x *Vertex) GetName() string
- func (x *Vertex) GetOutputs() []string
- func (x *Vertex) GetStarted() *timestamppb.Timestamp
- func (x *Vertex) GetZoomed() bool
- func (v *Vertex) HasInput(o *Vertex) bool
- func (*Vertex) ProtoMessage()
- func (x *Vertex) ProtoReflect() protoreflect.Message
- func (x *Vertex) Reset()
- func (x *Vertex) String() string
- type VertexActivity
- type VertexInstance
- type VertexLog
- func (*VertexLog) Descriptor() ([]byte, []int)deprecated
- func (x *VertexLog) GetData() []byte
- func (x *VertexLog) GetStream() LogStream
- func (x *VertexLog) GetTimestamp() *timestamppb.Timestamp
- func (x *VertexLog) GetVertex() string
- func (*VertexLog) ProtoMessage()
- func (x *VertexLog) ProtoReflect() protoreflect.Message
- func (x *VertexLog) Reset()
- func (x *VertexLog) String() string
- type VertexOpt
- type VertexRecorder
- func (recorder *VertexRecorder) Cached()
- func (recorder *VertexRecorder) Complete()
- func (recorder *VertexRecorder) Done(err error)
- func (recorder *VertexRecorder) Error(err error)
- func (recorder *VertexRecorder) Output(out digest.Digest)
- func (recorder *VertexRecorder) ProgressTask(total int64, msg string, args ...interface{}) *TaskRecorder
- func (recorder *VertexRecorder) Stderr() io.Writer
- func (recorder *VertexRecorder) Stdout() io.Writer
- func (recorder *VertexRecorder) Task(msg string, args ...interface{}) *TaskRecorder
- type VertexTask
- func (*VertexTask) Descriptor() ([]byte, []int)deprecated
- func (task *VertexTask) Duration() time.Duration
- func (x *VertexTask) GetCompleted() *timestamppb.Timestamp
- func (x *VertexTask) GetCurrent() int64
- func (x *VertexTask) GetName() string
- func (x *VertexTask) GetStarted() *timestamppb.Timestamp
- func (x *VertexTask) GetTotal() int64
- func (x *VertexTask) GetVertex() string
- func (*VertexTask) ProtoMessage()
- func (x *VertexTask) ProtoReflect() protoreflect.Message
- func (x *VertexTask) Reset()
- func (x *VertexTask) String() string
- type WaitWriter
- type Writer
Constants ¶
const (
ProgressService_WriteUpdates_FullMethodName = "/progrock.ProgressService/WriteUpdates"
)
const RootGroup = ""
RootGroup is the name of the outermost group.
Its value is blank, since it should never really be shown in the UI, since there isn't really a name that would make sense in all contexts. Instead the Root group should just be given special treatment, in whatever way makes sense to the user - for example, by only displaying its contents, as if each of its children were at the top level.
const RootID = "_root"
RootID is "_root", the static ID value set for all Root groups.
Note: all Root groups MUST have the same ID, so that there are never "multiple roots" - a truly unsettling concept.
Variables ¶
var ( LogStream_name = map[int32]string{ 0: "STDIN", 1: "STDOUT", 2: "STDERR", } LogStream_value = map[string]int32{ "STDIN": 0, "STDOUT": 1, "STDERR": 2, } )
Enum value maps for LogStream.
var ( MessageLevel_name = map[int32]string{ 0: "INVALID", -4: "DEBUG", 4: "WARNING", 8: "ERROR", } MessageLevel_value = map[string]int32{ "INVALID": 0, "DEBUG": -4, "WARNING": 4, "ERROR": 8, } )
Enum value maps for MessageLevel.
var Clock = clockwork.NewRealClock()
Clock is used to determine the current time.
var File_progress_proto protoreflect.FileDescriptor
var ProgressService_ServiceDesc = grpc.ServiceDesc{ ServiceName: "progrock.ProgressService", HandlerType: (*ProgressServiceServer)(nil), Methods: []grpc.MethodDesc{}, Streams: []grpc.StreamDesc{ { StreamName: "WriteUpdates", Handler: _ProgressService_WriteUpdates_Handler, ClientStreams: true, }, }, Metadata: "progress.proto", }
ProgressService_ServiceDesc is the grpc.ServiceDesc for ProgressService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterProgressServiceServer ¶ added in v0.5.0
func RegisterProgressServiceServer(s grpc.ServiceRegistrar, srv ProgressServiceServer)
Types ¶
type Discard ¶
type Discard struct{}
func (Discard) WriteStatus ¶
func (Discard) WriteStatus(*StatusUpdate) error
type Group ¶
type Group struct { // ID is an arbitrary identifier for the group. Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` // Parent is the ID of a parent group. Parent *string `protobuf:"bytes,2,opt,name=parent,proto3,oneof" json:"parent,omitempty"` // Name is a name for this group, relative to its parent. Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"` // Labels contains a series of name/value pairs. Labels []*Label `protobuf:"bytes,4,rep,name=labels,proto3" json:"labels,omitempty"` // Started is the timestamp that the group started. Started *timestamppb.Timestamp `protobuf:"bytes,5,opt,name=started,proto3" json:"started,omitempty"` // Completed is the timestamp that the group completed. Completed *timestamppb.Timestamp `protobuf:"bytes,6,opt,name=completed,proto3,oneof" json:"completed,omitempty"` // Weak indicates that the group should not be considered equal to non-weak // groups. Weak groups may be used to group together vertexes that correspond // to a single API (e.g. a Dockerfile build), as opposed to "strong" groups // explicitly configured by the user (e.g. "test", "build", etc). Weak bool `protobuf:"varint,7,opt,name=weak,proto3" json:"weak,omitempty"` // contains filtered or unexported fields }
Group is used to group related vertexes.
func (*Group) Descriptor
deprecated
func (*Group) GetCompleted ¶
func (x *Group) GetCompleted() *timestamppb.Timestamp
func (*Group) GetStarted ¶
func (x *Group) GetStarted() *timestamppb.Timestamp
func (*Group) ProtoMessage ¶
func (*Group) ProtoMessage()
func (*Group) ProtoReflect ¶
func (x *Group) ProtoReflect() protoreflect.Message
type GroupOpt ¶ added in v0.4.0
type GroupOpt func(*Group)
GroupOpt is an option for creating a Group.
func Weak ¶ added in v0.4.0
func Weak() GroupOpt
Weak indicates that the group should not be considered equal to non-weak groups. Weak groups may be used to group together vertexes that correspond to a single API (e.g. a Dockerfile build), as opposed to "strong" groups explicitly configured by the user (e.g. "test", "build", etc).
func WithGroupID ¶ added in v0.4.0
WithGroupID sets the ID for the group. An ID should be globally unique. If not specified, the ID defaults to the group's name with the group's start time appended.
func WithLabels ¶ added in v0.4.0
WithLabels sets labels on the group.
func WithStarted ¶ added in v0.4.0
WithStarted sets the start time of the group.
type Label ¶
type Label struct { // Name is the name of the label. // // Domain prefixes are a convention for disambiguation, such as // progrock.io/foo. Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` // Value is the value of the label. Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` // contains filtered or unexported fields }
Label is a name/value pair used for annotation.
func ErrorLabel ¶ added in v0.9.0
ErrorLabel is shorthand for Labelf("error", "%s", err).
func Labelf ¶ added in v0.9.0
Labelf is a convenience function for creating a Label from a format string and values.
If no values are given, format is used verbatim, so Labelf also doubles as a plain string value Label constructor.
func (*Label) Descriptor
deprecated
func (*Label) MessageOpt ¶ added in v0.9.0
MessageOpt adds the Label to the Message's labels.
func (*Label) ProtoMessage ¶
func (*Label) ProtoMessage()
func (*Label) ProtoReflect ¶
func (x *Label) ProtoReflect() protoreflect.Message
type LogStream ¶
type LogStream int32
LogStream is the standard stream that a log message was emitted to.
func (LogStream) Descriptor ¶
func (LogStream) Descriptor() protoreflect.EnumDescriptor
func (LogStream) EnumDescriptor
deprecated
func (LogStream) Number ¶
func (x LogStream) Number() protoreflect.EnumNumber
func (LogStream) Type ¶
func (LogStream) Type() protoreflect.EnumType
type Membership ¶ added in v0.2.0
type Membership struct { // Group is the ID of the group. Group string `protobuf:"bytes,1,opt,name=group,proto3" json:"group,omitempty"` // Vertexes is the set of vertex IDs that are members of the group. Vertexes []string `protobuf:"bytes,2,rep,name=vertexes,proto3" json:"vertexes,omitempty"` // contains filtered or unexported fields }
Membership declares a set of vertexes to be members of a group.
func (*Membership) Descriptor
deprecated
added in
v0.2.0
func (*Membership) Descriptor() ([]byte, []int)
Deprecated: Use Membership.ProtoReflect.Descriptor instead.
func (*Membership) GetGroup ¶ added in v0.2.0
func (x *Membership) GetGroup() string
func (*Membership) GetVertexes ¶ added in v0.2.0
func (x *Membership) GetVertexes() []string
func (*Membership) ProtoMessage ¶ added in v0.2.0
func (*Membership) ProtoMessage()
func (*Membership) ProtoReflect ¶ added in v0.2.0
func (x *Membership) ProtoReflect() protoreflect.Message
func (*Membership) Reset ¶ added in v0.2.0
func (x *Membership) Reset()
func (*Membership) String ¶ added in v0.2.0
func (x *Membership) String() string
type Message ¶ added in v0.8.0
type Message struct { // Message is the human-readable content of the message. Message string `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"` // Level indicates the severity of the message. Level MessageLevel `protobuf:"varint,2,opt,name=level,proto3,enum=progrock.MessageLevel" json:"level,omitempty"` // Code is an optional machine-readable name for the message, such as an // error code. It may be included for i10n. Code *string `protobuf:"bytes,3,opt,name=code,proto3,oneof" json:"code,omitempty"` // Labels contains a series of name/value pairs. Labels []*Label `protobuf:"bytes,4,rep,name=labels,proto3" json:"labels,omitempty"` // contains filtered or unexported fields }
Message is a message to display to the user at a global level.
func (*Message) Descriptor
deprecated
added in
v0.8.0
func (*Message) GetLevel ¶ added in v0.8.0
func (x *Message) GetLevel() MessageLevel
func (*Message) GetMessage ¶ added in v0.8.0
func (*Message) ProtoMessage ¶ added in v0.8.0
func (*Message) ProtoMessage()
func (*Message) ProtoReflect ¶ added in v0.8.0
func (x *Message) ProtoReflect() protoreflect.Message
type MessageLevel ¶ added in v0.8.0
type MessageLevel int32
MessageLevel indicates the severity of a message.
Note that there isn't an INFO level as Messages aren't meant to be used for general-purpose logging or updates; those should go through the regular vertex status update flow instead. Nevertheless, room has been left for more levels in the future, and the enum values are aligned with Go's log/slog package.
const ( // INVALID is not a valid message level. Protobuf requires the first enum // value to be 0, so here we are. // // In the future this _may_ become INFO, which would match Go's log/slog // package convention, but no promises! MessageLevel_INVALID MessageLevel = 0 // DEBUG indicates that the message should only be shown if debugging is // enabled. MessageLevel_DEBUG MessageLevel = -4 // WARNING indicates that the message should be shown to the user at all // times, but that execution of the program can continue as normal. MessageLevel_WARNING MessageLevel = 4 // ERROR indicates that the message should be shown to the user, and that // executation of the program cannot continue. MessageLevel_ERROR MessageLevel = 8 )
func (MessageLevel) Descriptor ¶ added in v0.8.0
func (MessageLevel) Descriptor() protoreflect.EnumDescriptor
func (MessageLevel) Enum ¶ added in v0.8.0
func (x MessageLevel) Enum() *MessageLevel
func (MessageLevel) EnumDescriptor
deprecated
added in
v0.8.0
func (MessageLevel) EnumDescriptor() ([]byte, []int)
Deprecated: Use MessageLevel.Descriptor instead.
func (MessageLevel) Number ¶ added in v0.8.0
func (x MessageLevel) Number() protoreflect.EnumNumber
func (MessageLevel) String ¶ added in v0.8.0
func (x MessageLevel) String() string
func (MessageLevel) Type ¶ added in v0.8.0
func (MessageLevel) Type() protoreflect.EnumType
type MessageOpt ¶ added in v0.8.0
type MessageOpt interface {
MessageOpt(*Message)
}
MessageOpt is an option for creating a Message.
func WithMessageCode ¶ added in v0.8.0
func WithMessageCode(code string) MessageOpt
WithMessageCode sets the message code.
func WithMessageLabels ¶ added in v0.8.0
func WithMessageLabels(labels ...*Label) MessageOpt
WithMessageLabels sets the message labels.
func WithMessageLevel ¶ added in v0.8.0
func WithMessageLevel(level MessageLevel) MessageOpt
WithMessageLevel sets the message level.
type Model ¶
type Model struct {
// contains filtered or unexported fields
}
func (*Model) PrintTrailer ¶ added in v0.6.0
func (*Model) SetStatusInfo ¶ added in v0.10.0
func (m *Model) SetStatusInfo(info StatusInfo)
type MultiWriter ¶
type MultiWriter []Writer
func (MultiWriter) Close ¶
func (mw MultiWriter) Close() error
func (MultiWriter) WriteStatus ¶
func (mw MultiWriter) WriteStatus(v *StatusUpdate) error
type ProgressServiceClient ¶ added in v0.5.0
type ProgressServiceClient interface {
WriteUpdates(ctx context.Context, opts ...grpc.CallOption) (ProgressService_WriteUpdatesClient, error)
}
ProgressServiceClient is the client API for ProgressService service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkgo.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
func NewProgressServiceClient ¶ added in v0.5.0
func NewProgressServiceClient(cc grpc.ClientConnInterface) ProgressServiceClient
type ProgressServiceServer ¶ added in v0.5.0
type ProgressServiceServer interface { WriteUpdates(ProgressService_WriteUpdatesServer) error // contains filtered or unexported methods }
ProgressServiceServer is the server API for ProgressService service. All implementations must embed UnimplementedProgressServiceServer for forward compatibility
type ProgressService_WriteUpdatesClient ¶ added in v0.5.0
type ProgressService_WriteUpdatesClient interface { Send(*StatusUpdate) error CloseAndRecv() (*emptypb.Empty, error) grpc.ClientStream }
type ProgressService_WriteUpdatesServer ¶ added in v0.5.0
type ProgressService_WriteUpdatesServer interface { SendAndClose(*emptypb.Empty) error Recv() (*StatusUpdate, error) grpc.ServerStream }
type RPCReceiver ¶
type RPCReceiver struct { UnimplementedProgressServiceServer // contains filtered or unexported fields }
RPCReceiver is a ProgressServiceServer that writes to a Writer.
func NewRPCReceiver ¶ added in v0.7.1
func NewRPCReceiver(w Writer) *RPCReceiver
NewRPCReceiver returns a new RPCReceiver.
func (*RPCReceiver) WriteUpdates ¶ added in v0.5.0
func (recv *RPCReceiver) WriteUpdates(srv ProgressService_WriteUpdatesServer) error
WriteUpdates implements ProgressServiceServer.
type RPCWriter ¶
type RPCWriter struct { Conn *grpc.ClientConn Updates ProgressService_WriteUpdatesClient // contains filtered or unexported fields }
RPCWriter is a Writer that writes to a ProgressService.
func NewRPCWriter ¶ added in v0.7.1
func NewRPCWriter(conn *grpc.ClientConn, updates ProgressService_WriteUpdatesClient) *RPCWriter
NewRPCWriter returns a new RPCWriter.
func (*RPCWriter) WriteStatus ¶
func (w *RPCWriter) WriteStatus(status *StatusUpdate) error
WriteStatus implements Writer.
type Reader ¶
type Reader interface {
ReadStatus() (*StatusUpdate, bool)
}
type Recorder ¶
type Recorder struct { Group *Group // contains filtered or unexported fields }
Recorder is a Writer that also tracks a current group.
func FromContext ¶ added in v0.10.0
FromContext returns the Recorder attached to the given context, or a no-op Recorder if none is attached.
func NewRecorder ¶
NewRecorder creates a new Recorder which writes to the given Writer.
It also initializes the "root" group and sends a progress update for the group.
func RecorderFromContext
deprecated
func WithGroup ¶ added in v0.2.0
WithGroup is shorthand for FromContext(ctx).WithGroup(name, opts...).
It returns a new context with the resulting Recorder attached.
func (*Recorder) Complete ¶
func (recorder *Recorder) Complete()
Complete marks any current group and all sub-groups as complete, and sends a progress update for each.
func (*Recorder) Debug ¶ added in v0.8.0
func (recorder *Recorder) Debug(msg string, opts ...MessageOpt)
Debug sends a progress update with a debug-level message.
func (*Recorder) Error ¶ added in v0.8.0
func (recorder *Recorder) Error(msg string, opts ...MessageOpt)
Warn sends a progress update with an error-level message.
func (*Recorder) Join ¶ added in v0.2.0
func (recorder *Recorder) Join(vertexes ...digest.Digest)
Join sends a progress update that the given vertexes are members of the current group.
If the Recorder does not have a group, it does nothing.
func (*Recorder) Record ¶
func (recorder *Recorder) Record(status *StatusUpdate) error
Record sends a deep-copy of the status update to the Writer.
func (*Recorder) Vertex ¶
func (recorder *Recorder) Vertex(dig digest.Digest, name string, opts ...VertexOpt) *VertexRecorder
Vertex creates a new VertexRecorder for the given vertex.
While the digest can technically be an arbitrary string, it is given a digest.Digest type hint to suggest that it should be content-addressed.
The vertex will be associated to the group of the Recorder. The root Recorder keeps track of all group memberships seen for a given digest, and will emit a union of all groups.
func (*Recorder) Warn ¶ added in v0.8.0
func (recorder *Recorder) Warn(msg string, opts ...MessageOpt)
Warn sends a progress update with a warning-level message.
type StatusInfo ¶ added in v0.6.0
type StatusUpdate ¶
type StatusUpdate struct { // Vertexes contains the set of vertex updates. Vertexes []*Vertex `protobuf:"bytes,1,rep,name=vertexes,proto3" json:"vertexes,omitempty"` // Tasks contains the set of tasks updates. Tasks []*VertexTask `protobuf:"bytes,2,rep,name=tasks,proto3" json:"tasks,omitempty"` // Logs contains the set of new log output. Logs []*VertexLog `protobuf:"bytes,3,rep,name=logs,proto3" json:"logs,omitempty"` // Groups contains a set of groups updates. Groups []*Group `protobuf:"bytes,4,rep,name=groups,proto3" json:"groups,omitempty"` // Memberships contains a set of membership updates. Memberships []*Membership `protobuf:"bytes,5,rep,name=memberships,proto3" json:"memberships,omitempty"` // Messages contains global messages to show to the user. Messages []*Message `protobuf:"bytes,6,rep,name=messages,proto3" json:"messages,omitempty"` // Sent is an optional timestamp that the status update was emitted. Sent *timestamppb.Timestamp `protobuf:"bytes,7,opt,name=sent,proto3,oneof" json:"sent,omitempty"` // Received is an optional timestamp that the status update was received. Received *timestamppb.Timestamp `protobuf:"bytes,8,opt,name=received,proto3,oneof" json:"received,omitempty"` // contains filtered or unexported fields }
StatusUpdate contains a snapshot of state updates for the graph.
func (*StatusUpdate) Descriptor
deprecated
func (*StatusUpdate) Descriptor() ([]byte, []int)
Deprecated: Use StatusUpdate.ProtoReflect.Descriptor instead.
func (*StatusUpdate) GetGroups ¶
func (x *StatusUpdate) GetGroups() []*Group
func (*StatusUpdate) GetLogs ¶
func (x *StatusUpdate) GetLogs() []*VertexLog
func (*StatusUpdate) GetMemberships ¶ added in v0.2.0
func (x *StatusUpdate) GetMemberships() []*Membership
func (*StatusUpdate) GetMessages ¶ added in v0.8.0
func (x *StatusUpdate) GetMessages() []*Message
func (*StatusUpdate) GetReceived ¶ added in v0.8.0
func (x *StatusUpdate) GetReceived() *timestamppb.Timestamp
func (*StatusUpdate) GetSent ¶ added in v0.8.0
func (x *StatusUpdate) GetSent() *timestamppb.Timestamp
func (*StatusUpdate) GetTasks ¶
func (x *StatusUpdate) GetTasks() []*VertexTask
func (*StatusUpdate) GetVertexes ¶
func (x *StatusUpdate) GetVertexes() []*Vertex
func (*StatusUpdate) ProtoMessage ¶
func (*StatusUpdate) ProtoMessage()
func (*StatusUpdate) ProtoReflect ¶
func (x *StatusUpdate) ProtoReflect() protoreflect.Message
func (*StatusUpdate) Reset ¶
func (x *StatusUpdate) Reset()
func (*StatusUpdate) String ¶
func (x *StatusUpdate) String() string
type Tape ¶ added in v0.1.1
type Tape struct {
// contains filtered or unexported fields
}
Tape is a Writer that collects all progress output for displaying in a terminal UI.
func (*Tape) Activity ¶ added in v0.8.0
func (tape *Tape) Activity(vtx *Vertex) VertexActivity
func (*Tape) CachedCount ¶ added in v0.10.0
CachedCount returns the number of cached vertexes. TODO: cache this
func (*Tape) Close ¶ added in v0.1.1
Close marks the Tape as done, which tells it to display all vertex output for the final render.
func (*Tape) CompletedCount ¶ added in v0.1.1
CompletedCount returns the number of completed vertexes. TODO: cache this
func (*Tape) Duration ¶ added in v0.10.0
Duration returns the duration that the Tape has been accepting updates until Close has been called.
func (*Tape) EachVertex ¶ added in v0.4.1
func (*Tape) ErroredCount ¶ added in v0.10.0
ErroredCount returns the number of errored vertexes. TODO: cache this
func (*Tape) MessageLevel ¶ added in v0.8.0
func (tape *Tape) MessageLevel(level MessageLevel)
MessageLevel sets the minimum level for messages to display.
func (*Tape) RevealErrored ¶ added in v0.10.0
RevealErrored sets whether to show errored vertexes even when they would otherwise not be shown (i.e. internal, or focusing). You may want to set this when debugging, or for features that might break when bootstrapping before a higher level error can be shown.
func (*Tape) RunningCount ¶ added in v0.10.0
UncachedCount returns the number of completed uncached vertexes. TODO: cache this
func (*Tape) RunningVertex ¶ added in v0.7.0
func (*Tape) SetWindowSize ¶ added in v0.1.1
SetWindowSize sets the size of the terminal UI, which influences the dimensions for vertex logs, progress bars, etc.
func (*Tape) ShowAllOutput ¶ added in v0.2.0
ShowAllOutput sets whether to show output even for successful vertexes.
func (*Tape) ShowInternal ¶ added in v0.1.1
ShowInternal sets whether to show internal vertexes in the output.
func (*Tape) TotalCount ¶ added in v0.1.1
TotalCount returns the total number of vertexes.
func (*Tape) UncachedCount ¶ added in v0.10.0
UncachedCount returns the number of completed uncached vertexes. TODO: cache this
func (*Tape) VerboseEdges ¶ added in v0.1.1
VerboseEdges sets whether to display edges between vertexes in the same group.
func (*Tape) WriteStatus ¶ added in v0.1.1
func (tape *Tape) WriteStatus(status *StatusUpdate) error
WriteStatus implements Writer by collecting vertex and task updates and writing vertex logs to internal virtual terminals.
type TaskRecorder ¶
type TaskRecorder struct { *VertexRecorder Task *VertexTask }
func (*TaskRecorder) Complete ¶
func (recorder *TaskRecorder) Complete()
func (*TaskRecorder) Current ¶
func (recorder *TaskRecorder) Current(cur int64)
func (*TaskRecorder) Done ¶
func (recorder *TaskRecorder) Done(err error)
func (*TaskRecorder) Progress ¶
func (recorder *TaskRecorder) Progress(cur, total int64)
func (*TaskRecorder) Start ¶
func (recorder *TaskRecorder) Start()
func (*TaskRecorder) Wrap ¶
func (recorder *TaskRecorder) Wrap(f func() error) error
type TermSetupFunc ¶ added in v0.10.0
TermSetupFunc is a function that gets called when the vertex's zoomed pane resizes. It returns an optional io.Writer for accepting user input.
type UI ¶
func (*UI) RenderStatus ¶
func (*UI) RenderTask ¶
func (ui *UI) RenderTask(w io.Writer, v *VertexTask) error
func (*UI) RenderTrailer ¶ added in v0.6.0
func (ui *UI) RenderTrailer(w io.Writer, infos []StatusInfo) error
func (*UI) RenderVertexTree ¶ added in v0.10.0
func (*UI) SetWindowSize ¶
type UIClient ¶ added in v0.10.0
type UIClient interface {
SetStatusInfo(StatusInfo)
}
UIClient is an interface for miscellaneous UI-only knobs.
type UnimplementedProgressServiceServer ¶ added in v0.5.0
type UnimplementedProgressServiceServer struct { }
UnimplementedProgressServiceServer must be embedded to have forward compatible implementations.
func (UnimplementedProgressServiceServer) WriteUpdates ¶ added in v0.5.0
func (UnimplementedProgressServiceServer) WriteUpdates(ProgressService_WriteUpdatesServer) error
type UnsafeProgressServiceServer ¶ added in v0.5.0
type UnsafeProgressServiceServer interface {
// contains filtered or unexported methods
}
UnsafeProgressServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to ProgressServiceServer will result in compilation errors.
type Vertex ¶
type Vertex struct { // ID is a unique identifier for the vertex, such as a digest. Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` // Name is a user-visible name for the vertex. Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` // Inputs contains IDs of vertices that this vertex depends on. Inputs []string `protobuf:"bytes,3,rep,name=inputs,proto3" json:"inputs,omitempty"` // Outputs contains IDs of vertices that this vertex created. // // The intention is to allow a vertex to express that it created other // vertexes which may not maintain an input relationship to its creator, for // example an API request that created an object that may have otherwise been // created in some other way. Outputs []string `protobuf:"bytes,4,rep,name=outputs,proto3" json:"outputs,omitempty"` // Started is the time that the vertex started evaluating. Started *timestamppb.Timestamp `protobuf:"bytes,5,opt,name=started,proto3,oneof" json:"started,omitempty"` // Completed is the time that the vertex finished evaluating. Completed *timestamppb.Timestamp `protobuf:"bytes,6,opt,name=completed,proto3,oneof" json:"completed,omitempty"` // Cached indicates whether the vertex resulted in a cache hit. Cached bool `protobuf:"varint,7,opt,name=cached,proto3" json:"cached,omitempty"` // Error is the error message, if any, that occurred while evaluating the // vertex. Error *string `protobuf:"bytes,8,opt,name=error,proto3,oneof" json:"error,omitempty"` // Canceled indicates whether the vertex was interrupted. Canceled bool `protobuf:"varint,9,opt,name=canceled,proto3" json:"canceled,omitempty"` // Internal indicates that the vertex should not visible to the user by // default, but may be revealed with a flag. Internal bool `protobuf:"varint,10,opt,name=internal,proto3" json:"internal,omitempty"` // Focused indicates that the vertex is more important than other vertices, // and should perhaps be displayed more prominently. For example, this might // be used to mark the command that actually "does the thing" - runs the // tests, does a build, whatever. Focused bool `protobuf:"varint,11,opt,name=focused,proto3" json:"focused,omitempty"` // Zoomed indicates that this vertex should take up as much // screen real estate as possible. For example, this might // be used for running an interactive shell, or running // anything where there is a single primary output. Zoomed bool `protobuf:"varint,12,opt,name=zoomed,proto3" json:"zoomed,omitempty"` // contains filtered or unexported fields }
Vertex is a node in the graph of work to be done.
func (*Vertex) Descriptor
deprecated
func (*Vertex) GetCanceled ¶
func (*Vertex) GetCompleted ¶
func (x *Vertex) GetCompleted() *timestamppb.Timestamp
func (*Vertex) GetFocused ¶ added in v0.7.0
func (*Vertex) GetInternal ¶
func (*Vertex) GetOutputs ¶
func (*Vertex) GetStarted ¶
func (x *Vertex) GetStarted() *timestamppb.Timestamp
func (*Vertex) ProtoMessage ¶
func (*Vertex) ProtoMessage()
func (*Vertex) ProtoReflect ¶
func (x *Vertex) ProtoReflect() protoreflect.Message
type VertexActivity ¶ added in v0.8.0
type VertexInstance ¶ added in v0.1.2
VertexInstance identifies a vertex at a specific point in time.
type VertexLog ¶
type VertexLog struct { // Vertex is the ID of the vertex that emitted the log message. Vertex string `protobuf:"bytes,1,opt,name=vertex,proto3" json:"vertex,omitempty"` // Stream is the stream that the log message was emitted to. Stream LogStream `protobuf:"varint,2,opt,name=stream,proto3,enum=progrock.LogStream" json:"stream,omitempty"` // Data is the chunk of log output. Data []byte `protobuf:"bytes,3,opt,name=data,proto3" json:"data,omitempty"` // Timestamp is the time that the log message was emitted. Timestamp *timestamppb.Timestamp `protobuf:"bytes,4,opt,name=timestamp,proto3" json:"timestamp,omitempty"` // contains filtered or unexported fields }
VertexLog is a log message from a vertex.
func (*VertexLog) Descriptor
deprecated
func (*VertexLog) GetTimestamp ¶
func (x *VertexLog) GetTimestamp() *timestamppb.Timestamp
func (*VertexLog) ProtoMessage ¶
func (*VertexLog) ProtoMessage()
func (*VertexLog) ProtoReflect ¶
func (x *VertexLog) ProtoReflect() protoreflect.Message
type VertexOpt ¶
type VertexOpt func(*Vertex)
VertexOpt is an option for creating a Vertex.
func Focused ¶ added in v0.7.0
func Focused() VertexOpt
Focused marks the vertex as focused, indicating it should be shown in the UI when in focus mode.
func Internal ¶
func Internal() VertexOpt
Internal marks the vertex as internal, meaning it will not be included in progress output by default.
func WithInputs ¶
func WithInputs(inputs ...digest.Digest) VertexOpt
WithInputs sets the inputs for the vertex.
func Zoomed ¶ added in v0.10.0
func Zoomed(setup TermSetupFunc) VertexOpt
Zoomed marks the vertex as zoomed, indicating it should take up as much screen space as possible.
type VertexRecorder ¶
VertexRecorder records updates pertaining to a vertex.
func (*VertexRecorder) Cached ¶
func (recorder *VertexRecorder) Cached()
Cached marks the vertex as cached and sends an update.
func (*VertexRecorder) Complete ¶
func (recorder *VertexRecorder) Complete()
Complete marks the vertex as completed and sends an update.
func (*VertexRecorder) Done ¶
func (recorder *VertexRecorder) Done(err error)
func (*VertexRecorder) Error ¶
func (recorder *VertexRecorder) Error(err error)
Error marks the vertex as errored and sends an update.
If the error is context.Canceled or has it as a string suffix, the vertex will be marked as canceled instead.
func (*VertexRecorder) Output ¶
func (recorder *VertexRecorder) Output(out digest.Digest)
Output records an output digest for the vertex and sends an update.
func (*VertexRecorder) ProgressTask ¶
func (recorder *VertexRecorder) ProgressTask(total int64, msg string, args ...interface{}) *TaskRecorder
ProgressTask starts a task for the vertex and sends an update.
The task update includes the total value, which can be incremented with the returned recorder.
func (*VertexRecorder) Stderr ¶
func (recorder *VertexRecorder) Stderr() io.Writer
Stderr returns an io.Writer that sends log updates for the STDERR stream.
func (*VertexRecorder) Stdout ¶
func (recorder *VertexRecorder) Stdout() io.Writer
Stdout returns an io.Writer that sends log updates for the STDOUT stream.
func (*VertexRecorder) Task ¶
func (recorder *VertexRecorder) Task(msg string, args ...interface{}) *TaskRecorder
Task starts a task for the vertex and sends an update.
type VertexTask ¶
type VertexTask struct { // Vertex is the ID of the vertex that is performing the task. Vertex string `protobuf:"bytes,1,opt,name=vertex,proto3" json:"vertex,omitempty"` // Name is the user-visible name of the task. Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` // Total is the total number of units of work to be done, such as the number // of bytes to be downloaded. Total int64 `protobuf:"varint,3,opt,name=total,proto3" json:"total,omitempty"` // Current is the number of units of work that have been completed. Current int64 `protobuf:"varint,4,opt,name=current,proto3" json:"current,omitempty"` // Started is the time that the task started. Started *timestamppb.Timestamp `protobuf:"bytes,5,opt,name=started,proto3,oneof" json:"started,omitempty"` // Completed is the time that the task finished. Completed *timestamppb.Timestamp `protobuf:"bytes,6,opt,name=completed,proto3,oneof" json:"completed,omitempty"` // contains filtered or unexported fields }
VertexTask is a task that a vertex is performing.
func (*VertexTask) Descriptor
deprecated
func (*VertexTask) Descriptor() ([]byte, []int)
Deprecated: Use VertexTask.ProtoReflect.Descriptor instead.
func (*VertexTask) Duration ¶
func (task *VertexTask) Duration() time.Duration
func (*VertexTask) GetCompleted ¶
func (x *VertexTask) GetCompleted() *timestamppb.Timestamp
func (*VertexTask) GetCurrent ¶
func (x *VertexTask) GetCurrent() int64
func (*VertexTask) GetName ¶
func (x *VertexTask) GetName() string
func (*VertexTask) GetStarted ¶
func (x *VertexTask) GetStarted() *timestamppb.Timestamp
func (*VertexTask) GetTotal ¶
func (x *VertexTask) GetTotal() int64
func (*VertexTask) GetVertex ¶
func (x *VertexTask) GetVertex() string
func (*VertexTask) ProtoMessage ¶
func (*VertexTask) ProtoMessage()
func (*VertexTask) ProtoReflect ¶
func (x *VertexTask) ProtoReflect() protoreflect.Message
func (*VertexTask) Reset ¶
func (x *VertexTask) Reset()
func (*VertexTask) String ¶
func (x *VertexTask) String() string
type WaitWriter ¶
type WaitWriter struct { Writer // contains filtered or unexported fields }
WaitWriter is a Writer that waits for the RPC server to stop before closing the underlying Writer.
func (WaitWriter) Close ¶
func (ww WaitWriter) Close() error
Close waits for the RPC server to stop and closes the underlying Writer.
type Writer ¶
type Writer interface { WriteStatus(*StatusUpdate) error Close() error }