Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New sinks #438

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.PHONY: help run bootstrap bootstrap-destinations build-docker buildx-deploy test-cover-pkg
.PHONY: help run build bootstrap bootstrap-destinations build-docker buildx-deploy test-cover-pkg
S=silverton
REGISTRY:=us-east1-docker.pkg.dev/silverton-io/docker
VERSION:=$(shell cat .VERSION)
Expand Down
2 changes: 2 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ require (
cloud.google.com/go/compute v1.1.0 // indirect
cloud.google.com/go/iam v0.1.1 // indirect
github.com/ClickHouse/clickhouse-go v1.5.4 // indirect
github.com/DataDog/datadog-api-client-go/v2 v2.2.0 // indirect
github.com/DataDog/zstd v1.5.0 // indirect
github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.3.0 // indirect
github.com/aws/aws-sdk-go-v2/credentials v1.8.0 // indirect
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.10.0 // indirect
Expand Down
4 changes: 4 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,10 @@ github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03
github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=
github.com/ClickHouse/clickhouse-go v1.5.4 h1:cKjXeYLNWVJIx2J1K6H2CqyRmfwVJVY1OV1coaaFcI0=
github.com/ClickHouse/clickhouse-go v1.5.4/go.mod h1:EaI/sW7Azgz9UATzd5ZdZHRUhHgv5+JMS9NSr2smCJI=
github.com/DataDog/datadog-api-client-go/v2 v2.2.0 h1:woWe+XBcYt29g1SJs+zbgwYPfyATb+gxeA2pKqUu02Y=
github.com/DataDog/datadog-api-client-go/v2 v2.2.0/go.mod h1:98b/MtTwSAr/yhTfhCR1oxAqQ/4tMkdrgKH7fYiDA0g=
github.com/DataDog/zstd v1.5.0 h1:+K/VEwIAaPcHiMtQvpLD4lqW7f0Gk3xdYZmI1hD+CXo=
github.com/DataDog/zstd v1.5.0/go.mod h1:g4AWEaM3yOg3HYfnJ3YIawPnVdXJh9QME85blwSAmyw=
github.com/Masterminds/semver/v3 v3.1.1 h1:hLg3sBzpNErnxhQtUy/mmLR2I9foDujNK030IGemrRc=
github.com/Masterminds/semver/v3 v3.1.1/go.mod h1:VPu/7SZ7ePZ3QOrcuXROw5FAcLl4a0cBrbBpGY/8hQs=
github.com/OneOfOne/xxhash v1.2.2 h1:KMrpdQIwFcEqXDklaen+P1axHaj9BSKzvpUUfnHldSE=
Expand Down
52 changes: 52 additions & 0 deletions pkg/sink/datadog.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
// Copyright (c) 2022 Silverton Data, Inc.
// You may use, distribute, and modify this code under the terms of the AGPLv3 license, a copy of
// which may be found at https://github.com/silverton-io/buz/blob/main/LICENSE

package sink

import (
"context"

"github.com/google/uuid"
"github.com/silverton-io/buz/pkg/config"
"github.com/silverton-io/buz/pkg/envelope"
)

type DatadogSink struct {
id *uuid.UUID
name string
deliveryRequired bool
}

func (s *DatadogSink) Id() *uuid.UUID {
return s.id
}

func (s *DatadogSink) Name() string {
return s.name
}

func (s *DatadogSink) Type() string {
return DATADOG
}

func (s *DatadogSink) DeliveryRequired() bool {
return s.deliveryRequired
}

func (s *DatadogSink) Initialize(conf config.Sink) error {
id := uuid.New()
s.id, s.name, s.deliveryRequired = &id, conf.Name, conf.DeliveryRequired
return nil
}

func (s *DatadogSink) BatchPublishValid(ctx context.Context, validEnvelopes []envelope.Envelope) error {
return nil
}

func (s *DatadogSink) BatchPublishInvalid(ctx context.Context, invalidEnvelopes []envelope.Envelope) error {
return nil
}

func (s *DatadogSink) Close() {
}
1 change: 1 addition & 0 deletions pkg/sink/sink.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ const (
NATS_JETSTREAM string = "nats-jetstream"
INDICATIVE string = "indicative"
AMPLITUDE string = "amplitude"
DATADOG string = "datadog"
)

type Sink interface {
Expand Down