event-gateway/internal/sink/types/types.go

33 lines
522 B
Go
Raw Permalink Normal View History

2024-04-20 20:31:06 +00:00
// 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
}