33 lines
522 B
Go
33 lines
522 B
Go
// Copyright © 2023 Roberto Hidalgo <event-gateway@un.rob.mx>
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
package types
|
|
|
|
import (
|
|
"context"
|
|
"encoding/json"
|
|
|
|
"go.opentelemetry.io/otel/trace"
|
|
)
|
|
|
|
type Kind string
|
|
|
|
const (
|
|
Nomad Kind = "nomad"
|
|
Debug Kind = "debug"
|
|
)
|
|
|
|
type Sink interface {
|
|
Dispatch(ctx context.Context, span trace.Span, event Event) error
|
|
Tracer() trace.Tracer
|
|
Parse(c *Config) (Event, error)
|
|
}
|
|
|
|
type Event interface {
|
|
Kind() Kind
|
|
}
|
|
|
|
type Config struct {
|
|
Kind Kind `json:"kind"`
|
|
Data json.RawMessage
|
|
}
|