Documentation ¶
Overview ¶
Package events is a generated protocol buffer package.
It is generated from these files:
events.proto
It has these top-level messages:
Metadata Outputs SystemLog Event CreateEventResponse
Index ¶
- Variables
- func Marshal(ev *Event) (string, error)
- func RegisterEventServiceServer(s *grpc.Server, srv EventServiceServer)
- func TailLogs(ctx context.Context, taskID string, attempt, index uint32, size int64, ...) (stdout, stderr io.Writer)
- func Unmarshal(b []byte, ev *Event) error
- type CreateEventResponse
- 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, attempt uint32, 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 (*Event) Descriptor() ([]byte, []int)
- func (m *Event) GetAttempt() uint32
- func (m *Event) GetData() isEvent_Data
- func (m *Event) GetEndTime() string
- func (m *Event) GetExitCode() int32
- func (m *Event) GetId() string
- func (m *Event) GetIndex() uint32
- func (m *Event) GetMetadata() *Metadata
- func (m *Event) GetOutputs() *Outputs
- func (m *Event) GetStartTime() string
- func (m *Event) GetState() tes.State
- func (m *Event) GetStderr() string
- func (m *Event) GetStdout() string
- func (m *Event) GetSystemLog() *SystemLog
- func (m *Event) GetTimestamp() string
- func (m *Event) GetType() Type
- func (*Event) ProtoMessage()
- func (m *Event) Reset()
- func (m *Event) String() string
- func (*Event) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, ...)
- 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 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) StartTime(t time.Time) error
- func (ew *ExecutorWriter) Stderr(s string) error
- func (ew *ExecutorWriter) Stdout(s string) error
- func (ew *ExecutorWriter) TailLogs(ctx context.Context, size int64, interval time.Duration) (stdout, stderr io.Writer)
- type KafkaReader
- type KafkaWriter
- type Logger
- type Metadata
- type Outputs
- type RPCWriter
- type SystemLog
- type SystemLogGenerator
- 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
- type TaskWriter
- func (ew *TaskWriter) Close() error
- 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
- type Type
- type Writer
Constants ¶
This section is empty.
Variables ¶
var Marshaler = &jsonpb.Marshaler{ EnumsAsInts: false, EmitDefaults: false, Indent: "\t", }
Marshaler provides a default JSON marshaler.
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",
}
var 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,
}
Functions ¶
func RegisterEventServiceServer ¶
func RegisterEventServiceServer(s *grpc.Server, srv EventServiceServer)
func TailLogs ¶
func TailLogs(ctx context.Context, taskID string, attempt, index uint32, size int64, interval time.Duration, out Writer) (stdout, stderr io.Writer)
TailLogs 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 CreateEventResponse ¶
type CreateEventResponse struct { }
func (*CreateEventResponse) Descriptor ¶
func (*CreateEventResponse) Descriptor() ([]byte, []int)
func (*CreateEventResponse) ProtoMessage ¶
func (*CreateEventResponse) ProtoMessage()
func (*CreateEventResponse) Reset ¶
func (m *CreateEventResponse) Reset()
func (*CreateEventResponse) String ¶
func (m *CreateEventResponse) String() string
type Event ¶
type Event struct { Id string `protobuf:"bytes,1,opt,name=id" json:"id,omitempty"` Timestamp string `protobuf:"bytes,2,opt,name=timestamp" json:"timestamp,omitempty"` // Types that are valid to be assigned to Data: // *Event_State // *Event_StartTime // *Event_EndTime // *Event_Outputs // *Event_Metadata // *Event_ExitCode // *Event_Stdout // *Event_Stderr // *Event_SystemLog Data isEvent_Data `protobuf_oneof:"data"` Attempt uint32 `protobuf:"varint,16,opt,name=attempt" json:"attempt,omitempty"` Index uint32 `protobuf:"varint,17,opt,name=index" json:"index,omitempty"` Type Type `protobuf:"varint,18,opt,name=type,enum=events.Type" json:"type,omitempty"` }
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 (*Event) Descriptor ¶
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()
type EventServiceClient ¶
type EventServiceClient interface {
CreateEvent(ctx context.Context, in *Event, opts ...grpc.CallOption) (*CreateEventResponse, error)
}
func NewEventServiceClient ¶
func NewEventServiceClient(cc *grpc.ClientConn) EventServiceClient
type EventServiceServer ¶
type EventServiceServer interface {
CreateEvent(context.Context, *Event) (*CreateEventResponse, error)
}
type Event_EndTime ¶
type Event_EndTime struct {
EndTime string `protobuf:"bytes,5,opt,name=end_time,json=endTime,oneof"`
}
type Event_ExitCode ¶
type Event_ExitCode struct {
ExitCode int32 `protobuf:"varint,10,opt,name=exit_code,json=exitCode,oneof"`
}
type Event_Metadata ¶
type Event_Metadata struct {
Metadata *Metadata `protobuf:"bytes,7,opt,name=metadata,oneof"`
}
type Event_Outputs ¶
type Event_Outputs struct {
Outputs *Outputs `protobuf:"bytes,6,opt,name=outputs,oneof"`
}
type Event_StartTime ¶
type Event_StartTime struct {
StartTime string `protobuf:"bytes,4,opt,name=start_time,json=startTime,oneof"`
}
type Event_State ¶
type Event_Stderr ¶
type Event_Stderr struct {
Stderr string `protobuf:"bytes,14,opt,name=stderr,oneof"`
}
type Event_Stdout ¶
type Event_Stdout struct {
Stdout string `protobuf:"bytes,13,opt,name=stdout,oneof"`
}
type Event_SystemLog ¶
type Event_SystemLog struct {
SystemLog *SystemLog `protobuf:"bytes,15,opt,name=system_log,json=systemLog,oneof"`
}
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, logLevel string, 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) 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) TailLogs ¶
func (ew *ExecutorWriter) TailLogs(ctx context.Context, size int64, interval time.Duration) (stdout, stderr io.Writer)
TailLogs 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 ¶
func NewKafkaReader(conf config.Kafka, w Writer) (*KafkaReader, error)
NewKafkaReader creates a new event reader for reading events from a Kafka topic and writing them to the given Writer.
func (*KafkaReader) Close ¶
func (k *KafkaReader) Close() error
Close closes the Kafka reader, cleaning up resources.
type KafkaWriter ¶
type KafkaWriter struct {
// contains filtered or unexported fields
}
KafkaWriter writes events to a Kafka topic.
func NewKafkaWriter ¶
func NewKafkaWriter(conf config.Kafka) (*KafkaWriter, error)
NewKafkaWriter creates a new event writer for writing events to a Kafka topic.
func (*KafkaWriter) Close ¶
func (k *KafkaWriter) Close() error
Close closes the Kafka producer, cleaning up resources.
func (*KafkaWriter) Write ¶
func (k *KafkaWriter) Write(ev *Event) error
Write 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 ¶
func (*Metadata) Descriptor ¶
func (*Metadata) ProtoMessage ¶
func (*Metadata) ProtoMessage()
type Outputs ¶
type Outputs struct {
Value []*tes.OutputFileLog `protobuf:"bytes,1,rep,name=value" json:"value,omitempty"`
}
func (*Outputs) Descriptor ¶
func (*Outputs) GetValue ¶
func (m *Outputs) GetValue() []*tes.OutputFileLog
func (*Outputs) ProtoMessage ¶
func (*Outputs) ProtoMessage()
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 SystemLog ¶
type SystemLog struct { Msg string `protobuf:"bytes,1,opt,name=msg" json:"msg,omitempty"` Level string `protobuf:"bytes,2,opt,name=level" json:"level,omitempty"` Fields map[string]string `` /* 132-byte string literal not displayed */ }
func (*SystemLog) Descriptor ¶
func (*SystemLog) ProtoMessage ¶
func (*SystemLog) ProtoMessage()
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
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
type TaskBuilder ¶
TaskBuilder aggregates events into an in-memory Task object.
func (TaskBuilder) Write ¶
func (tb TaskBuilder) Write(ev *Event) error
Write 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.
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, logLevel string, 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.
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 )