Documentation ¶
Overview ¶
Package events contains code for writing task events to various systems.
Index ¶
- Constants
- Variables
- func LogTail(ctx context.Context, taskID string, attempt, index uint32, size int64, ...) (stdout, stderr io.Writer)
- func Marshal(ev *Event) (string, error)
- func ReadPubSub(ctx context.Context, conf config.PubSub, subname string, w Writer) error
- func RegisterEventServiceServer(s grpc.ServiceRegistrar, srv EventServiceServer)
- func StreamLogTail(ctx context.Context, taskID string, attempt, index uint32, size int64, ...) (stdout, stderr io.Writer)
- func Unmarshal(b []byte, ev *Event) error
- type Backend
- type Computer
- type ErrLogger
- type Event
- func NewEndTime(taskID string, attempt uint32, t time.Time) *Event
- func NewExecutorEndTime(taskID string, attempt uint32, index uint32, t time.Time) *Event
- func NewExecutorStartTime(taskID string, attempt uint32, index uint32, t time.Time) *Event
- func NewExitCode(taskID string, attempt uint32, index uint32, x int32) *Event
- func NewMetadata(taskID string, attempt uint32, m map[string]string) *Event
- func NewOutputs(taskID string, attempt uint32, f []*tes.OutputFileLog) *Event
- func NewStartTime(taskID string, attempt uint32, t time.Time) *Event
- func NewState(taskID string, s tes.State) *Event
- func NewStderr(taskID string, attempt uint32, index uint32, s string) *Event
- func NewStdout(taskID string, attempt uint32, index uint32, s string) *Event
- func NewSystemLog(taskID string, attempt uint32, index uint32, lvl string, msg string, ...) *Event
- func NewTaskCreated(task *tes.Task) *Event
- func (*Event) Descriptor() ([]byte, []int)deprecated
- func (x *Event) GetAttempt() uint32
- func (m *Event) GetData() isEvent_Data
- func (x *Event) GetEndTime() string
- func (x *Event) GetExitCode() int32
- func (x *Event) GetId() string
- func (x *Event) GetIndex() uint32
- func (x *Event) GetMetadata() *Metadata
- func (x *Event) GetOutputs() *Outputs
- func (x *Event) GetStartTime() string
- func (x *Event) GetState() tes.State
- func (x *Event) GetStderr() string
- func (x *Event) GetStdout() string
- func (x *Event) GetSystemLog() *SystemLog
- func (x *Event) GetTask() *tes.Task
- func (x *Event) GetTimestamp() string
- func (x *Event) GetType() Type
- func (*Event) ProtoMessage()
- func (x *Event) ProtoReflect() protoreflect.Message
- func (x *Event) Reset()
- func (x *Event) String() string
- func (s *Event) SysLogString() string
- type EventServiceClient
- type EventServiceServer
- type Event_EndTime
- type Event_ExitCode
- type Event_Metadata
- type Event_Outputs
- type Event_StartTime
- type Event_State
- type Event_Stderr
- type Event_Stdout
- type Event_SystemLog
- type Event_Task
- type ExecutorGenerator
- func (eg *ExecutorGenerator) Debug(msg string, args ...interface{}) *Event
- func (eg *ExecutorGenerator) EndTime(t time.Time) *Event
- func (eg *ExecutorGenerator) Error(msg string, args ...interface{}) *Event
- func (eg *ExecutorGenerator) ExitCode(x int) *Event
- func (eg *ExecutorGenerator) Info(msg string, args ...interface{}) *Event
- func (eg *ExecutorGenerator) StartTime(t time.Time) *Event
- func (eg *ExecutorGenerator) Stderr(s string) *Event
- func (eg *ExecutorGenerator) Stdout(s string) *Event
- type ExecutorWriter
- func (ew *ExecutorWriter) Debug(msg string, args ...interface{}) error
- func (ew *ExecutorWriter) EndTime(t time.Time) error
- func (ew *ExecutorWriter) Error(msg string, args ...interface{}) error
- func (ew *ExecutorWriter) ExitCode(x int) error
- func (ew *ExecutorWriter) Info(msg string, args ...interface{}) error
- func (ew *ExecutorWriter) LogTail(ctx context.Context, size int64) (stdout, stderr io.Writer)
- func (ew *ExecutorWriter) StartTime(t time.Time) error
- func (ew *ExecutorWriter) Stderr(s string) error
- func (ew *ExecutorWriter) Stdout(s string) error
- func (ew *ExecutorWriter) StreamLogTail(ctx context.Context, size int64, interval time.Duration, wg *sync.WaitGroup) (stdout, stderr io.Writer)
- type KafkaReader
- type KafkaWriter
- type Logger
- type Metadata
- type MultiWriter
- type Noop
- type Outputs
- type PubSubWriter
- type RPCWriter
- type Service
- type SystemLog
- func (*SystemLog) Descriptor() ([]byte, []int)deprecated
- func (x *SystemLog) GetFields() map[string]string
- func (x *SystemLog) GetLevel() string
- func (x *SystemLog) GetMsg() string
- func (*SystemLog) ProtoMessage()
- func (x *SystemLog) ProtoReflect() protoreflect.Message
- func (x *SystemLog) Reset()
- func (x *SystemLog) String() string
- type SystemLogFilter
- type SystemLogGenerator
- func (sle *SystemLogGenerator) Debug(msg string, args ...interface{}) *Event
- func (sle *SystemLogGenerator) Error(msg string, args ...interface{}) *Event
- func (sle *SystemLogGenerator) Info(msg string, args ...interface{}) *Event
- func (sle *SystemLogGenerator) Warn(msg string, args ...interface{}) *Event
- type SystemLogWriter
- type TaskBuilder
- type TaskGenerator
- func (eg *TaskGenerator) Debug(msg string, args ...interface{}) *Event
- func (eg *TaskGenerator) EndTime(t time.Time) *Event
- func (eg *TaskGenerator) Error(msg string, args ...interface{}) *Event
- func (eg *TaskGenerator) Info(msg string, args ...interface{}) *Event
- func (eg *TaskGenerator) Metadata(m map[string]string) *Event
- func (eg *TaskGenerator) Outputs(f []*tes.OutputFileLog) *Event
- func (eg *TaskGenerator) StartTime(t time.Time) *Event
- func (eg *TaskGenerator) State(s tes.State) *Event
- func (eg *TaskGenerator) Warn(msg string, args ...interface{}) *Event
- type TaskWriter
- func (ew *TaskWriter) Debug(msg string, args ...interface{}) error
- func (ew *TaskWriter) EndTime(t time.Time) error
- func (ew *TaskWriter) Error(msg string, args ...interface{}) error
- func (ew *TaskWriter) Info(msg string, args ...interface{}) error
- func (ew *TaskWriter) Metadata(m map[string]string) error
- func (ew *TaskWriter) NewExecutorWriter(index uint32) *ExecutorWriter
- func (ew *TaskWriter) Outputs(f []*tes.OutputFileLog) error
- func (ew *TaskWriter) StartTime(t time.Time) error
- func (ew *TaskWriter) State(s tes.State) error
- func (ew *TaskWriter) Warn(msg string, args ...interface{}) error
- type Type
- type UnimplementedEventServiceServer
- type UnsafeEventServiceServer
- type WriteEventResponse
- type Writer
Constants ¶
const (
EventService_WriteEvent_FullMethodName = "/events.EventService/WriteEvent"
)
Variables ¶
var ( Type_name = map[int32]string{ 0: "UNKNOWN", 1: "TASK_STATE", 2: "TASK_START_TIME", 3: "TASK_END_TIME", 4: "TASK_OUTPUTS", 5: "TASK_METADATA", 6: "EXECUTOR_START_TIME", 7: "EXECUTOR_END_TIME", 8: "EXECUTOR_EXIT_CODE", 11: "EXECUTOR_STDOUT", 12: "EXECUTOR_STDERR", 13: "SYSTEM_LOG", 14: "TASK_CREATED", } Type_value = map[string]int32{ "UNKNOWN": 0, "TASK_STATE": 1, "TASK_START_TIME": 2, "TASK_END_TIME": 3, "TASK_OUTPUTS": 4, "TASK_METADATA": 5, "EXECUTOR_START_TIME": 6, "EXECUTOR_END_TIME": 7, "EXECUTOR_EXIT_CODE": 8, "EXECUTOR_STDOUT": 11, "EXECUTOR_STDERR": 12, "SYSTEM_LOG": 13, "TASK_CREATED": 14, } )
Enum value maps for Type.
var EventService_ServiceDesc = grpc.ServiceDesc{ ServiceName: "events.EventService", HandlerType: (*EventServiceServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "WriteEvent", Handler: _EventService_WriteEvent_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "events.proto", }
EventService_ServiceDesc is the grpc.ServiceDesc for EventService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
var File_events_proto protoreflect.FileDescriptor
var Marshaler = &jsonpb.Marshaler{ EnumsAsInts: false, EmitDefaults: false, Indent: "\t", }
Marshaler provides a default JSON marshaler.
Functions ¶
func LogTail ¶
func LogTail(ctx context.Context, taskID string, attempt, index uint32, size int64, out Writer) (stdout, stderr io.Writer)
LogTail returns stdout/err io.Writers which will track the tail of the content (up to "size") and emit events once the ctx.Done is closed.
func ReadPubSub ¶
ReadPubSub reads events from the topic configured by "conf". The subscription "subname" will be created if it doesn't exist. This blocks until the context is canceled.
func RegisterEventServiceServer ¶
func RegisterEventServiceServer(s grpc.ServiceRegistrar, srv EventServiceServer)
func StreamLogTail ¶
func StreamLogTail(ctx context.Context, taskID string, attempt, index uint32, size int64, interval time.Duration, out Writer, wg *sync.WaitGroup) (stdout, stderr io.Writer)
StreamLogTail returns stdout/err io.Writers which will track the tail of the content (up to "size") and emit events. Events are rate limited by "interval", e.g. a max of one event every 5 seconds.
Types ¶
type Backend ¶
type Backend struct {
// contains filtered or unexported fields
}
func (Backend) CheckBackendParameterSupport ¶
type Event ¶
type Event struct { Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` Timestamp string `protobuf:"bytes,2,opt,name=timestamp,proto3" json:"timestamp,omitempty"` // Types that are assignable to Data: // // *Event_State // *Event_StartTime // *Event_EndTime // *Event_Outputs // *Event_Metadata // *Event_ExitCode // *Event_Stdout // *Event_Stderr // *Event_SystemLog // *Event_Task Data isEvent_Data `protobuf_oneof:"data"` Attempt uint32 `protobuf:"varint,16,opt,name=attempt,proto3" json:"attempt,omitempty"` Index uint32 `protobuf:"varint,17,opt,name=index,proto3" json:"index,omitempty"` Type Type `protobuf:"varint,18,opt,name=type,proto3,enum=events.Type" json:"type,omitempty"` // contains filtered or unexported fields }
func NewEndTime ¶
NewEndTime creates a task end time event.
func NewExecutorEndTime ¶
NewExecutorEndTime creates an executor end time event. for the executor at the given index.
func NewExecutorStartTime ¶
NewExecutorStartTime creates an executor start time event for the executor at the given index.
func NewExitCode ¶
NewExitCode creates an executor exit code event for the executor at the given index.
func NewMetadata ¶
NewMetadata creates a task metadata log event.
func NewOutputs ¶
func NewOutputs(taskID string, attempt uint32, f []*tes.OutputFileLog) *Event
NewOutputs creates a task output file log event.
func NewStartTime ¶
NewStartTime creates a task start time event.
func NewStderr ¶
NewStderr creates an executor stderr chunk event for the executor at the given index.
func NewStdout ¶
NewStdout creates an executor stdout chunk event for the executor at the given index.
func NewSystemLog ¶
func NewSystemLog(taskID string, attempt uint32, index uint32, lvl string, msg string, fields map[string]string) *Event
NewSystemLog creates an system log event.
func NewTaskCreated ¶
NewTaskCreated creates a state change event.
func (*Event) Descriptor
deprecated
func (*Event) GetAttempt ¶
func (*Event) GetEndTime ¶
func (*Event) GetExitCode ¶
func (*Event) GetMetadata ¶
func (*Event) GetOutputs ¶
func (*Event) GetStartTime ¶
func (*Event) GetSystemLog ¶
func (*Event) GetTimestamp ¶
func (*Event) ProtoMessage ¶
func (*Event) ProtoMessage()
func (*Event) ProtoReflect ¶
func (x *Event) ProtoReflect() protoreflect.Message
func (*Event) SysLogString ¶
SysLogString returns a flattened string representation of the SystemLog event
type EventServiceClient ¶
type EventServiceClient interface {
WriteEvent(ctx context.Context, in *Event, opts ...grpc.CallOption) (*WriteEventResponse, error)
}
EventServiceClient is the client API for EventService service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
func NewEventServiceClient ¶
func NewEventServiceClient(cc grpc.ClientConnInterface) EventServiceClient
type EventServiceServer ¶
type EventServiceServer interface { WriteEvent(context.Context, *Event) (*WriteEventResponse, error) // contains filtered or unexported methods }
EventServiceServer is the server API for EventService service. All implementations must embed UnimplementedEventServiceServer for forward compatibility
type Event_EndTime ¶
type Event_EndTime struct {
EndTime string `protobuf:"bytes,5,opt,name=end_time,json=endTime,proto3,oneof"`
}
type Event_ExitCode ¶
type Event_ExitCode struct {
ExitCode int32 `protobuf:"varint,10,opt,name=exit_code,json=exitCode,proto3,oneof"`
}
type Event_Metadata ¶
type Event_Metadata struct {
Metadata *Metadata `protobuf:"bytes,7,opt,name=metadata,proto3,oneof"`
}
type Event_Outputs ¶
type Event_Outputs struct {
Outputs *Outputs `protobuf:"bytes,6,opt,name=outputs,proto3,oneof"`
}
type Event_StartTime ¶
type Event_StartTime struct {
StartTime string `protobuf:"bytes,4,opt,name=start_time,json=startTime,proto3,oneof"`
}
type Event_State ¶
type Event_Stderr ¶
type Event_Stderr struct {
Stderr string `protobuf:"bytes,14,opt,name=stderr,proto3,oneof"`
}
type Event_Stdout ¶
type Event_Stdout struct {
Stdout string `protobuf:"bytes,13,opt,name=stdout,proto3,oneof"`
}
type Event_SystemLog ¶
type Event_SystemLog struct {
SystemLog *SystemLog `protobuf:"bytes,15,opt,name=system_log,json=systemLog,proto3,oneof"`
}
type Event_Task ¶
type ExecutorGenerator ¶
type ExecutorGenerator struct {
// contains filtered or unexported fields
}
ExecutorGenerator is a type that generates Events for an Executor of a Task
func NewExecutorGenerator ¶
func NewExecutorGenerator(taskID string, attempt uint32, index uint32) *ExecutorGenerator
NewExecutorGenerator returns a ExecutorGenerator instance.
func (*ExecutorGenerator) Debug ¶
func (eg *ExecutorGenerator) Debug(msg string, args ...interface{}) *Event
Debug creates a debug level system log message.
func (*ExecutorGenerator) EndTime ¶
func (eg *ExecutorGenerator) EndTime(t time.Time) *Event
EndTime updates an executor's end time log.
func (*ExecutorGenerator) Error ¶
func (eg *ExecutorGenerator) Error(msg string, args ...interface{}) *Event
Error creates an error level system log message.
func (*ExecutorGenerator) ExitCode ¶
func (eg *ExecutorGenerator) ExitCode(x int) *Event
ExitCode updates an executor's exit code log.
func (*ExecutorGenerator) Info ¶
func (eg *ExecutorGenerator) Info(msg string, args ...interface{}) *Event
Info creates an info level system log message.
func (*ExecutorGenerator) StartTime ¶
func (eg *ExecutorGenerator) StartTime(t time.Time) *Event
StartTime updates an executor's start time log.
func (*ExecutorGenerator) Stderr ¶
func (eg *ExecutorGenerator) Stderr(s string) *Event
Stderr appends to an executor's stderr log.
func (*ExecutorGenerator) Stdout ¶
func (eg *ExecutorGenerator) Stdout(s string) *Event
Stdout appends to an executor's stdout log.
type ExecutorWriter ¶
type ExecutorWriter struct {
// contains filtered or unexported fields
}
ExecutorWriter is a type that generates and writes executor events.
func NewExecutorWriter ¶
func NewExecutorWriter(taskID string, attempt uint32, index uint32, w Writer) *ExecutorWriter
NewExecutorWriter returns a ExecutorWriter instance.
func (*ExecutorWriter) Debug ¶
func (ew *ExecutorWriter) Debug(msg string, args ...interface{}) error
Debug writes a debug level system log message.
func (*ExecutorWriter) EndTime ¶
func (ew *ExecutorWriter) EndTime(t time.Time) error
EndTime updates the task's end time log.
func (*ExecutorWriter) Error ¶
func (ew *ExecutorWriter) Error(msg string, args ...interface{}) error
Error writes an error level system log message.
func (*ExecutorWriter) ExitCode ¶
func (ew *ExecutorWriter) ExitCode(x int) error
ExitCode updates an executor's exit code log.
func (*ExecutorWriter) Info ¶
func (ew *ExecutorWriter) Info(msg string, args ...interface{}) error
Info writes an info level system log message.
func (*ExecutorWriter) LogTail ¶
LogTail returns stdout/err io.Writers which will track the tail of the content (up to "size") and emit events.
func (*ExecutorWriter) StartTime ¶
func (ew *ExecutorWriter) StartTime(t time.Time) error
StartTime updates the task's start time log.
func (*ExecutorWriter) Stderr ¶
func (ew *ExecutorWriter) Stderr(s string) error
Stderr appends to an executor's stderr log.
func (*ExecutorWriter) Stdout ¶
func (ew *ExecutorWriter) Stdout(s string) error
Stdout appends to an executor's stdout log.
func (*ExecutorWriter) StreamLogTail ¶
func (ew *ExecutorWriter) StreamLogTail(ctx context.Context, size int64, interval time.Duration, wg *sync.WaitGroup) (stdout, stderr io.Writer)
StreamLogTail returns stdout/err io.Writers which will track the tail of the content (up to "size") and emit events. Events are rate limited by "interval", e.g. a max of one event every 5 seconds.
type KafkaReader ¶
type KafkaReader struct {
// contains filtered or unexported fields
}
KafkaReader reads events to a Kafka topic and writes them to a Writer.
func NewKafkaReader ¶
NewKafkaReader creates a new event reader for reading events from a Kafka topic and writing them to the given Writer.
type KafkaWriter ¶
type KafkaWriter struct {
// contains filtered or unexported fields
}
KafkaWriter writes events to a Kafka topic.
func NewKafkaWriter ¶
NewKafkaWriter creates a new event writer for writing events to a Kafka topic.
func (*KafkaWriter) Close ¶
func (k *KafkaWriter) Close()
func (*KafkaWriter) WriteEvent ¶
func (k *KafkaWriter) WriteEvent(ctx context.Context, ev *Event) error
WriteEvent writes the event. Events may be sent in batches in the background by the Kafka client library. Currently stdout, stderr, and system log events are dropped.
type Metadata ¶
type Metadata struct { Value map[string]string `` /* 151-byte string literal not displayed */ // contains filtered or unexported fields }
func (*Metadata) Descriptor
deprecated
func (*Metadata) ProtoMessage ¶
func (*Metadata) ProtoMessage()
func (*Metadata) ProtoReflect ¶
func (x *Metadata) ProtoReflect() protoreflect.Message
type MultiWriter ¶
type MultiWriter []Writer
MultiWriter allows writing an event to a list of Writers. Writing stops on the first error.
func (*MultiWriter) Close ¶
func (mw *MultiWriter) Close()
func (*MultiWriter) WriteEvent ¶
func (mw *MultiWriter) WriteEvent(ctx context.Context, ev *Event) error
WriteEvent writes an event to all the writers. Writing stops on the first error.
type Outputs ¶
type Outputs struct { Value []*tes.OutputFileLog `protobuf:"bytes,1,rep,name=value,proto3" json:"value,omitempty"` // contains filtered or unexported fields }
func (*Outputs) Descriptor
deprecated
func (*Outputs) GetValue ¶
func (x *Outputs) GetValue() []*tes.OutputFileLog
func (*Outputs) ProtoMessage ¶
func (*Outputs) ProtoMessage()
func (*Outputs) ProtoReflect ¶
func (x *Outputs) ProtoReflect() protoreflect.Message
type PubSubWriter ¶
type PubSubWriter struct {
// contains filtered or unexported fields
}
PubSubWriter writes events to Google Cloud Pub/Sub.
func NewPubSubWriter ¶
NewPubSubWriter creates a new PubSubWriter.
The given context is used to shut down the Pub/Sub client and flush any buffered messages.
Stdout, stderr, and system log events are not sent.
func (*PubSubWriter) Close ¶
func (p *PubSubWriter) Close()
func (*PubSubWriter) WriteEvent ¶
func (p *PubSubWriter) WriteEvent(ctx context.Context, ev *Event) error
WriteEvent writes an event to the configured Pub/Sub topic. Events are buffered and sent in batches by a background routine. Stdout, stderr, and system log events are not sent.
type RPCWriter ¶
type RPCWriter struct {
// contains filtered or unexported fields
}
RPCWriter is a type which writes Events to RPC.
func NewRPCWriter ¶
NewRPCWriter returns a new RPCWriter instance.
type Service ¶
type Service struct { UnimplementedEventServiceServer Writer }
Service is a wrapper for providing a Writer as a gRPC service.
func (*Service) WriteEvent ¶
WriteEvent accepts an RPC call and writes the event to the underlying server. WriteEventResponse is always empty, and the error value is the error from the undelrying Writer.
type SystemLog ¶
type SystemLog struct { Msg string `protobuf:"bytes,1,opt,name=msg,proto3" json:"msg,omitempty"` Level string `protobuf:"bytes,2,opt,name=level,proto3" json:"level,omitempty"` Fields map[string]string `` /* 153-byte string literal not displayed */ // contains filtered or unexported fields }
func (*SystemLog) Descriptor
deprecated
func (*SystemLog) ProtoMessage ¶
func (*SystemLog) ProtoMessage()
func (*SystemLog) ProtoReflect ¶
func (x *SystemLog) ProtoReflect() protoreflect.Message
type SystemLogFilter ¶
SystemLogFilter is an event writer implementation that filters system log events.
func (*SystemLogFilter) Close ¶
func (w *SystemLogFilter) Close()
func (*SystemLogFilter) WriteEvent ¶
func (w *SystemLogFilter) WriteEvent(ctx context.Context, ev *Event) error
WriteEvent writes an event to the writer. Writing stops on the first error.
type SystemLogGenerator ¶
type SystemLogGenerator struct {
// contains filtered or unexported fields
}
SystemLogGenerator is a type that emulates the logger interface and outputs Events.
func (*SystemLogGenerator) Debug ¶
func (sle *SystemLogGenerator) Debug(msg string, args ...interface{}) *Event
Debug creates an Event for a 'debug' level log message
func (*SystemLogGenerator) Error ¶
func (sle *SystemLogGenerator) Error(msg string, args ...interface{}) *Event
Error creates an Event for an 'error' level log message
func (*SystemLogGenerator) Info ¶
func (sle *SystemLogGenerator) Info(msg string, args ...interface{}) *Event
Info creates an Event for an 'info' level log message
func (*SystemLogGenerator) Warn ¶
func (sle *SystemLogGenerator) Warn(msg string, args ...interface{}) *Event
Warn creates an Event for an 'warning' level log message
type SystemLogWriter ¶
type SystemLogWriter struct {
// contains filtered or unexported fields
}
SystemLogWriter is a type that emulates the logger interface and outputs Events.
func (*SystemLogWriter) Debug ¶
func (sle *SystemLogWriter) Debug(msg string, args ...interface{}) error
Debug writes an for a 'debug' level log message
func (*SystemLogWriter) Error ¶
func (sle *SystemLogWriter) Error(msg string, args ...interface{}) error
Error writes an Event for an 'error' level log message
func (*SystemLogWriter) Info ¶
func (sle *SystemLogWriter) Info(msg string, args ...interface{}) error
Info writes an Event for an 'info' level log message
func (*SystemLogWriter) Warn ¶
func (sle *SystemLogWriter) Warn(msg string, args ...interface{}) error
Warn writes an Event for an 'warning' level log message
type TaskBuilder ¶
TaskBuilder aggregates events into an in-memory Task object.
func (TaskBuilder) Close ¶
func (tb TaskBuilder) Close()
func (TaskBuilder) WriteEvent ¶
func (tb TaskBuilder) WriteEvent(ctx context.Context, ev *Event) error
WriteEvent updates the Task object.
type TaskGenerator ¶
type TaskGenerator struct {
// contains filtered or unexported fields
}
TaskGenerator is a type that generates Events for a given Task execution attempt.
func NewTaskGenerator ¶
func NewTaskGenerator(taskID string, attempt uint32) *TaskGenerator
NewTaskGenerator creates a TaskGenerator instance.
func (*TaskGenerator) Debug ¶
func (eg *TaskGenerator) Debug(msg string, args ...interface{}) *Event
Debug creates a debug level system log message.
func (*TaskGenerator) EndTime ¶
func (eg *TaskGenerator) EndTime(t time.Time) *Event
EndTime updates the task's end time log.
func (*TaskGenerator) Error ¶
func (eg *TaskGenerator) Error(msg string, args ...interface{}) *Event
Error creates an error level system log message.
func (*TaskGenerator) Info ¶
func (eg *TaskGenerator) Info(msg string, args ...interface{}) *Event
Info creates an info level system log message.
func (*TaskGenerator) Metadata ¶
func (eg *TaskGenerator) Metadata(m map[string]string) *Event
Metadata updates the task's metadata log.
func (*TaskGenerator) Outputs ¶
func (eg *TaskGenerator) Outputs(f []*tes.OutputFileLog) *Event
Outputs updates the task's output file log.
func (*TaskGenerator) StartTime ¶
func (eg *TaskGenerator) StartTime(t time.Time) *Event
StartTime updates the task's start time log.
func (*TaskGenerator) State ¶
func (eg *TaskGenerator) State(s tes.State) *Event
State sets the state of the task.
func (*TaskGenerator) Warn ¶
func (eg *TaskGenerator) Warn(msg string, args ...interface{}) *Event
Warn creates a warning level system log message.
type TaskWriter ¶
type TaskWriter struct {
// contains filtered or unexported fields
}
TaskWriter is a type that generates and writes task events.
func NewTaskWriter ¶
func NewTaskWriter(taskID string, attempt uint32, w Writer) *TaskWriter
NewTaskWriter returns a TaskWriter instance.
func (*TaskWriter) Debug ¶
func (ew *TaskWriter) Debug(msg string, args ...interface{}) error
Debug creates a debug level system log message.
func (*TaskWriter) EndTime ¶
func (ew *TaskWriter) EndTime(t time.Time) error
EndTime updates the task's end time log.
func (*TaskWriter) Error ¶
func (ew *TaskWriter) Error(msg string, args ...interface{}) error
Error creates an error level system log message.
func (*TaskWriter) Info ¶
func (ew *TaskWriter) Info(msg string, args ...interface{}) error
Info creates an info level system log message.
func (*TaskWriter) Metadata ¶
func (ew *TaskWriter) Metadata(m map[string]string) error
Metadata updates the task's metadata log.
func (*TaskWriter) NewExecutorWriter ¶
func (ew *TaskWriter) NewExecutorWriter(index uint32) *ExecutorWriter
NewExecutorWriter returns a new ExecutorEventWriter instance that inherits its config from the Task
func (*TaskWriter) Outputs ¶
func (ew *TaskWriter) Outputs(f []*tes.OutputFileLog) error
Outputs updates the task's output file log.
func (*TaskWriter) StartTime ¶
func (ew *TaskWriter) StartTime(t time.Time) error
StartTime updates the task's start time log.
func (*TaskWriter) State ¶
func (ew *TaskWriter) State(s tes.State) error
State sets the state of the task.
func (*TaskWriter) Warn ¶
func (ew *TaskWriter) Warn(msg string, args ...interface{}) error
Warn creates a warning level system log message.
type Type ¶
type Type int32
const ( Type_UNKNOWN Type = 0 Type_TASK_STATE Type = 1 Type_TASK_START_TIME Type = 2 Type_TASK_END_TIME Type = 3 Type_TASK_OUTPUTS Type = 4 Type_TASK_METADATA Type = 5 Type_EXECUTOR_START_TIME Type = 6 Type_EXECUTOR_END_TIME Type = 7 Type_EXECUTOR_EXIT_CODE Type = 8 Type_EXECUTOR_STDOUT Type = 11 Type_EXECUTOR_STDERR Type = 12 Type_SYSTEM_LOG Type = 13 Type_TASK_CREATED Type = 14 )
func (Type) Descriptor ¶
func (Type) Descriptor() protoreflect.EnumDescriptor
func (Type) EnumDescriptor
deprecated
func (Type) Number ¶
func (x Type) Number() protoreflect.EnumNumber
func (Type) Type ¶
func (Type) Type() protoreflect.EnumType
type UnimplementedEventServiceServer ¶
type UnimplementedEventServiceServer struct { }
UnimplementedEventServiceServer must be embedded to have forward compatible implementations.
func (UnimplementedEventServiceServer) WriteEvent ¶
func (UnimplementedEventServiceServer) WriteEvent(context.Context, *Event) (*WriteEventResponse, error)
type UnsafeEventServiceServer ¶
type UnsafeEventServiceServer interface {
// contains filtered or unexported methods
}
UnsafeEventServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to EventServiceServer will result in compilation errors.
type WriteEventResponse ¶
type WriteEventResponse struct {
// contains filtered or unexported fields
}
func (*WriteEventResponse) Descriptor
deprecated
func (*WriteEventResponse) Descriptor() ([]byte, []int)
Deprecated: Use WriteEventResponse.ProtoReflect.Descriptor instead.
func (*WriteEventResponse) ProtoMessage ¶
func (*WriteEventResponse) ProtoMessage()
func (*WriteEventResponse) ProtoReflect ¶
func (x *WriteEventResponse) ProtoReflect() protoreflect.Message
func (*WriteEventResponse) Reset ¶
func (x *WriteEventResponse) Reset()
func (*WriteEventResponse) String ¶
func (x *WriteEventResponse) String() string