diff --git a/.github/workflows/master-test.yaml b/.github/workflows/master-test.yaml index 0c33b4fa3..05c7f67d7 100644 --- a/.github/workflows/master-test.yaml +++ b/.github/workflows/master-test.yaml @@ -18,17 +18,6 @@ jobs: uses: jakejarvis/wait-action@master with: time: '30s' -# - name: Install Code Climate reporter -# run: | -# sudo curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter -# sudo chmod +x ./cc-test-reporter -# ./cc-test-reporter before-build -# - name: Master buld tests -# run: | -# make test/coverage -# - name: Upload coverage information -# run: | -# GIT_BRANCH=master ./cc-test-reporter after-build -p github.com/streamdal/plumber -r ${{ secrets.CC_TEST_REPORTER_ID }} functional: name: Run functional tests runs-on: ubuntu-latest diff --git a/.github/workflows/pr-test.yaml b/.github/workflows/pr-test.yaml index 1ca8fff4c..f309103b1 100644 --- a/.github/workflows/pr-test.yaml +++ b/.github/workflows/pr-test.yaml @@ -15,17 +15,6 @@ jobs: uses: jakejarvis/wait-action@master with: time: '30s' -# - name: Install Code Climate reporter -# run: | -# sudo curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter -# sudo chmod +x ./cc-test-reporter -# ./cc-test-reporter before-build -# - name: Test -# run: | -# make test/coverage -# - name: Upload coverage information -# run: | -# GIT_BRANCH="${GITHUB_HEAD_REF}" ./cc-test-reporter after-build -p github.com/streamdal/plumber -r ${{ secrets.CC_TEST_REPORTER_ID }} functional: name: Run functional tests diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 202010ea7..356347089 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -35,7 +35,7 @@ jobs: push_options: '--force' - name: Build run: | - VERSION="$GITHUB_TAG-$GITHUB_SHORT_SHA" TELEMETRY_API_KEY="${{secrets.TELEMETRY_API_KEY}}" make build + VERSION="$GITHUB_TAG-$GITHUB_SHORT_SHA" make build - name: Update nfpm version value run: | sed -i '/version/ s/"[^"][^"]*"/"${{ env.GITHUB_TAG }}"/' nfpm.yaml diff --git a/Makefile b/Makefile index ec23d3f7e..19c183db0 100644 --- a/Makefile +++ b/Makefile @@ -6,7 +6,7 @@ ARCH ?= $(shell uname -m) GO = CGO_ENABLED=$(CGO_ENABLED) GONOPROXY=github.com/streamdal GOFLAGS=-mod=vendor go CGO_ENABLED ?= 0 -GO_BUILD_FLAGS = -ldflags "-X 'github.com/streamdal/plumber/options.VERSION=${VERSION}' -X 'main.TELEMETRY_API_KEY=${TELEMETRY_API_KEY}'" +GO_BUILD_FLAGS = -ldflags "-X 'github.com/streamdal/plumber/options.VERSION=${VERSION}'" # Pattern #1 example: "example : description = Description for example target" # Pattern #2 example: "### Example separator text diff --git a/config/config.go b/config/config.go index 12c395193..5ffe5659f 100644 --- a/config/config.go +++ b/config/config.go @@ -9,7 +9,6 @@ package config import ( "context" "encoding/json" - "fmt" "io/ioutil" "os" "path" @@ -38,13 +37,12 @@ const ( // Config stores Account IDs and the auth_token cookie type Config struct { - ClusterID string `json:"-"` // This comes from an environment variable - PlumberID string `json:"plumber_id"` - Token string `json:"token"` - TeamID string `json:"team_id"` - UserID string `json:"user_id"` - EnableTelemetry bool `json:"enable_telemetry"` - LastVersion string `json:"last_version"` + ClusterID string `json:"-"` // This comes from an environment variable + PlumberID string `json:"plumber_id"` + Token string `json:"token"` + TeamID string `json:"team_id"` + UserID string `json:"user_id"` + LastVersion string `json:"last_version"` Connections map[string]*stypes.Connection `json:"connections"` Relays map[string]*stypes.Relay `json:"relays"` @@ -168,87 +166,7 @@ func requireReconfig(initialRun bool, cfg *Config) bool { } func (c *Config) Configure() { - // No need to ask about telemetry if it's already enabled - if !c.EnableTelemetry { - c.askTelemetry() - } -} - -func (c *Config) askTelemetry() { - telemetryDescription := `If telemetry is enabled, plumber will collect the following anonymous telemetry data: - -> General - - PlumberID (a unique, randomly generated ID for this plumber instance) - - Plumber version - - OS and architecture - - Plumber mode (server or CLI) - -> For CLI - - Plumber action (read, write, relay, etc.) - - Backend used (kafka, rabbitmq, nats, etc.) - - Data format used for read or write (json, protobuf, etc.) - - If reading, whether continuous mode is used - - If using protobuf, whether file descriptors are used - -> For server - - Number of connections, relays, tunnels - - Server uptime - - ClusterID - - gRPC methods used (create relay, stop tunnel, etc.) - -NOTE: We do NOT collect ANY personally identifiable or confidential information. - -You can read this statement here: https://docs.streamdal.com/plumber/telemetry -` - fmt.Printf(telemetryDescription + "\n") - - enableTelemetry, err := askYesNo("Do you want to enable telemetry?", "N") - if err != nil { - c.log.Fatalf("unable to configure plumber: %s", err) - } - - if enableTelemetry { - fmt.Printf("\nNICE! Thank you for opting in! This will help us improve plumber :)\n\n") - } - - c.EnableTelemetry = enableTelemetry -} - -func askYesNo(question, defaultAnswer string) (bool, error) { - if defaultAnswer != "" { - fmt.Printf(question+" [y/n (default: %s)]: ", defaultAnswer) - } else { - fmt.Print(question + " [y/n]: ") - } - - var answer string - - i, err := fmt.Scanln(&answer) - - // Scan() doesn't return on only newline and empty string - // Scanln() will error on only new line and empty string - if err != nil && !strings.Contains(err.Error(), "unexpected newline") { - return false, fmt.Errorf("unable to read input: %s", err) - } - - if i == 0 { - if defaultAnswer != "" { - answer = defaultAnswer - } - } - - answer = strings.ToLower(answer) - - if answer == "y" || answer == "yes" { - return true, nil - } - - if answer == "n" || answer == "no" { - return false, nil - } - - fmt.Println("invalid input") - return askYesNo(question, defaultAnswer) + // purposefully empty since we removed telemetry } func newConfig(enableCluster bool, k kv.IKV) *Config { diff --git a/go.mod b/go.mod index 75ac1e751..6a24d26cf 100644 --- a/go.mod +++ b/go.mod @@ -44,7 +44,6 @@ require ( github.com/onsi/ginkgo v1.16.5 github.com/onsi/gomega v1.30.0 github.com/pkg/errors v0.9.1 - github.com/posthog/posthog-go v0.0.0-20220817142604-0b0bbf0f9c0f github.com/prometheus/client_golang v1.11.1 github.com/rabbitmq/rabbitmq-stream-go-client v1.0.1-rc.2 github.com/relistan/go-director v0.0.0-20200406104025-dbbf5d95248d @@ -66,7 +65,7 @@ require ( github.com/cloudevents/sdk-go/protocol/kafka_sarama/v2 v2.13.0 github.com/cloudevents/sdk-go/protocol/nats/v2 v2.13.0 github.com/cloudevents/sdk-go/v2 v2.13.0 - github.com/streamdal/streamdal/sdks/go v0.1.32 + github.com/streamdal/streamdal/sdks/go v0.1.36 ) require ( @@ -153,7 +152,7 @@ require ( github.com/rogpeppe/go-internal v1.9.0 // indirect github.com/santhosh-tekuri/jsonschema/v5 v5.1.0 // indirect github.com/spaolacci/murmur3 v1.1.0 // indirect - github.com/streamdal/streamdal/libs/protos v0.1.57 // indirect + github.com/streamdal/streamdal/libs/protos v0.1.58 // indirect github.com/tetratelabs/wazero v1.7.3 // indirect github.com/tidwall/match v1.1.1 // indirect github.com/tidwall/pretty v1.2.0 // indirect @@ -165,7 +164,6 @@ require ( github.com/xdg-go/stringprep v1.0.4 // indirect github.com/xdg/scram v0.0.0-20180814205039-7eeb5667e42c // indirect github.com/xdg/stringprep v1.0.0 // indirect - github.com/xtgo/uuid v0.0.0-20140804021211-a0b114877d4c // indirect github.com/youmark/pkcs8 v0.0.0-20181117223130-1be2e3e5546d // indirect go.opencensus.io v0.24.0 // indirect go.uber.org/atomic v1.7.0 // indirect diff --git a/go.sum b/go.sum index a7c956198..2eb576515 100644 --- a/go.sum +++ b/go.sum @@ -627,8 +627,6 @@ github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINE github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= -github.com/posthog/posthog-go v0.0.0-20220817142604-0b0bbf0f9c0f h1:h0p1aZ9F5d6IXOygysob3g4B07b+HuVUQC0VJKD8wA4= -github.com/posthog/posthog-go v0.0.0-20220817142604-0b0bbf0f9c0f/go.mod h1:oa2sAs9tGai3VldabTV0eWejt/O4/OOD7azP8GaikqU= github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= github.com/prometheus/client_golang v0.9.2/go.mod h1:OsXs2jCmiKlQ1lTBmv21f2mNfw4xf/QclQDMrYNZzcM= github.com/prometheus/client_golang v0.9.3/go.mod h1:/TN21ttK/J9q6uSwhBd54HahCDft0ttaMvbicHlPoso= @@ -714,10 +712,10 @@ github.com/streadway/amqp v1.0.0 h1:kuuDrUJFZL1QYL9hUNuCxNObNzB0bV/ZG5jV3RWAQgo= github.com/streadway/amqp v1.0.0/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= github.com/streamdal/pgoutput v0.3.3 h1:4XLuGQFzmMFQd4U/zy1X5lMICXduHp8vG7FlbYpUFn0= github.com/streamdal/pgoutput v0.3.3/go.mod h1:19V8kXi7a88guhXqvNpL2HH7sbnCYk0i93H4Q2i5iUA= -github.com/streamdal/streamdal/libs/protos v0.1.57 h1:WcdPA6d/jSBbr4BF07q5bgnoA7NaadL1rccQbvLXer8= -github.com/streamdal/streamdal/libs/protos v0.1.57/go.mod h1:1rQ250ydoKeRoJftIV9qGrR28Iqdb9+7Jcnoxber/eQ= -github.com/streamdal/streamdal/sdks/go v0.1.32 h1:1NA96RFsAmKEYp2IgWV/X+zn8D2XqrFYYqv6Fn5lJbU= -github.com/streamdal/streamdal/sdks/go v0.1.32/go.mod h1:JwuDEm46fAsjpuz8Nt6IkFX4BWX8g0IAox2MBiF5bKc= +github.com/streamdal/streamdal/libs/protos v0.1.58 h1:N/ts/V8DtWsIEueijCiGyKwElrFkC0swqUtbvgNbZKc= +github.com/streamdal/streamdal/libs/protos v0.1.58/go.mod h1:1rQ250ydoKeRoJftIV9qGrR28Iqdb9+7Jcnoxber/eQ= +github.com/streamdal/streamdal/sdks/go v0.1.36 h1:eaOgIcnM/fk11ruHzaO8jRYWjMHWZXE0VL4FW/zlvIQ= +github.com/streamdal/streamdal/sdks/go v0.1.36/go.mod h1:D6p5gLhXNmtP4468DQ7zPcv5n4IIt5zX+6ihMZGtavA= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE= @@ -750,7 +748,6 @@ github.com/ugorji/go v1.1.7 h1:/68gy2h+1mWMrwZFeD1kQialdSzAb432dtpeJ42ovdo= github.com/ugorji/go v1.1.7/go.mod h1:kZn38zHttfInRq0xu/PH0az30d+z6vm202qpg1oXVMw= github.com/ugorji/go/codec v1.1.7 h1:2SvQaVZ1ouYrrKKwoSk2pzd4A9evlKJb9oTL+OaLUSs= github.com/ugorji/go/codec v1.1.7/go.mod h1:Ax+UKWsSmolVDwsd+7N3ZtXu+yMGCf907BLYF3GoBXY= -github.com/urfave/cli v1.22.5/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= github.com/urfave/cli/v2 v2.3.0/go.mod h1:LJmUH05zAU44vOAcrfzZQKsZbVcdbOG8rtL3/XcUArI= github.com/v2pro/quokka v0.0.0-20171201153428-382cb39c6ee6 h1:hb7P11ytAQIcQ7Cq1uQBNTGgKQle7N+jsP4L72ooa7Q= github.com/v2pro/quokka v0.0.0-20171201153428-382cb39c6ee6/go.mod h1:0VP5W9AFNVWU8C1QLNeVg8TvzoEkIHWZ4vxtxEVFWUY= @@ -771,8 +768,6 @@ github.com/xdg/scram v0.0.0-20180814205039-7eeb5667e42c/go.mod h1:lB8K/P019DLNhe github.com/xdg/stringprep v1.0.0 h1:d9X0esnoa3dFsV0FG35rAT0RIhYFlPq7MiP+DW89La0= github.com/xdg/stringprep v1.0.0/go.mod h1:Jhud4/sHMO4oL310DaZAKk9ZaJ08SJfe+sJh0HrGL1Y= github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= -github.com/xtgo/uuid v0.0.0-20140804021211-a0b114877d4c h1:3lbZUMbMiGUW/LMkfsEABsc5zNT9+b1CvsJx47JzJ8g= -github.com/xtgo/uuid v0.0.0-20140804021211-a0b114877d4c/go.mod h1:UrdRz5enIKZ63MEE3IF9l2/ebyx59GyGgPi+tICQdmM= github.com/youmark/pkcs8 v0.0.0-20181117223130-1be2e3e5546d h1:splanxYIlg+5LfHAM6xpdFEAYOk8iySO56hMFq6uLyA= github.com/youmark/pkcs8 v0.0.0-20181117223130-1be2e3e5546d/go.mod h1:rHwXgn7JulP+udvsHwJoVG1YGAP6VLg4y9I5dyZdqmA= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= diff --git a/main.go b/main.go index bde2d66aa..f3614b99a 100644 --- a/main.go +++ b/main.go @@ -8,7 +8,6 @@ import ( "os/signal" "strings" "syscall" - "time" "github.com/sirupsen/logrus" "github.com/tidwall/gjson" @@ -23,11 +22,6 @@ import ( "github.com/streamdal/plumber/plumber" "github.com/streamdal/plumber/printer" "github.com/streamdal/plumber/prometheus" - "github.com/streamdal/plumber/telemetry" -) - -var ( - TELEMETRY_API_KEY = "UNSET" ) func main() { @@ -70,29 +64,6 @@ func main() { // Save config automatically on exit defer persistentConfig.Save() - // If enabled, setup telemetry - var as telemetry.ITelemetry - - if persistentConfig.EnableTelemetry { - var err error - - as, err = telemetry.New(&telemetry.Config{ - Token: TELEMETRY_API_KEY, - PlumberID: persistentConfig.PlumberID, - CLIOptions: cliOpts, - }) - if err != nil { - logrus.Fatalf("unable to create telemetry client: %s", err) - } - - logrus.Debug("telemetry enabled") - - // Making sure that we give enough time for telemetry to finish - defer time.Sleep(time.Second) - } else { - as = &telemetry.NoopTelemetry{} - } - // We only want to intercept interrupt signals in relay or server mode if cliOpts.Global.XAction == "relay" || cliOpts.Global.XAction == "server" || cliOpts.Global.XAction == "read" { logrus.Debug("Intercepting signals") @@ -135,7 +106,6 @@ func main() { } p, err := plumber.New(&plumber.Config{ - Telemetry: as, PersistentConfig: persistentConfig, ServiceShutdownCtx: serviceCtx, KongCtx: kongCtx, diff --git a/plumber/cli_batch.go b/plumber/cli_batch.go index fdad50ade..3d3364c37 100644 --- a/plumber/cli_batch.go +++ b/plumber/cli_batch.go @@ -4,8 +4,6 @@ import ( "fmt" "strings" - "github.com/posthog/posthog-go" - "github.com/streamdal/plumber/backends/streamdal" ) @@ -16,14 +14,6 @@ func (p *Plumber) HandleStreamdalCmd() error { // Less typing cmd := p.CLIOptions.Global.XFullCommand - p.Telemetry.Enqueue(posthog.Capture{ - Event: "cli_batch", - DistinctId: p.PersistentConfig.PlumberID, - Properties: map[string]interface{}{ - "command": cmd, - }, - }) - switch { case strings.HasPrefix(cmd, "streamdal login"): return b.Login() diff --git a/plumber/cli_manage.go b/plumber/cli_manage.go index adba005f2..8df8c9294 100644 --- a/plumber/cli_manage.go +++ b/plumber/cli_manage.go @@ -11,7 +11,6 @@ import ( "github.com/golang/protobuf/proto" "github.com/hokaccha/go-prettyjson" "github.com/pkg/errors" - "github.com/posthog/posthog-go" "google.golang.org/grpc" "google.golang.org/grpc/credentials" @@ -138,38 +137,6 @@ func (p *Plumber) displayJSON(input map[string]string) { fmt.Println(string(data)) } -func (p *Plumber) EnqueueManage(event posthog.Capture) { - if event.Properties == nil { - event.Properties = make(map[string]interface{}) - } - - if _, ok := event.Properties["use_tls"]; !ok { - event.Properties["use_tls"] = p.CLIOptions.Manage.GlobalOptions.ManageUseTls - } - - if _, ok := event.Properties["insecure_tls"]; !ok { - event.Properties["insecure_tls"] = p.CLIOptions.Manage.GlobalOptions.ManageInsecureTls - } - - if _, ok := event.Properties["disable_pretty"]; !ok { - event.Properties["disable_pretty"] = p.CLIOptions.Manage.GlobalOptions.DisablePretty - } - - event.Properties["default_manage_token"] = false - - if p.CLIOptions.Manage.GlobalOptions.ManageToken == "streamdal" { - event.Properties["default_manage_token"] = true - } - - event.Properties["default_manage_address"] = false - - if p.CLIOptions.Manage.GlobalOptions.ManageAddress == "localhost:9090" { - event.Properties["default_manage_address"] = true - } - - p.Telemetry.Enqueue(event) -} - func (p *Plumber) displayProtobuf(msg proto.Message) error { marshaller := jsonpb.Marshaler{ Indent: " ", diff --git a/plumber/cli_manage_connection.go b/plumber/cli_manage_connection.go index e1063ed95..8eeac1d75 100644 --- a/plumber/cli_manage_connection.go +++ b/plumber/cli_manage_connection.go @@ -5,25 +5,14 @@ import ( "fmt" "strings" - "github.com/mcuadros/go-lookup" - "github.com/pkg/errors" - "github.com/posthog/posthog-go" - "github.com/batchcorp/plumber-schemas/build/go/protos" "github.com/batchcorp/plumber-schemas/build/go/protos/common" "github.com/batchcorp/plumber-schemas/build/go/protos/opts" + "github.com/mcuadros/go-lookup" + "github.com/pkg/errors" ) func (p *Plumber) HandleGetConnectionCmd(ctx context.Context, client protos.PlumberServerClient) error { - p.EnqueueManage(posthog.Capture{ - Event: "command_manage", - DistinctId: p.PersistentConfig.PlumberID, - Properties: map[string]interface{}{ - "connection_id": p.CLIOptions.Manage.Get.Connection.Id, - "method": "get_connection", - }, - }) - resp, err := client.GetConnection(ctx, &protos.GetConnectionRequest{ Auth: &common.Auth{ Token: p.CLIOptions.Manage.GlobalOptions.ManageToken, @@ -44,14 +33,6 @@ func (p *Plumber) HandleGetConnectionCmd(ctx context.Context, client protos.Plum } func (p *Plumber) HandleGetAllConnectionsCmd(ctx context.Context, client protos.PlumberServerClient) error { - p.EnqueueManage(posthog.Capture{ - Event: "command_manage", - DistinctId: p.PersistentConfig.PlumberID, - Properties: map[string]interface{}{ - "method": "get_all_connections", - }, - }) - resp, err := client.GetAllConnections(ctx, &protos.GetAllConnectionsRequest{ Auth: &common.Auth{ Token: p.CLIOptions.Manage.GlobalOptions.ManageToken, @@ -71,15 +52,6 @@ func (p *Plumber) HandleGetAllConnectionsCmd(ctx context.Context, client protos. } func (p *Plumber) HandleDeleteConnectionCmd(ctx context.Context, client protos.PlumberServerClient) error { - p.EnqueueManage(posthog.Capture{ - Event: "command_manage", - DistinctId: p.PersistentConfig.PlumberID, - Properties: map[string]interface{}{ - "method": "delete_connection", - "connection_id": p.CLIOptions.Manage.Delete.Connection.Id, - }, - }) - resp, err := client.DeleteConnection(ctx, &protos.DeleteConnectionRequest{ Auth: &common.Auth{ Token: p.CLIOptions.Manage.GlobalOptions.ManageToken, @@ -105,15 +77,6 @@ func (p *Plumber) HandleCreateConnectionCmd(ctx context.Context, client protos.P return errors.Wrap(err, "failed to generate connection options") } - p.EnqueueManage(posthog.Capture{ - Event: "command_manage", - DistinctId: p.PersistentConfig.PlumberID, - Properties: map[string]interface{}{ - "backend": p.CLIOptions.Global.XBackend, - "method": "create_connection", - }, - }) - resp, err := client.CreateConnection(ctx, &protos.CreateConnectionRequest{ Auth: &common.Auth{ Token: p.CLIOptions.Manage.GlobalOptions.ManageToken, diff --git a/plumber/cli_manage_relay.go b/plumber/cli_manage_relay.go index b612be3da..7c4206263 100644 --- a/plumber/cli_manage_relay.go +++ b/plumber/cli_manage_relay.go @@ -4,26 +4,15 @@ import ( "context" "strings" - "github.com/pkg/errors" - "github.com/posthog/posthog-go" - "github.com/batchcorp/plumber-schemas/build/go/protos" "github.com/batchcorp/plumber-schemas/build/go/protos/common" "github.com/batchcorp/plumber-schemas/build/go/protos/opts" + "github.com/pkg/errors" "github.com/streamdal/plumber/validate" ) func (p *Plumber) HandleGetRelayCmd(ctx context.Context, client protos.PlumberServerClient) error { - p.EnqueueManage(posthog.Capture{ - Event: "command_manage", - DistinctId: p.PersistentConfig.PlumberID, - Properties: map[string]interface{}{ - "relay_id": p.CLIOptions.Manage.Get.Relay.Id, - "method": "get_relay", - }, - }) - resp, err := client.GetRelay(ctx, &protos.GetRelayRequest{ Auth: &common.Auth{ Token: p.CLIOptions.Manage.GlobalOptions.ManageToken, @@ -44,14 +33,6 @@ func (p *Plumber) HandleGetRelayCmd(ctx context.Context, client protos.PlumberSe } func (p *Plumber) HandleGetAllRelaysCmd(ctx context.Context, client protos.PlumberServerClient) error { - p.EnqueueManage(posthog.Capture{ - Event: "command_manage", - DistinctId: p.PersistentConfig.PlumberID, - Properties: map[string]interface{}{ - "method": "get_all_relays", - }, - }) - resp, err := client.GetAllRelays(ctx, &protos.GetAllRelaysRequest{ Auth: &common.Auth{ Token: p.CLIOptions.Manage.GlobalOptions.ManageToken, @@ -70,15 +51,6 @@ func (p *Plumber) HandleGetAllRelaysCmd(ctx context.Context, client protos.Plumb } func (p *Plumber) HandleResumeRelayCmd(ctx context.Context, client protos.PlumberServerClient) error { - p.EnqueueManage(posthog.Capture{ - Event: "command_manage", - DistinctId: p.PersistentConfig.PlumberID, - Properties: map[string]interface{}{ - "relay_id": p.CLIOptions.Manage.Resume.Relay.Id, - "method": "resume_relay", - }, - }) - resp, err := client.ResumeRelay(ctx, &protos.ResumeRelayRequest{ Auth: &common.Auth{ Token: p.CLIOptions.Manage.GlobalOptions.ManageToken, @@ -98,15 +70,6 @@ func (p *Plumber) HandleResumeRelayCmd(ctx context.Context, client protos.Plumbe } func (p *Plumber) HandleStopRelayCmd(ctx context.Context, client protos.PlumberServerClient) error { - p.EnqueueManage(posthog.Capture{ - Event: "command_manage", - DistinctId: p.PersistentConfig.PlumberID, - Properties: map[string]interface{}{ - "relay_id": p.CLIOptions.Manage.Stop.Relay.Id, - "method": "stop_relay", - }, - }) - resp, err := client.StopRelay(ctx, &protos.StopRelayRequest{ Auth: &common.Auth{ Token: p.CLIOptions.Manage.GlobalOptions.ManageToken, @@ -126,15 +89,6 @@ func (p *Plumber) HandleStopRelayCmd(ctx context.Context, client protos.PlumberS } func (p *Plumber) HandleDeleteRelayCmd(ctx context.Context, client protos.PlumberServerClient) error { - p.EnqueueManage(posthog.Capture{ - Event: "command_manage", - DistinctId: p.PersistentConfig.PlumberID, - Properties: map[string]interface{}{ - "relay_id": p.CLIOptions.Manage.Delete.Relay.Id, - "method": "delete_relay", - }, - }) - resp, err := client.DeleteRelay(ctx, &protos.DeleteRelayRequest{ Auth: &common.Auth{ Token: p.CLIOptions.Manage.GlobalOptions.ManageToken, @@ -163,17 +117,6 @@ func (p *Plumber) HandleCreateRelayCmd(ctx context.Context, client protos.Plumbe return errors.Wrap(err, "unable to validate manage create relay options") } - p.EnqueueManage(posthog.Capture{ - Event: "command_manage", - DistinctId: p.PersistentConfig.PlumberID, - Properties: map[string]interface{}{ - "method": "create_relay", - "connection_id": p.CLIOptions.Manage.Create.Relay.ConnectionId, - "batch_size": p.CLIOptions.Manage.Create.Relay.BatchSize, - "num_workers": p.CLIOptions.Manage.Create.Relay.NumWorkers, - }, - }) - // Create relay options from CLI opts relayOpts, err := generateRelayOptionsForManageCreate(p.CLIOptions) if err != nil { diff --git a/plumber/cli_manage_tunnel.go b/plumber/cli_manage_tunnel.go index c8b8e8d13..632af8a5c 100644 --- a/plumber/cli_manage_tunnel.go +++ b/plumber/cli_manage_tunnel.go @@ -4,24 +4,13 @@ import ( "context" "strings" - "github.com/pkg/errors" - "github.com/posthog/posthog-go" - "github.com/batchcorp/plumber-schemas/build/go/protos" "github.com/batchcorp/plumber-schemas/build/go/protos/common" "github.com/batchcorp/plumber-schemas/build/go/protos/opts" + "github.com/pkg/errors" ) func (p *Plumber) HandleGetTunnelCmd(ctx context.Context, client protos.PlumberServerClient) error { - p.EnqueueManage(posthog.Capture{ - Event: "command_manage", - DistinctId: p.PersistentConfig.PlumberID, - Properties: map[string]interface{}{ - "tunnel_id": p.CLIOptions.Manage.Get.Tunnel.Id, - "method": "get_tunnel", - }, - }) - resp, err := client.GetTunnel(ctx, &protos.GetTunnelRequest{ Auth: &common.Auth{ Token: p.CLIOptions.Manage.GlobalOptions.ManageToken, @@ -42,14 +31,6 @@ func (p *Plumber) HandleGetTunnelCmd(ctx context.Context, client protos.PlumberS } func (p *Plumber) HandleGetAllTunnelsCmd(ctx context.Context, client protos.PlumberServerClient) error { - p.EnqueueManage(posthog.Capture{ - Event: "command_manage", - DistinctId: p.PersistentConfig.PlumberID, - Properties: map[string]interface{}{ - "method": "get_all_tunnels", - }, - }) - resp, err := client.GetAllTunnels(ctx, &protos.GetAllTunnelsRequest{ Auth: &common.Auth{ Token: p.CLIOptions.Manage.GlobalOptions.ManageToken, @@ -68,14 +49,6 @@ func (p *Plumber) HandleGetAllTunnelsCmd(ctx context.Context, client protos.Plum } func (p *Plumber) HandleCreateTunnelCmd(ctx context.Context, client protos.PlumberServerClient) error { - p.EnqueueManage(posthog.Capture{ - Event: "command_manage", - DistinctId: p.PersistentConfig.PlumberID, - Properties: map[string]interface{}{ - "method": "create_tunnel", - }, - }) - // Create tunnel options from CLI opts tunnelOpts, err := generateTunnelOptionsForManageCreate(p.CLIOptions) if err != nil { @@ -100,15 +73,6 @@ func (p *Plumber) HandleCreateTunnelCmd(ctx context.Context, client protos.Plumb } func (p *Plumber) HandleDeleteTunnelCmd(ctx context.Context, client protos.PlumberServerClient) error { - p.EnqueueManage(posthog.Capture{ - Event: "command_manage", - DistinctId: p.PersistentConfig.PlumberID, - Properties: map[string]interface{}{ - "tunnel_id": p.CLIOptions.Manage.Delete.Tunnel.Id, - "method": "delete_tunnel", - }, - }) - resp, err := client.DeleteTunnel(ctx, &protos.DeleteTunnelRequest{ Auth: &common.Auth{ Token: p.CLIOptions.Manage.GlobalOptions.ManageToken, @@ -128,15 +92,6 @@ func (p *Plumber) HandleDeleteTunnelCmd(ctx context.Context, client protos.Plumb } func (p *Plumber) HandleStopTunnelCmd(ctx context.Context, client protos.PlumberServerClient) error { - p.EnqueueManage(posthog.Capture{ - Event: "command_manage", - DistinctId: p.PersistentConfig.PlumberID, - Properties: map[string]interface{}{ - "tunnel_id": p.CLIOptions.Manage.Stop.Tunnel.Id, - "method": "stop_tunnel", - }, - }) - resp, err := client.StopTunnel(ctx, &protos.StopTunnelRequest{ Auth: &common.Auth{ Token: p.CLIOptions.Manage.GlobalOptions.ManageToken, @@ -156,15 +111,6 @@ func (p *Plumber) HandleStopTunnelCmd(ctx context.Context, client protos.Plumber } func (p *Plumber) HandleResumeTunnelCmd(ctx context.Context, client protos.PlumberServerClient) error { - p.EnqueueManage(posthog.Capture{ - Event: "command_manage", - DistinctId: p.PersistentConfig.PlumberID, - Properties: map[string]interface{}{ - "tunnel_id": p.CLIOptions.Manage.Resume.Tunnel.Id, - "method": "resume_tunnel", - }, - }) - resp, err := client.ResumeTunnel(ctx, &protos.ResumeTunnelRequest{ Auth: &common.Auth{ Token: p.CLIOptions.Manage.GlobalOptions.ManageToken, diff --git a/plumber/cli_read.go b/plumber/cli_read.go index 13c6a56b0..7a903e73a 100644 --- a/plumber/cli_read.go +++ b/plumber/cli_read.go @@ -3,11 +3,8 @@ package plumber import ( "os" - "github.com/pkg/errors" - "github.com/posthog/posthog-go" - - "github.com/batchcorp/plumber-schemas/build/go/protos/encoding" "github.com/batchcorp/plumber-schemas/build/go/protos/records" + "github.com/pkg/errors" "github.com/streamdal/plumber/backends" "github.com/streamdal/plumber/printer" @@ -40,9 +37,6 @@ func (p *Plumber) HandleReadCmd() error { p.MainShutdownFunc() }() - // Fire off a goroutine to (potentially) post usage telemetry - go p.sendReadTelemetry(backend.Name()) - MAIN: for { var err error @@ -83,42 +77,3 @@ MAIN: return nil } - -func (p *Plumber) sendReadTelemetry(backend string) { - event := posthog.Capture{ - Event: "command_read", - DistinctId: p.PersistentConfig.PlumberID, - Properties: map[string]interface{}{ - "continuous": p.CLIOptions.Read.Continuous, - "backend": backend, - "decode_type": "unset", - }, - } - - event.Properties["pretty"] = p.CLIOptions.Read.XCliOptions.Pretty - event.Properties["json"] = p.CLIOptions.Read.XCliOptions.Json - event.Properties["verbose_output"] = p.CLIOptions.Read.XCliOptions.VerboseOutput - - if p.CLIOptions.Read.SampleOptions != nil { - event.Properties["sample_rate"] = p.CLIOptions.Read.SampleOptions.SampleRate - event.Properties["sample_interval_seconds"] = p.CLIOptions.Read.SampleOptions.SampleIntervalSeconds - } - - if p.CLIOptions.Read.DecodeOptions != nil { - event.Properties["decode_type"] = p.CLIOptions.Read.DecodeOptions.DecodeType.String() - - if p.CLIOptions.Read.DecodeOptions.DecodeType == encoding.DecodeType_DECODE_TYPE_PROTOBUF { - // Using FD's or dir? - if p.CLIOptions.Read.DecodeOptions.ProtobufSettings.ProtobufDescriptorSet != "" { - event.Properties["protobuf_type"] = "fds" - } else { - event.Properties["protobuf_type"] = "dir" - } - - // Set envelope info - event.Properties["protobuf_envelope"] = p.CLIOptions.Read.DecodeOptions.ProtobufSettings.ProtobufEnvelopeType.String() - } - } - - p.Config.Telemetry.Enqueue(event) -} diff --git a/plumber/cli_relay.go b/plumber/cli_relay.go index ed0848844..e283b1580 100644 --- a/plumber/cli_relay.go +++ b/plumber/cli_relay.go @@ -2,7 +2,6 @@ package plumber import ( "github.com/pkg/errors" - "github.com/posthog/posthog-go" "github.com/sirupsen/logrus" "github.com/streamdal/plumber/api" @@ -28,14 +27,6 @@ func (p *Plumber) HandleRelayCmd() error { return errors.Wrap(err, "unable to start relay service") } - p.Telemetry.Enqueue(posthog.Capture{ - Event: "command_relay", - DistinctId: p.PersistentConfig.PlumberID, - Properties: map[string]interface{}{ - "backend": backend.Name(), - }, - }) - // Log message prints ID on exit p.CLIOptions.Relay.XRelayId = "CLI" diff --git a/plumber/cli_server.go b/plumber/cli_server.go index 51e8ea724..b1360e4fc 100644 --- a/plumber/cli_server.go +++ b/plumber/cli_server.go @@ -7,7 +7,6 @@ import ( "time" "github.com/pkg/errors" - "github.com/posthog/posthog-go" "github.com/sirupsen/logrus" "google.golang.org/grpc" @@ -164,19 +163,6 @@ func (p *Plumber) startGRPCServer() error { go p.watchServiceShutdown(grpcServer) - p.Telemetry.Enqueue(posthog.Capture{ - Event: "command_server", - DistinctId: p.PersistentConfig.ClusterID, - Properties: map[string]interface{}{ - "cluster_id": p.CLIOptions.Server.ClusterId, - "node_id": p.CLIOptions.Server.NodeId, - "use_tls": p.CLIOptions.Server.UseTls, - "enable_cluster": p.CLIOptions.Server.EnableCluster, - "tls_skip_verify": p.CLIOptions.Server.TlsSkipVerify, - "remote_control_enabled": p.CLIOptions.Server.RemoteControlEnabled, - }, - }) - p.log.Debugf("starting gRPC server on %s", p.CLIOptions.Server.GrpcListenAddress) errCh := make(chan error, 1) diff --git a/plumber/cli_tunnel.go b/plumber/cli_tunnel.go index 73f371330..85f8a2cec 100644 --- a/plumber/cli_tunnel.go +++ b/plumber/cli_tunnel.go @@ -1,10 +1,8 @@ package plumber import ( - "github.com/pkg/errors" - "github.com/posthog/posthog-go" - "github.com/batchcorp/plumber-schemas/build/go/protos/records" + "github.com/pkg/errors" "github.com/streamdal/plumber/backends" "github.com/streamdal/plumber/options" @@ -18,14 +16,6 @@ func (p *Plumber) HandleTunnelCmd() error { return errors.Wrap(err, "unable to instantiate backend") } - p.Telemetry.Enqueue(posthog.Capture{ - Event: "command_tunnel", - DistinctId: p.PersistentConfig.PlumberID, - Properties: map[string]interface{}{ - "backend": backend.Name(), - }, - }) - // Run up tunnel // Plumber cluster ID purposefully left blank here so the destination becomes ephemeral tunnelSvc, err := tunnel.New(p.CLIOptions.Tunnel, &tunnel.Config{ diff --git a/plumber/cli_write.go b/plumber/cli_write.go index a43cfa9ea..03d46902e 100644 --- a/plumber/cli_write.go +++ b/plumber/cli_write.go @@ -4,11 +4,8 @@ import ( "context" "time" - "github.com/pkg/errors" - "github.com/posthog/posthog-go" - - "github.com/batchcorp/plumber-schemas/build/go/protos/encoding" "github.com/batchcorp/plumber-schemas/build/go/protos/records" + "github.com/pkg/errors" "github.com/streamdal/plumber/backends" "github.com/streamdal/plumber/validate" "github.com/streamdal/plumber/writer" @@ -35,9 +32,6 @@ func (p *Plumber) HandleWriteCmd() error { errorCh := make(chan *records.ErrorRecord, 1) - // Fire off a goroutine to (potentially) post usage telemetry - go p.doWriteTelemetry(backend.Name()) - go func() { if err := backend.Write(ctx, p.CLIOptions.Write, errorCh, value...); err != nil { p.log.Errorf("unable to complete write(s): %s", err) @@ -66,42 +60,3 @@ MAIN: return nil } - -func (p *Plumber) doWriteTelemetry(backend string) { - event := posthog.Capture{ - Event: "command_write", - DistinctId: p.PersistentConfig.PlumberID, - Properties: map[string]interface{}{ - "backend": backend, - "encode_type": "unset", - "input_as_json_array": p.CLIOptions.Write.XCliOptions.InputAsJsonArray, - "input_metadata_items": len(p.CLIOptions.Write.Record.InputMetadata), - }, - } - - if p.CLIOptions.Write.Record.Input != "" { - event.Properties["input_type"] = "argument" - } else if p.CLIOptions.Write.XCliOptions.InputFile != "" { - event.Properties["input_type"] = "file" - } else if len(p.CLIOptions.Write.XCliOptions.InputStdin) > 0 { - event.Properties["input_type"] = "stdin" - } - - if p.CLIOptions.Write.EncodeOptions != nil { - event.Properties["encode_type"] = p.CLIOptions.Write.EncodeOptions.EncodeType.String() - - if p.CLIOptions.Write.EncodeOptions.EncodeType == encoding.EncodeType_ENCODE_TYPE_JSONPB { - // Using FD's or dir? - if p.CLIOptions.Write.EncodeOptions.ProtobufSettings.ProtobufDescriptorSet != "" { - event.Properties["protobuf_type"] = "fds" - } else { - event.Properties["protobuf_type"] = "dir" - } - - // Set envelope info - event.Properties["protobuf_envelope"] = p.CLIOptions.Write.EncodeOptions.ProtobufSettings.ProtobufEnvelopeType.String() - } - } - - p.Config.Telemetry.Enqueue(event) -} diff --git a/plumber/plumber.go b/plumber/plumber.go index 3ff090907..acc2f9c48 100644 --- a/plumber/plumber.go +++ b/plumber/plumber.go @@ -10,8 +10,6 @@ import ( "github.com/pkg/errors" "github.com/sirupsen/logrus" - "github.com/streamdal/plumber/telemetry" - "github.com/batchcorp/kong" "github.com/batchcorp/plumber-schemas/build/go/protos/encoding" @@ -33,12 +31,10 @@ var ( ErrMissingPersistentConfig = errors.New("PersistentConfig cannot be nil") ErrMissingKongCtx = errors.New("KongCtx cannot be nil") ErrMissingActions = errors.New("Actions cannot be nil") - ErrMissingTelemetry = errors.New("Telemetry cannot be nil") ) // Config contains configurable options for instantiating a new Plumber type Config struct { - Telemetry telemetry.ITelemetry PersistentConfig *config.Config Actions actions.IActions ServiceShutdownCtx context.Context @@ -236,11 +232,5 @@ func validateConfig(cfg *Config) error { return ErrMissingActions } - if cfg.PersistentConfig.EnableTelemetry { - if cfg.Telemetry == nil { - return ErrMissingTelemetry - } - } - return nil } diff --git a/telemetry/logger.go b/telemetry/logger.go deleted file mode 100644 index a7b9280f7..000000000 --- a/telemetry/logger.go +++ /dev/null @@ -1,11 +0,0 @@ -package telemetry - -type NoopLogger struct{} - -func (l *NoopLogger) Logf(format string, args ...interface{}) { - // NOOP -} - -func (l *NoopLogger) Errorf(format string, args ...interface{}) { - // NOOP -} diff --git a/telemetry/telemetry.go b/telemetry/telemetry.go deleted file mode 100644 index 7079855f8..000000000 --- a/telemetry/telemetry.go +++ /dev/null @@ -1,139 +0,0 @@ -package telemetry - -import ( - "net/http" - "runtime" - "time" - - "github.com/pkg/errors" - "github.com/posthog/posthog-go" - uuid "github.com/satori/go.uuid" - "github.com/sirupsen/logrus" - - "github.com/batchcorp/plumber-schemas/build/go/protos/opts" - - "github.com/streamdal/plumber/options" -) - -const ( - APIURL = "https://telemetry.streamdal.com" -) - -type ITelemetry interface { - Enqueue(c posthog.Capture) error -} - -type Config struct { - Token string - PlumberID string - CLIOptions *opts.CLIOptions - - // optional - RoundTripper http.RoundTripper -} - -type Telemetry struct { - Client posthog.Client - cfg *Config - log *logrus.Entry -} - -type NoopTelemetry struct{} - -func New(cfg *Config) (*Telemetry, error) { - if err := validateConfig(cfg); err != nil { - return nil, errors.Wrap(err, "unable to validate config") - } - - client, err := posthog.NewWithConfig(cfg.Token, posthog.Config{ - Endpoint: APIURL, - Transport: cfg.RoundTripper, // posthog lib will instantiate a default roundtripper if nil - BatchSize: 1, - Interval: 250 * time.Millisecond, - Logger: &NoopLogger{}, - }) - - if err != nil { - return nil, errors.Wrap(err, "unable to create telemetry client") - } - - return &Telemetry{ - Client: client, - cfg: cfg, - log: logrus.WithField("pkg", "telemetry"), - }, nil -} - -func validateConfig(cfg *Config) error { - if cfg == nil { - return errors.New("config cannot be nil") - } - - if cfg.Token == "" { - return errors.New("config.Token cannot be empty") - } - - if cfg.PlumberID == "" { - return errors.New("config.PlumberID cannot be empty") - } - - if cfg.CLIOptions == nil { - return errors.New("CLIOptions cannot be nil") - } - - return nil -} - -func (t *Telemetry) Enqueue(c posthog.Capture) error { - if c.Event == "" { - err := errors.New("Event cannot be empty") - t.log.Warningf("unable to track analytic event: %s", err) - - return err - } - - // This should _usually_ be already set to plumber ID - if c.DistinctId == "" { - c.DistinctId = uuid.NewV4().String() - } - - if c.Properties == nil { - c.Properties = make(map[string]interface{}) - } - - if _, ok := c.Properties["debug"]; !ok { - c.Properties["debug"] = t.cfg.CLIOptions.Global.Debug - } - - if _, ok := c.Properties["quiet"]; !ok { - c.Properties["debug"] = t.cfg.CLIOptions.Global.Quiet - } - - if _, ok := c.Properties["version"]; !ok { - c.Properties["version"] = options.VERSION - } - - if _, ok := c.Properties["os"]; !ok { - c.Properties["os"] = runtime.GOOS - } - - if _, ok := c.Properties["arch"]; !ok { - c.Properties["arch"] = runtime.GOARCH - } - - if _, ok := c.Properties["plumber_id"]; !ok { - c.Properties["plumber_id"] = t.cfg.PlumberID - } - - err := t.Client.Enqueue(c) - if err != nil { - t.log.Warningf("unable to send telemetry event: %s", err) - return errors.Wrap(err, "unable to send telemetry event") - } - - return nil -} - -func (t *NoopTelemetry) Enqueue(_ posthog.Capture) error { - return nil -} diff --git a/vendor/github.com/posthog/posthog-go/.gitignore b/vendor/github.com/posthog/posthog-go/.gitignore deleted file mode 100644 index aefc4fd5c..000000000 --- a/vendor/github.com/posthog/posthog-go/.gitignore +++ /dev/null @@ -1,33 +0,0 @@ -# Compiled Object files, Static and Dynamic libs (Shared Objects) -*.o -*.a -*.so - -# Folders -_obj -_test -.idea - -# Architecture specific extensions/prefixes -*.[568vq] -[568vq].out - -*.cgo1.go -*.cgo2.c -_cgo_defun.c -_cgo_gotypes.go -_cgo_export.* - -_testmain.go - -*.exe -*.test -*.prof - -# Emacs -*~ -\#* -.\#* - -# Artifacts -tmp/* diff --git a/vendor/github.com/posthog/posthog-go/CHANGELOG.md b/vendor/github.com/posthog/posthog-go/CHANGELOG.md deleted file mode 100644 index 4fbb7c659..000000000 --- a/vendor/github.com/posthog/posthog-go/CHANGELOG.md +++ /dev/null @@ -1,9 +0,0 @@ -# 2.0.0 - 2022-08-15 - -Breaking changes: - -1. Minimum PostHog version requirement: 1.38 -2. Local Evaluation added to IsFeatureEnabled and GetFeatureFlag. These functions now accept person and group properties arguments. The arguments will be used to locally evaluate relevant feature flags. -3. Feature flag functions take a payload called `FeatureFlagPayload` when a key is require and `FeatureFlagPayloadNoKey` when a key is not required. The payload will handle defaults for all unspecified arguments automatically. -3. Feature Flag defaults have been removed. If the flag fails for any reason, nil will be returned. -4. GetAllFlags argument added. This function returns all flags related to the id. \ No newline at end of file diff --git a/vendor/github.com/posthog/posthog-go/LICENSE.md b/vendor/github.com/posthog/posthog-go/LICENSE.md deleted file mode 100644 index 922b77cb6..000000000 --- a/vendor/github.com/posthog/posthog-go/LICENSE.md +++ /dev/null @@ -1,23 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2020 PostHog (part of Hiberly Inc) - -Copyright (c) 2016 Segment, Inc. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/vendor/github.com/posthog/posthog-go/Makefile b/vendor/github.com/posthog/posthog-go/Makefile deleted file mode 100644 index f1c135d61..000000000 --- a/vendor/github.com/posthog/posthog-go/Makefile +++ /dev/null @@ -1,22 +0,0 @@ -ifndef CIRCLE_ARTIFACTS -CIRCLE_ARTIFACTS=tmp -endif - -dependencies: - @go get -v -t ./... - -vet: - @go vet ./... - -test: vet - @mkdir -p ${CIRCLE_ARTIFACTS} - @go test -race -coverprofile=${CIRCLE_ARTIFACTS}/cover.out . - @go tool cover -func ${CIRCLE_ARTIFACTS}/cover.out -o ${CIRCLE_ARTIFACTS}/cover.txt - @go tool cover -html ${CIRCLE_ARTIFACTS}/cover.out -o ${CIRCLE_ARTIFACTS}/cover.html - -build: test - @go build ./... - -ci: dependencies test - -.PHONY: dependencies vet test ci diff --git a/vendor/github.com/posthog/posthog-go/README.md b/vendor/github.com/posthog/posthog-go/README.md deleted file mode 100644 index 95e8a94db..000000000 --- a/vendor/github.com/posthog/posthog-go/README.md +++ /dev/null @@ -1,63 +0,0 @@ -# PostHog Go - -Please see the main [PostHog docs](https://posthog.com/docs). - -Specifically, the [Go integration](https://posthog.com/docs/integrations/go-integration) details. - -# Quickstart - -Install posthog to your gopath -```bash -$ go get github.com/posthog/posthog-go -``` - -Go 🦔! -```go -package main - -import ( - "os" - "github.com/posthog/posthog-go" -) - -func main() { - client := posthog.New(os.Getenv("POSTHOG_API_KEY")) - defer client.Close() - - // Capture an event - client.Enqueue(posthog.Capture{ - DistinctId: "test-user", - Event: "test-snippet", - Properties: posthog.NewProperties(). - Set("plan", "Enterprise"). - Set("friends", 42), - }) - - // Add context for a user - client.Enqueue(posthog.Identify{ - DistinctId: "user:123", - Properties: posthog.NewProperties(). - Set("email", "john@doe.com"). - Set("proUser", false), - }) - - // Link user contexts - client.Enqueue(posthog.Alias{ - DistinctId: "user:123", - Alias: "user:12345", - }) - - // Capture a pageview - client.Enqueue(posthog.Capture{ - DistinctId: "test-user", - Event: "$pageview", - Properties: posthog.NewProperties(). - Set("$current_url", "https://example.com"), - }) -} - -``` - -## Questions? - -### [Join our Slack community.](https://join.slack.com/t/posthogusers/shared_invite/enQtOTY0MzU5NjAwMDY3LTc2MWQ0OTZlNjhkODk3ZDI3NDVjMDE1YjgxY2I4ZjI4MzJhZmVmNjJkN2NmMGJmMzc2N2U3Yjc3ZjI5NGFlZDQ) diff --git a/vendor/github.com/posthog/posthog-go/alias.go b/vendor/github.com/posthog/posthog-go/alias.go deleted file mode 100644 index 7e1c20fca..000000000 --- a/vendor/github.com/posthog/posthog-go/alias.go +++ /dev/null @@ -1,79 +0,0 @@ -package posthog - -import "time" - -var _ Message = (*Alias)(nil) - -// This type represents object sent in a alias call -type Alias struct { - // This field is exported for serialization purposes and shouldn't be set by - // the application, its value is always overwritten by the library. - Type string - - Alias string - DistinctId string - Timestamp time.Time -} - -func (msg Alias) internal() { - panic(unimplementedError) -} - -func (msg Alias) Validate() error { - if len(msg.DistinctId) == 0 { - return FieldError{ - Type: "posthog.Alias", - Name: "DistinctId", - Value: msg.DistinctId, - } - } - - if len(msg.Alias) == 0 { - return FieldError{ - Type: "posthog.Alias", - Name: "Alias", - Value: msg.Alias, - } - } - - return nil -} - -type AliasInApiProperties struct { - DistinctId string `json:"distinct_id"` - Alias string `json:"alias"` - Lib string `json:"$lib"` - LibVersion string `json:"$lib_version"` -} - -type AliasInApi struct { - Type string `json:"type"` - Library string `json:"library"` - LibraryVersion string `json:"library_version"` - Timestamp time.Time `json:"timestamp"` - - Properties AliasInApiProperties `json:"properties"` - - Event string `json:"event"` -} - -func (msg Alias) APIfy() APIMessage { - library := "posthog-go" - libraryVersion := getVersion() - - apified := AliasInApi{ - Type: msg.Type, - Event: "$create_alias", - Library: library, - LibraryVersion: libraryVersion, - Timestamp: msg.Timestamp, - Properties: AliasInApiProperties{ - DistinctId: msg.DistinctId, - Alias: msg.Alias, - Lib: library, - LibVersion: libraryVersion, - }, - } - - return apified -} diff --git a/vendor/github.com/posthog/posthog-go/backo.go b/vendor/github.com/posthog/posthog-go/backo.go deleted file mode 100644 index 184452184..000000000 --- a/vendor/github.com/posthog/posthog-go/backo.go +++ /dev/null @@ -1,83 +0,0 @@ -package posthog - -import ( - "math" - "math/rand" - "time" -) - -type Backo struct { - base time.Duration - factor uint8 - jitter float64 - cap time.Duration -} - -// Creates a backo instance with the given parameters -func NewBacko(base time.Duration, factor uint8, jitter float64, cap time.Duration) *Backo { - return &Backo{base, factor, jitter, cap} -} - -// Creates a backo instance with the following defaults: -// base: 100 milliseconds -// factor: 2 -// jitter: 0 -// cap: 10 seconds -func DefaultBacko() *Backo { - return NewBacko(time.Millisecond*100, 2, 0, time.Second*10) -} - -// Duration returns the backoff interval for the given attempt. -func (backo *Backo) Duration(attempt int) time.Duration { - duration := float64(backo.base) * math.Pow(float64(backo.factor), float64(attempt)) - - if backo.jitter != 0 { - random := rand.Float64() - deviation := math.Floor(random * backo.jitter * duration) - if (int(math.Floor(random*10)) & 1) == 0 { - duration = duration - deviation - } else { - duration = duration + deviation - } - } - - duration = math.Min(float64(duration), float64(backo.cap)) - return time.Duration(duration) -} - -// Sleep pauses the current goroutine for the backoff interval for the given attempt. -func (backo *Backo) Sleep(attempt int) { - duration := backo.Duration(attempt) - time.Sleep(duration) -} - -type Ticker struct { - done chan struct{} - C <-chan time.Time -} - -func (b *Backo) NewTicker() *Ticker { - c := make(chan time.Time, 1) - ticker := &Ticker{ - done: make(chan struct{}, 1), - C: c, - } - - go func() { - for i := 0; ; i++ { - select { - case t := <-time.After(b.Duration(i)): - c <- t - case <-ticker.done: - close(c) - return - } - } - }() - - return ticker -} - -func (t *Ticker) Stop() { - t.done <- struct{}{} -} diff --git a/vendor/github.com/posthog/posthog-go/capture.go b/vendor/github.com/posthog/posthog-go/capture.go deleted file mode 100644 index b54acde0f..000000000 --- a/vendor/github.com/posthog/posthog-go/capture.go +++ /dev/null @@ -1,84 +0,0 @@ -package posthog - -import "time" - -var _ Message = (*Capture)(nil) - -// This type represents object sent in a capture call -type Capture struct { - // This field is exported for serialization purposes and shouldn't be set by - // the application, its value is always overwritten by the library. - Type string - - DistinctId string - Event string - Timestamp time.Time - Properties Properties - Groups Groups - SendFeatureFlags bool -} - -func (msg Capture) internal() { - panic(unimplementedError) -} - -func (msg Capture) Validate() error { - if len(msg.Event) == 0 { - return FieldError{ - Type: "posthog.Capture", - Name: "Event", - Value: msg.Event, - } - } - - if len(msg.DistinctId) == 0 { - return FieldError{ - Type: "posthog.Capture", - Name: "DistinctId", - Value: msg.DistinctId, - } - } - - return nil -} - -type CaptureInApi struct { - Type string `json:"type"` - Library string `json:"library"` - LibraryVersion string `json:"library_version"` - Timestamp time.Time `json:"timestamp"` - - DistinctId string `json:"distinct_id"` - Event string `json:"event"` - Properties Properties `json:"properties"` - SendFeatureFlags bool `json:"send_feature_flags"` -} - -func (msg Capture) APIfy() APIMessage { - library := "posthog-go" - libraryVersion := getVersion() - - myProperties := Properties{}.Set("$lib", library).Set("$lib_version", libraryVersion) - - if msg.Properties != nil { - for k, v := range msg.Properties { - myProperties[k] = v - } - } - - if msg.Groups != nil { - myProperties.Set("$groups", msg.Groups) - } - - apified := CaptureInApi{ - Type: msg.Type, - Library: library, - LibraryVersion: libraryVersion, - Timestamp: msg.Timestamp, - DistinctId: msg.DistinctId, - Event: msg.Event, - Properties: myProperties, - } - - return apified -} diff --git a/vendor/github.com/posthog/posthog-go/config.go b/vendor/github.com/posthog/posthog-go/config.go deleted file mode 100644 index cdd56c2a3..000000000 --- a/vendor/github.com/posthog/posthog-go/config.go +++ /dev/null @@ -1,172 +0,0 @@ -package posthog - -import ( - "github.com/xtgo/uuid" - "net/http" - "time" -) - -// Instances of this type carry the different configuration options that may -// be set when instantiating a client. -// -// Each field's zero-value is either meaningful or interpreted as using the -// default value defined by the library. -type Config struct { - - // The endpoint to which the client connect and send their messages, set to - // `DefaultEndpoint` by default. - Endpoint string - - // You must specify a Personal API Key to use feature flags - // More information on how to get one: https://posthog.com/docs/api/overview - PersonalApiKey string - - // The flushing interval of the client. Messages will be sent when they've - // been queued up to the maximum batch size or when the flushing interval - // timer triggers. - Interval time.Duration - - // Interval at which to fetch new feature flags, 5min by default - DefaultFeatureFlagsPollingInterval time.Duration - - // The HTTP transport used by the client, this allows an application to - // redefine how requests are being sent at the HTTP level (for example, - // to change the connection pooling policy). - // If none is specified the client uses `http.DefaultTransport`. - Transport http.RoundTripper - - // The logger used by the client to output info or error messages when that - // are generated by background operations. - // If none is specified the client uses a standard logger that outputs to - // `os.Stderr`. - Logger Logger - - // The callback object that will be used by the client to notify the - // application when messages sends to the backend API succeeded or failed. - Callback Callback - - // The maximum number of messages that will be sent in one API call. - // Messages will be sent when they've been queued up to the maximum batch - // size or when the flushing interval timer triggers. - // Note that the API will still enforce a 500KB limit on each HTTP request - // which is independent from the number of embedded messages. - BatchSize int - - // When set to true the client will send more frequent and detailed messages - // to its logger. - Verbose bool - - // The retry policy used by the client to resend requests that have failed. - // The function is called with how many times the operation has been retried - // and is expected to return how long the client should wait before trying - // again. - // If not set the client will fallback to use a default retry policy. - RetryAfter func(int) time.Duration - - // A function called by the client to generate unique message identifiers. - // The client uses a UUID generator if none is provided. - // This field is not exported and only exposed internally to let unit tests - // mock the id generation. - uid func() string - - // A function called by the client to get the current time, `time.Now` is - // used by default. - // This field is not exported and only exposed internally to let unit tests - // mock the current time. - now func() time.Time - - // The maximum number of goroutines that will be spawned by a client to send - // requests to the backend API. - // This field is not exported and only exposed internally to let unit tests - // mock the current time. - maxConcurrentRequests int -} - -// This constant sets the default endpoint to which client instances send -// messages if none was explictly set. -const DefaultEndpoint = "https://app.posthog.com" - -// This constant sets the default flush interval used by client instances if -// none was explicitly set. -const DefaultInterval = 5 * time.Second - -// Specifies the default interval at which to fetch new feature flags -const DefaultFeatureFlagsPollingInterval = 5 * time.Minute - -// This constant sets the default batch size used by client instances if none -// was explicitly set. -const DefaultBatchSize = 250 - -// Verifies that fields that don't have zero-values are set to valid values, -// returns an error describing the problem if a field was invalid. -func (c *Config) validate() error { - if c.Interval < 0 { - return ConfigError{ - Reason: "negative time intervals are not supported", - Field: "Interval", - Value: c.Interval, - } - } - - if c.BatchSize < 0 { - return ConfigError{ - Reason: "negative batch sizes are not supported", - Field: "BatchSize", - Value: c.BatchSize, - } - } - - return nil -} - -// Given a config object as argument the function will set all zero-values to -// their defaults and return the modified object. -func makeConfig(c Config) Config { - if len(c.Endpoint) == 0 { - c.Endpoint = DefaultEndpoint - } - - if c.Interval == 0 { - c.Interval = DefaultInterval - } - - if c.DefaultFeatureFlagsPollingInterval == 0 { - c.DefaultFeatureFlagsPollingInterval = DefaultInterval - } - - if c.Transport == nil { - c.Transport = http.DefaultTransport - } - - if c.Logger == nil { - c.Logger = newDefaultLogger() - } - - if c.BatchSize == 0 { - c.BatchSize = DefaultBatchSize - } - - if c.RetryAfter == nil { - c.RetryAfter = DefaultBacko().Duration - } - - if c.uid == nil { - c.uid = uid - } - - if c.now == nil { - c.now = time.Now - } - - if c.maxConcurrentRequests == 0 { - c.maxConcurrentRequests = 1000 - } - - return c -} - -// This function returns a string representation of a UUID, it's the default -// function used for generating unique IDs. -func uid() string { - return uuid.NewRandom().String() -} diff --git a/vendor/github.com/posthog/posthog-go/error.go b/vendor/github.com/posthog/posthog-go/error.go deleted file mode 100644 index 60bebb5a9..000000000 --- a/vendor/github.com/posthog/posthog-go/error.go +++ /dev/null @@ -1,60 +0,0 @@ -package posthog - -import ( - "errors" - "fmt" -) - -// Returned by the `NewWithConfig` function when the one of the configuration -// fields was set to an impossible value (like a negative duration). -type ConfigError struct { - - // A human-readable message explaining why the configuration field's value - // is invalid. - Reason string - - // The name of the configuration field that was carrying an invalid value. - Field string - - // The value of the configuration field that caused the error. - Value interface{} -} - -func (e ConfigError) Error() string { - return fmt.Sprintf("posthog.NewWithConfig: %s (posthog.Config.%s: %#v)", e.Reason, e.Field, e.Value) -} - -// Instances of this type are used to represent errors returned when a field was -// no initialize properly in a structure passed as argument to one of the -// functions of this package. -type FieldError struct { - - // The human-readable representation of the type of structure that wasn't - // initialized properly. - Type string - - // The name of the field that wasn't properly initialized. - Name string - - // The value of the field that wasn't properly initialized. - Value interface{} -} - -func (e FieldError) Error() string { - return fmt.Sprintf("%s.%s: invalid field value: %#v", e.Type, e.Name, e.Value) -} - -var ( - // This error is returned by methods of the `Client` interface when they are - // called after the client was already closed. - ErrClosed = errors.New("the client was already closed") - - // This error is used to notify the application that too many requests are - // already being sent and no more messages can be accepted. - ErrTooManyRequests = errors.New("too many requests are already in-flight") - - // This error is used to notify the client callbacks that a message send - // failed because the JSON representation of a message exceeded the upper - // limit. - ErrMessageTooBig = errors.New("the message exceeds the maximum allowed size") -) diff --git a/vendor/github.com/posthog/posthog-go/executor.go b/vendor/github.com/posthog/posthog-go/executor.go deleted file mode 100644 index 05725fd77..000000000 --- a/vendor/github.com/posthog/posthog-go/executor.go +++ /dev/null @@ -1,53 +0,0 @@ -package posthog - -import "sync" - -type executor struct { - queue chan func() - mutex sync.Mutex - size int - cap int -} - -func newExecutor(cap int) *executor { - e := &executor{ - queue: make(chan func(), 1), - cap: cap, - } - go e.loop() - return e -} - -func (e *executor) do(task func()) (ok bool) { - e.mutex.Lock() - - if e.size != e.cap { - e.queue <- task - e.size++ - ok = true - } - - e.mutex.Unlock() - return -} - -func (e *executor) close() { - close(e.queue) -} - -func (e *executor) loop() { - for task := range e.queue { - go e.run(task) - } -} - -func (e *executor) run(task func()) { - defer e.done() - task() -} - -func (e *executor) done() { - e.mutex.Lock() - e.size-- - e.mutex.Unlock() -} diff --git a/vendor/github.com/posthog/posthog-go/feature_flag_config.go b/vendor/github.com/posthog/posthog-go/feature_flag_config.go deleted file mode 100644 index 4bbc430c2..000000000 --- a/vendor/github.com/posthog/posthog-go/feature_flag_config.go +++ /dev/null @@ -1,84 +0,0 @@ -package posthog - -type FeatureFlagPayload struct { - Key string - DistinctId string - Groups Groups - PersonProperties Properties - GroupProperties map[string]Properties - OnlyEvaluateLocally bool - SendFeatureFlagEvents *bool -} - -func (c *FeatureFlagPayload) validate() error { - if len(c.Key) == 0 { - return ConfigError{ - Reason: "Feature Flag Key required", - Field: "Key", - Value: c.Key, - } - } - - if len(c.DistinctId) == 0 { - return ConfigError{ - Reason: "DistinctId required", - Field: "Distinct Id", - Value: c.DistinctId, - } - } - - if c.Groups == nil { - c.Groups = Groups{} - } - - if c.PersonProperties == nil { - c.PersonProperties = NewProperties() - } - - if c.GroupProperties == nil { - c.GroupProperties = map[string]Properties{} - } - - if c.SendFeatureFlagEvents == nil { - tempTrue := true - c.SendFeatureFlagEvents = &tempTrue - } - return nil -} - -type FeatureFlagPayloadNoKey struct { - DistinctId string - Groups Groups - PersonProperties Properties - GroupProperties map[string]Properties - OnlyEvaluateLocally bool - SendFeatureFlagEvents *bool -} - -func (c *FeatureFlagPayloadNoKey) validate() error { - if len(c.DistinctId) == 0 { - return ConfigError{ - Reason: "DistinctId required", - Field: "Distinct Id", - Value: c.DistinctId, - } - } - - if c.Groups == nil { - c.Groups = Groups{} - } - - if c.PersonProperties == nil { - c.PersonProperties = NewProperties() - } - - if c.GroupProperties == nil { - c.GroupProperties = map[string]Properties{} - } - - if c.SendFeatureFlagEvents == nil { - tempTrue := true - c.SendFeatureFlagEvents = &tempTrue - } - return nil -} diff --git a/vendor/github.com/posthog/posthog-go/featureflags.go b/vendor/github.com/posthog/posthog-go/featureflags.go deleted file mode 100644 index a433ef98f..000000000 --- a/vendor/github.com/posthog/posthog-go/featureflags.go +++ /dev/null @@ -1,758 +0,0 @@ -package posthog - -import ( - "bytes" - "crypto/sha1" - "encoding/json" - "errors" - "fmt" - "io/ioutil" - "net/http" - "net/url" - "regexp" - "strconv" - "strings" - "sync" - "time" -) - -const LONG_SCALE = 0xfffffffffffffff - -type FeatureFlagsPoller struct { - ticker *time.Ticker // periodic ticker - loaded chan bool - shutdown chan bool - forceReload chan bool - featureFlags []FeatureFlag - groups map[string]string - personalApiKey string - projectApiKey string - Errorf func(format string, args ...interface{}) - Endpoint string - http http.Client - mutex sync.RWMutex - fetchedFlagsSuccessfullyOnce bool -} - -type FeatureFlag struct { - Key string `json:"key"` - IsSimpleFlag bool `json:"is_simple_flag"` - RolloutPercentage *uint8 `json:"rollout_percentage"` - Active bool `json:"active"` - Filters Filter `json:"filters"` - EnsureExperienceContinuity *bool `json:"ensure_experience_continuity"` -} - -type Filter struct { - AggregationGroupTypeIndex *uint8 `json:"aggregation_group_type_index"` - Groups []PropertyGroup `json:"groups"` - Multivariate *Variants `json:"multivariate"` -} - -type Variants struct { - Variants []FlagVariant `json:"variants"` -} - -type FlagVariant struct { - Key string `json:"key"` - Name string `json:"name"` - RolloutPercentage *uint8 `json:"rollout_percentage"` -} -type PropertyGroup struct { - Properties []Property `json:"properties"` - RolloutPercentage *uint8 `json:"rollout_percentage"` -} - -type Property struct { - Key string `json:"key"` - Operator string `json:"operator"` - Value interface{} `json:"value"` - Type string `json:"type"` -} - -type FlagVariantMeta struct { - ValueMin float64 - ValueMax float64 - Key string -} - -type FeatureFlagsResponse struct { - Flags []FeatureFlag `json:"flags"` - GroupTypeMapping *map[string]string `json:"group_type_mapping"` -} - -type DecideRequestData struct { - ApiKey string `json:"api_key"` - DistinctId string `json:"distinct_id"` - Groups Groups `json:"groups"` - PersonProperties Properties `json:"person_properties"` - GroupProperties map[string]Properties `json:"group_properties"` -} - -type DecideResponse struct { - FeatureFlags map[string]interface{} `json:"featureFlags"` -} - -type InconclusiveMatchError struct { - msg string -} - -func (e *InconclusiveMatchError) Error() string { - return e.msg -} - -func newFeatureFlagsPoller(projectApiKey string, personalApiKey string, errorf func(format string, args ...interface{}), endpoint string, httpClient http.Client, pollingInterval time.Duration) *FeatureFlagsPoller { - poller := FeatureFlagsPoller{ - ticker: time.NewTicker(pollingInterval), - loaded: make(chan bool), - shutdown: make(chan bool), - forceReload: make(chan bool), - personalApiKey: personalApiKey, - projectApiKey: projectApiKey, - Errorf: errorf, - Endpoint: endpoint, - http: httpClient, - mutex: sync.RWMutex{}, - fetchedFlagsSuccessfullyOnce: false, - } - - go poller.run() - return &poller -} - -func (poller *FeatureFlagsPoller) run() { - poller.fetchNewFeatureFlags() - - for { - select { - case <-poller.shutdown: - close(poller.shutdown) - close(poller.forceReload) - close(poller.loaded) - poller.ticker.Stop() - return - case <-poller.forceReload: - poller.fetchNewFeatureFlags() - case <-poller.ticker.C: - poller.fetchNewFeatureFlags() - } - } -} - -func (poller *FeatureFlagsPoller) fetchNewFeatureFlags() { - personalApiKey := poller.personalApiKey - headers := [][2]string{{"Authorization", "Bearer " + personalApiKey + ""}} - res, err := poller.localEvaluationFlags(headers) - if err != nil || res.StatusCode != http.StatusOK { - poller.loaded <- false - poller.Errorf("Unable to fetch feature flags", err) - } - defer res.Body.Close() - resBody, err := ioutil.ReadAll(res.Body) - if err != nil { - poller.loaded <- false - poller.Errorf("Unable to fetch feature flags", err) - return - } - featureFlagsResponse := FeatureFlagsResponse{} - err = json.Unmarshal([]byte(resBody), &featureFlagsResponse) - if err != nil { - poller.loaded <- false - poller.Errorf("Unable to unmarshal response from api/feature_flag/local_evaluation", err) - return - } - if !poller.fetchedFlagsSuccessfullyOnce { - poller.loaded <- true - } - newFlags := []FeatureFlag{} - for _, flag := range featureFlagsResponse.Flags { - newFlags = append(newFlags, flag) - } - poller.mutex.Lock() - poller.featureFlags = newFlags - if featureFlagsResponse.GroupTypeMapping != nil { - poller.groups = *featureFlagsResponse.GroupTypeMapping - } - poller.fetchedFlagsSuccessfullyOnce = true - poller.mutex.Unlock() - -} - -func (poller *FeatureFlagsPoller) GetFeatureFlag(flagConfig FeatureFlagPayload) (interface{}, error) { - - featureFlags := poller.GetFeatureFlags() - - featureFlag := FeatureFlag{Key: ""} - - // avoid using flag for conflicts with Golang's stdlib `flag` - for _, storedFlag := range featureFlags { - if flagConfig.Key == storedFlag.Key { - featureFlag = storedFlag - break - } - } - - var result interface{} - var err error - - if featureFlag.Key != "" { - result, err = poller.computeFlagLocally(featureFlag, flagConfig.DistinctId, flagConfig.Groups, flagConfig.PersonProperties, flagConfig.GroupProperties) - } - - if err != nil { - poller.Errorf("Unable to compute flag locally - %s", err) - } - - if (err != nil || result == nil) && !flagConfig.OnlyEvaluateLocally { - - result, err = poller.getFeatureFlagVariant(featureFlag, flagConfig.Key, flagConfig.DistinctId, flagConfig.PersonProperties, flagConfig.GroupProperties) - if err != nil { - return nil, nil - } - } - - return result, err -} - -func (poller *FeatureFlagsPoller) GetAllFlags(flagConfig FeatureFlagPayloadNoKey) (map[string]interface{}, error) { - response := map[string]interface{}{} - featureFlags := poller.GetFeatureFlags() - fallbackToDecide := false - - if len(featureFlags) == 0 { - fallbackToDecide = true - } else { - for _, storedFlag := range featureFlags { - result, err := poller.computeFlagLocally(storedFlag, flagConfig.DistinctId, flagConfig.Groups, flagConfig.PersonProperties, flagConfig.GroupProperties) - if err != nil { - poller.Errorf("Unable to compute flag locally - %s", err) - fallbackToDecide = true - } else { - response[storedFlag.Key] = result - } - } - } - - if fallbackToDecide && !flagConfig.OnlyEvaluateLocally { - result, err := poller.getFeatureFlagVariants(flagConfig.DistinctId, flagConfig.Groups, flagConfig.PersonProperties, flagConfig.GroupProperties) - - if err != nil { - return response, err - } else { - for k, v := range result { - response[k] = v - } - } - } - - return response, nil -} - -func (poller *FeatureFlagsPoller) computeFlagLocally(flag FeatureFlag, distinctId string, groups Groups, personProperties Properties, groupProperties map[string]Properties) (interface{}, error) { - if flag.EnsureExperienceContinuity != nil && *flag.EnsureExperienceContinuity { - return nil, &InconclusiveMatchError{"Flag has experience continuity enabled"} - } - - if !flag.Active { - return false, nil - } - - if flag.Filters.AggregationGroupTypeIndex != nil { - - groupName, exists := poller.groups[fmt.Sprintf("%d", *flag.Filters.AggregationGroupTypeIndex)] - - if !exists { - errMessage := "Flag has unknown group type index" - return nil, errors.New(errMessage) - } - - _, exists = groups[groupName] - - if !exists { - errMessage := fmt.Sprintf("FEATURE FLAGS] Can't compute group feature flag: %s without group names passed in", flag.Key) - return nil, errors.New(errMessage) - } - - focusedGroupProperties := groupProperties[groupName] - return matchFeatureFlagProperties(flag, groups[groupName].(string), focusedGroupProperties) - } else { - return matchFeatureFlagProperties(flag, distinctId, personProperties) - } -} - -func getMatchingVariant(flag FeatureFlag, distinctId string) (interface{}, error) { - lookupTable := getVariantLookupTable(flag) - - hashValue, err := _hash(flag.Key, distinctId, "variant") - - if err != nil { - return nil, err - } - - for _, variant := range lookupTable { - if hashValue >= float64(variant.ValueMin) && hashValue < float64(variant.ValueMax) { - return variant.Key, nil - } - } - - return true, nil -} - -func getVariantLookupTable(flag FeatureFlag) []FlagVariantMeta { - lookupTable := []FlagVariantMeta{} - valueMin := 0.00 - - multivariates := flag.Filters.Multivariate - - if multivariates == nil || multivariates.Variants == nil { - return lookupTable - } - - for _, variant := range multivariates.Variants { - valueMax := float64(valueMin) + float64(*variant.RolloutPercentage)/100 - _flagVariantMeta := FlagVariantMeta{ValueMin: float64(valueMin), ValueMax: valueMax, Key: variant.Key} - lookupTable = append(lookupTable, _flagVariantMeta) - valueMin = float64(valueMax) - } - - return lookupTable - -} - -func matchFeatureFlagProperties(flag FeatureFlag, distinctId string, properties Properties) (interface{}, error) { - conditions := flag.Filters.Groups - isInconclusive := false - - for _, condition := range conditions { - isMatch, err := isConditionMatch(flag, distinctId, condition, properties) - - if err != nil { - if _, ok := err.(*InconclusiveMatchError); ok { - isInconclusive = true - } else { - return nil, err - } - } - - if isMatch { - return getMatchingVariant(flag, distinctId) - } - } - - if isInconclusive { - return false, &InconclusiveMatchError{"Can't determine if feature flag is enabled or not with given properties"} - } - - return false, nil -} - -func isConditionMatch(flag FeatureFlag, distinctId string, condition PropertyGroup, properties Properties) (bool, error) { - - if len(condition.Properties) > 0 { - for _, prop := range condition.Properties { - - isMatch, err := matchProperty(prop, properties) - if err != nil { - return false, err - } - - if !isMatch { - return false, nil - } - } - - if condition.RolloutPercentage != nil { - return true, nil - } - } - - if condition.RolloutPercentage != nil { - return checkIfSimpleFlagEnabled(flag.Key, distinctId, *condition.RolloutPercentage) - } - - return true, nil -} - -func matchProperty(property Property, properties Properties) (bool, error) { - key := property.Key - operator := property.Operator - value := property.Value - if _, ok := properties[key]; !ok { - return false, &InconclusiveMatchError{"Can't match properties without a given property value"} - } - - if operator == "is_not_set" { - return false, &InconclusiveMatchError{"Can't match properties with operator is_not_set"} - } - - override_value, _ := properties[key] - - if operator == "exact" { - switch t := value.(type) { - case []interface{}: - return contains(t, override_value), nil - default: - return value == override_value, nil - } - } - - if operator == "is_not" { - switch t := value.(type) { - case []interface{}: - return !contains(t, override_value), nil - default: - return value != override_value, nil - } - } - - if operator == "is_set" { - return true, nil - } - - if operator == "icontains" { - return strings.Contains(strings.ToLower(fmt.Sprintf("%v", override_value)), strings.ToLower(fmt.Sprintf("%v", value))), nil - } - - if operator == "not_icontains" { - return !strings.Contains(strings.ToLower(fmt.Sprintf("%v", override_value)), strings.ToLower(fmt.Sprintf("%v", value))), nil - } - - if operator == "regex" { - - r, err := regexp.Compile(fmt.Sprintf("%v", value)) - - // invalid regex - if err != nil { - return false, nil - } - - match := r.MatchString(fmt.Sprintf("%v", override_value)) - - if match { - return true, nil - } else { - return false, nil - } - } - - if operator == "not_regex" { - var r *regexp.Regexp - var err error - - if valueString, ok := value.(string); ok { - r, err = regexp.Compile(valueString) - } else if valueInt, ok := value.(int); ok { - valueString = strconv.Itoa(valueInt) - r, err = regexp.Compile(valueString) - } else { - errMessage := "Regex expression not allowed" - return false, errors.New(errMessage) - } - - // invalid regex - if err != nil { - return false, nil - } - - var match bool - if valueString, ok := override_value.(string); ok { - match = r.MatchString(valueString) - } else if valueInt, ok := override_value.(int); ok { - valueString = strconv.Itoa(valueInt) - match = r.MatchString(valueString) - } else { - errMessage := "Value type not supported" - return false, errors.New(errMessage) - } - - if !match { - return true, nil - } else { - return false, nil - } - } - - if operator == "gt" { - valueOrderable, overrideValueOrderable, err := validateOrderable(value, override_value) - if err != nil { - return false, err - } - - return overrideValueOrderable > valueOrderable, nil - } - - if operator == "lt" { - valueOrderable, overrideValueOrderable, err := validateOrderable(value, override_value) - if err != nil { - return false, err - } - - return overrideValueOrderable < valueOrderable, nil - } - - if operator == "gte" { - valueOrderable, overrideValueOrderable, err := validateOrderable(value, override_value) - if err != nil { - return false, err - } - - return overrideValueOrderable >= valueOrderable, nil - } - - if operator == "lte" { - valueOrderable, overrideValueOrderable, err := validateOrderable(value, override_value) - if err != nil { - return false, err - } - - return overrideValueOrderable <= valueOrderable, nil - } - - return false, nil - -} - -func validateOrderable(firstValue interface{}, secondValue interface{}) (float64, float64, error) { - convertedFirstValue, err := interfaceToFloat(firstValue) - - if err != nil { - errMessage := "Value 1 is not orderable" - return 0, 0, errors.New(errMessage) - } - convertedSecondValue, err := interfaceToFloat(secondValue) - - if err != nil { - errMessage := "Value 2 is not orderable" - return 0, 0, errors.New(errMessage) - } - - return convertedFirstValue, convertedSecondValue, nil - -} - -func interfaceToFloat(val interface{}) (float64, error) { - - var i float64 - switch t := val.(type) { - case int: - i = float64(t) - case int8: - i = float64(t) - case int16: - i = float64(t) - case int32: - i = float64(t) - case int64: - i = float64(t) - case float32: - i = float64(t) - case float64: - i = float64(t) - case uint8: - i = float64(t) - case uint16: - i = float64(t) - case uint32: - i = float64(t) - case uint64: - i = float64(t) - default: - errMessage := "Argument not orderable" - return 0.0, errors.New(errMessage) - } - - return i, nil -} - -func contains(s []interface{}, e interface{}) bool { - for _, a := range s { - if a == e { - return true - } - } - return false -} - -func (poller *FeatureFlagsPoller) isSimpleFlagEnabled(key string, distinctId string, rolloutPercentage uint8) (bool, error) { - isEnabled, err := checkIfSimpleFlagEnabled(key, distinctId, rolloutPercentage) - if err != nil { - errMessage := "Error converting string to int" - poller.Errorf(errMessage) - return false, errors.New(errMessage) - } - return isEnabled, nil -} - -// extracted as a regular func for testing purposes -func checkIfSimpleFlagEnabled(key string, distinctId string, rolloutPercentage uint8) (bool, error) { - val, err := _hash(key, distinctId, "") - - if err != nil { - return false, err - } - - return val <= float64(rolloutPercentage)/100, nil -} - -func _hash(key string, distinctId string, salt string) (float64, error) { - hash := sha1.New() - hash.Write([]byte("" + key + "." + distinctId + "" + salt)) - digest := hash.Sum(nil) - hexString := fmt.Sprintf("%x\n", digest)[:15] - - value, err := strconv.ParseInt(hexString, 16, 64) - if err != nil { - return 0, err - } - - return float64(value) / LONG_SCALE, nil - -} - -func (poller *FeatureFlagsPoller) GetFeatureFlags() []FeatureFlag { - // ensure flags are loaded on the first call - - if !poller.fetchedFlagsSuccessfullyOnce { - <-poller.loaded - } - - return poller.featureFlags -} - -func (poller *FeatureFlagsPoller) decide(requestData []byte, headers [][2]string) (*http.Response, error) { - localEvaluationEndpoint := "decide/?v=2" - - url, err := url.Parse(poller.Endpoint + "/" + localEvaluationEndpoint + "") - - if err != nil { - poller.Errorf("creating url - %s", err) - } - - return poller.request("POST", url, requestData, headers) -} - -func (poller *FeatureFlagsPoller) localEvaluationFlags(headers [][2]string) (*http.Response, error) { - localEvaluationEndpoint := "api/feature_flag/local_evaluation" - - url, err := url.Parse(poller.Endpoint + "/" + localEvaluationEndpoint + "") - - if err != nil { - poller.Errorf("creating url - %s", err) - } - searchParams := url.Query() - searchParams.Add("token", poller.projectApiKey) - url.RawQuery = searchParams.Encode() - - return poller.request("GET", url, []byte{}, headers) -} - -func (poller *FeatureFlagsPoller) request(method string, url *url.URL, requestData []byte, headers [][2]string) (*http.Response, error) { - - req, err := http.NewRequest(method, url.String(), bytes.NewReader(requestData)) - if err != nil { - poller.Errorf("creating request - %s", err) - } - - version := getVersion() - - req.Header.Add("User-Agent", "posthog-go (version: "+version+")") - req.Header.Add("Content-Type", "application/json") - req.Header.Add("Content-Length", fmt.Sprintf("%d", len(requestData))) - - for _, header := range headers { - req.Header.Add(header[0], header[1]) - } - - res, err := poller.http.Do(req) - - if err != nil { - poller.Errorf("sending request - %s", err) - } - - return res, err -} - -func (poller *FeatureFlagsPoller) ForceReload() { - poller.forceReload <- true -} - -func (poller *FeatureFlagsPoller) shutdownPoller() { - poller.shutdown <- true -} - -func (poller *FeatureFlagsPoller) getFeatureFlagVariants(distinctId string, groups Groups, personProperties Properties, groupProperties map[string]Properties) (map[string]interface{}, error) { - errorMessage := "Failed when getting flag variants" - requestDataBytes, err := json.Marshal(DecideRequestData{ - ApiKey: poller.projectApiKey, - DistinctId: distinctId, - Groups: groups, - PersonProperties: personProperties, - GroupProperties: groupProperties, - }) - headers := [][2]string{{"Authorization", "Bearer " + poller.personalApiKey + ""}} - if err != nil { - errorMessage = "unable to marshal decide endpoint request data" - poller.Errorf(errorMessage) - return nil, errors.New(errorMessage) - } - res, err := poller.decide(requestDataBytes, headers) - if err != nil || res.StatusCode != http.StatusOK { - errorMessage = "Error calling /decide/" - poller.Errorf(errorMessage) - return nil, errors.New(errorMessage) - } - resBody, err := ioutil.ReadAll(res.Body) - if err != nil { - errorMessage = "Error reading response from /decide/" - poller.Errorf(errorMessage) - return nil, errors.New(errorMessage) - } - defer res.Body.Close() - decideResponse := DecideResponse{} - err = json.Unmarshal([]byte(resBody), &decideResponse) - if err != nil { - errorMessage = "Error parsing response from /decide/" - poller.Errorf(errorMessage) - return nil, errors.New(errorMessage) - } - - return decideResponse.FeatureFlags, nil -} - -func (poller *FeatureFlagsPoller) getFeatureFlagVariant(featureFlag FeatureFlag, key string, distinctId string, personProperties Properties, groupProperties map[string]Properties) (interface{}, error) { - var result interface{} = false - - if featureFlag.IsSimpleFlag { - - // json.Unmarshal will convert JSON `null` to a nullish value for each type - // which is 0 for uint. However, our feature flags should have rolloutPercentage == 100 - // if it is set to `null`. Having rollout percentage be a pointer and deferencing it - // here allows its value to be `nil` following json.Unmarhsal, so we can appropriately - // set it to 100 - rolloutPercentage := uint8(100) - if featureFlag.RolloutPercentage != nil { - rolloutPercentage = *featureFlag.RolloutPercentage - } - var err error - result, err = poller.isSimpleFlagEnabled(key, distinctId, rolloutPercentage) - if err != nil { - return false, err - } - } else { - featureFlagVariants, variantErr := poller.getFeatureFlagVariants(distinctId, nil, personProperties, groupProperties) - - if variantErr != nil { - return false, variantErr - } - - for flagKey, flagValue := range featureFlagVariants { - var flagValueString = fmt.Sprintf("%v", flagValue) - if key == flagKey && flagValueString != "false" { - result = flagValueString - break - } - } - return result, nil - } - return result, nil -} diff --git a/vendor/github.com/posthog/posthog-go/group_identify.go b/vendor/github.com/posthog/posthog-go/group_identify.go deleted file mode 100644 index 52cc210a8..000000000 --- a/vendor/github.com/posthog/posthog-go/group_identify.go +++ /dev/null @@ -1,69 +0,0 @@ -package posthog - -import ( - "fmt" - "time" -) - -type GroupIdentify struct { - Type string - Key string - - DistinctId string - Timestamp time.Time - Properties Properties -} - -func (msg GroupIdentify) internal() { - panic(unimplementedError) -} - -func (msg GroupIdentify) Validate() error { - if len(msg.Type) == 0 { - return FieldError{ - Type: "posthog.GroupIdentify", - Name: "Type", - Value: msg.Type, - } - } - - if len(msg.Key) == 0 { - return FieldError{ - Type: "posthog.GroupIdentify", - Name: "Key", - Value: msg.Key, - } - } - - return nil -} - -type GroupIdentifyInApi struct { - Library string `json:"library"` - LibraryVersion string `json:"library_version"` - Timestamp time.Time `json:"timestamp"` - - Event string `json:"event"` - DistinctId string `json:"distinct_id"` - Properties Properties `json:"properties"` -} - -func (msg GroupIdentify) APIfy() APIMessage { - library := "posthog-go" - - myProperties := Properties{}.Set("$lib", library).Set("$lib_version", getVersion()) - myProperties.Set("$group_type", msg.Type).Set("$group_key", msg.Key).Set("$group_set", msg.Properties) - - distinctId := fmt.Sprintf("$%s_%s", msg.Type, msg.Key) - - apified := GroupIdentifyInApi{ - Event: "$groupidentify", - Properties: myProperties, - DistinctId: distinctId, - Timestamp: msg.Timestamp, - Library: library, - LibraryVersion: getVersion(), - } - - return apified -} diff --git a/vendor/github.com/posthog/posthog-go/groups.go b/vendor/github.com/posthog/posthog-go/groups.go deleted file mode 100644 index 3ec6e47f5..000000000 --- a/vendor/github.com/posthog/posthog-go/groups.go +++ /dev/null @@ -1,17 +0,0 @@ -package posthog - -// This type is used to represent groups in messages that support it. -// It is a free-form object so the application can set any value it sees fit but -// a few helper method are defined to make it easier to instantiate groups with -// common fields. - -type Groups map[string]interface{} - -func NewGroups() Groups { - return make(Groups, 10) -} - -func (p Groups) Set(name string, value interface{}) Groups { - p[name] = value - return p -} diff --git a/vendor/github.com/posthog/posthog-go/identify.go b/vendor/github.com/posthog/posthog-go/identify.go deleted file mode 100644 index 2a6399f8b..000000000 --- a/vendor/github.com/posthog/posthog-go/identify.go +++ /dev/null @@ -1,64 +0,0 @@ -package posthog - -import "time" - -var _ Message = (*Identify)(nil) - -// This type represents object sent in an identify call -type Identify struct { - // This field is exported for serialization purposes and shouldn't be set by - // the application, its value is always overwritten by the library. - Type string - - DistinctId string - Timestamp time.Time - Properties Properties -} - -func (msg Identify) internal() { - panic(unimplementedError) -} - -func (msg Identify) Validate() error { - if len(msg.DistinctId) == 0 { - return FieldError{ - Type: "posthog.Identify", - Name: "DistinctId", - Value: msg.DistinctId, - } - } - - return nil -} - -type IdentifyInApi struct { - Type string `json:"type"` - Library string `json:"library"` - LibraryVersion string `json:"library_version"` - Timestamp time.Time `json:"timestamp"` - - Event string `json:"event"` - DistinctId string `json:"distinct_id"` - Properties Properties `json:"properties"` - Set Properties `json:"$set"` -} - -func (msg Identify) APIfy() APIMessage { - library := "posthog-go" - - myProperties := Properties{}.Set("$lib", library).Set("$lib_version", getVersion()) - - apified := IdentifyInApi{ - Type: msg.Type, - Event: "$identify", - Library: library, - LibraryVersion: getVersion(), - Timestamp: msg.Timestamp, - DistinctId: msg.DistinctId, - - Properties: myProperties, - Set: msg.Properties, - } - - return apified -} diff --git a/vendor/github.com/posthog/posthog-go/json.go b/vendor/github.com/posthog/posthog-go/json.go deleted file mode 100644 index 7cbdb13fc..000000000 --- a/vendor/github.com/posthog/posthog-go/json.go +++ /dev/null @@ -1,87 +0,0 @@ -package posthog - -import ( - "reflect" - "strings" -) - -// Imitate what what the JSON package would do when serializing a struct value, -// the only difference is we we don't serialize zero-value struct fields as well. -// Note that this function doesn't recursively convert structures to maps, only -// the value passed as argument is transformed. -func structToMap(v reflect.Value, m map[string]interface{}) map[string]interface{} { - t := v.Type() - n := t.NumField() - - if m == nil { - m = make(map[string]interface{}, n) - } - - for i := 0; i != n; i++ { - field := t.Field(i) - value := v.Field(i) - name, omitempty := parseJsonTag(field.Tag.Get("json"), field.Name) - - if name != "-" && !(omitempty && isZeroValue(value)) { - m[name] = value.Interface() - } - } - - return m -} - -// Parses a JSON tag the way the json package would do it, returing the expected -// name of the field once serialized and if empty values should be omitted. -func parseJsonTag(tag string, defName string) (name string, omitempty bool) { - args := strings.Split(tag, ",") - - if len(args) == 0 || len(args[0]) == 0 { - name = defName - } else { - name = args[0] - } - - if len(args) > 1 && args[1] == "omitempty" { - omitempty = true - } - - return -} - -// Checks if the value given as argument is a zero-value, it is based on the -// isEmptyValue function in https://golang.org/src/encoding/json/encode.go -// but also checks struct types recursively. -func isZeroValue(v reflect.Value) bool { - switch v.Kind() { - case reflect.Array, reflect.Map, reflect.Slice, reflect.String: - return v.Len() == 0 - - case reflect.Bool: - return !v.Bool() - - case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: - return v.Int() == 0 - - case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr: - return v.Uint() == 0 - - case reflect.Float32, reflect.Float64: - return v.Float() == 0 - - case reflect.Interface, reflect.Ptr: - return v.IsNil() - - case reflect.Struct: - for i, n := 0, v.NumField(); i != n; i++ { - if !isZeroValue(v.Field(i)) { - return false - } - } - return true - - case reflect.Invalid: - return true - } - - return false -} diff --git a/vendor/github.com/posthog/posthog-go/logger.go b/vendor/github.com/posthog/posthog-go/logger.go deleted file mode 100644 index e1a70f132..000000000 --- a/vendor/github.com/posthog/posthog-go/logger.go +++ /dev/null @@ -1,47 +0,0 @@ -package posthog - -import ( - "log" - "os" -) - -// Instances of types implementing this interface can be used to define where -// the posthog client logs are written. -type Logger interface { - - // PostHog clients call this method to log regular messages about the - // operations they perform. - // Messages logged by this method are usually tagged with an `INFO` log - // level in common logging libraries. - Logf(format string, args ...interface{}) - - // PostHog clients call this method to log errors they encounter while - // sending events to the backend servers. - // Messages logged by this method are usually tagged with an `ERROR` log - // level in common logging libraries. - Errorf(format string, args ...interface{}) -} - -// This function instantiate an object that statisfies the posthog.Logger -// interface and send logs to standard logger passed as argument. -func StdLogger(logger *log.Logger) Logger { - return stdLogger{ - logger: logger, - } -} - -type stdLogger struct { - logger *log.Logger -} - -func (l stdLogger) Logf(format string, args ...interface{}) { - l.logger.Printf("INFO: "+format, args...) -} - -func (l stdLogger) Errorf(format string, args ...interface{}) { - l.logger.Printf("ERROR: "+format, args...) -} - -func newDefaultLogger() Logger { - return StdLogger(log.New(os.Stderr, "posthog ", log.LstdFlags)) -} diff --git a/vendor/github.com/posthog/posthog-go/message.go b/vendor/github.com/posthog/posthog-go/message.go deleted file mode 100644 index 2edd4edc0..000000000 --- a/vendor/github.com/posthog/posthog-go/message.go +++ /dev/null @@ -1,123 +0,0 @@ -package posthog - -import ( - "encoding/json" - "time" -) - -// Values implementing this interface are used by posthog clients to notify -// the application when a message send succeeded or failed. -// -// Callback methods are called by a client's internal goroutines, there are no -// guarantees on which goroutine will trigger the callbacks, the calls can be -// made sequentially or in parallel, the order doesn't depend on the order of -// messages were queued to the client. -// -// Callback methods must return quickly and not cause long blocking operations -// to avoid interferring with the client's internal work flow. -type Callback interface { - - // This method is called for every message that was successfully sent to - // the API. - Success(APIMessage) - - // This method is called for every message that failed to be sent to the - // API and will be discarded by the client. - Failure(APIMessage, error) -} - -// This interface is used to represent posthog objects that can be sent via -// a client. -// -// Types like posthog.Capture, posthog.Alias, etc... implement this interface -// and therefore can be passed to the posthog.Client.Send method. -type Message interface { - - // Validate validates the internal structure of the message, the method must return - // nil if the message is valid, or an error describing what went wrong. - Validate() error - APIfy() APIMessage - - // internal is an unexposed interface function to ensure only types defined within this package can satisfy the Message interface. Invoking this method will panic. - internal() -} - -// Returns the time value passed as first argument, unless it's the zero-value, -// in that case the default value passed as second argument is returned. -func makeTimestamp(t time.Time, def time.Time) time.Time { - if t == (time.Time{}) { - return def - } - return t -} - -// This structure represents objects sent to the /batch/ endpoint. We don't -// export this type because it's only meant to be used internally to send groups -// of messages in one API call. -type batch struct { - ApiKey string `json:"api_key"` - Messages []message `json:"batch"` -} - -type APIMessage interface{} - -type message struct { - msg APIMessage - json []byte -} - -func makeMessage(m APIMessage, maxBytes int) (msg message, err error) { - if msg.json, err = json.Marshal(m); err == nil { - if len(msg.json) > maxBytes { - err = ErrMessageTooBig - } else { - msg.msg = m - } - } - return -} - -func (m message) MarshalJSON() ([]byte, error) { - return m.json, nil -} - -func (m message) size() int { - // The `+ 1` is for the comma that sits between each items of a JSON array. - return len(m.json) + 1 -} - -type messageQueue struct { - pending []message - bytes int - maxBatchSize int - maxBatchBytes int -} - -func (q *messageQueue) push(m message) (b []message) { - if (q.bytes + m.size()) > q.maxBatchBytes { - b = q.flush() - } - - if q.pending == nil { - q.pending = make([]message, 0, q.maxBatchSize) - } - - q.pending = append(q.pending, m) - q.bytes += len(m.json) - - if b == nil && len(q.pending) == q.maxBatchSize { - b = q.flush() - } - - return -} - -func (q *messageQueue) flush() (msgs []message) { - msgs, q.pending, q.bytes = q.pending, nil, 0 - return -} - -const ( - maxBatchBytes = 500000 - maxMessageBytes = 32000 -) diff --git a/vendor/github.com/posthog/posthog-go/posthog.go b/vendor/github.com/posthog/posthog-go/posthog.go deleted file mode 100644 index 4c2aa0d00..000000000 --- a/vendor/github.com/posthog/posthog-go/posthog.go +++ /dev/null @@ -1,546 +0,0 @@ -package posthog - -import ( - "bytes" - "encoding/json" - "errors" - "fmt" - "io" - "io/ioutil" - "net/http" - "sync" - "time" -) - -const unimplementedError = "not implemented" -const SIZE_DEFAULT = 50_000 - -// This interface is the main API exposed by the posthog package. -// Values that satsify this interface are returned by the client constructors -// provided by the package and provide a way to send messages via the HTTP API. -type Client interface { - io.Closer - - // Queues a message to be sent by the client when the conditions for a batch - // upload are met. - // This is the main method you'll be using, a typical flow would look like - // this: - // - // client := posthog.New(apiKey) - // ... - // client.Enqueue(posthog.Capture{ ... }) - // ... - // client.Close() - // - // The method returns an error if the message queue could not be queued, which - // happens if the client was already closed at the time the method was - // called or if the message was malformed. - Enqueue(Message) error - // - // Method returns if a feature flag is on for a given user based on their distinct ID - IsFeatureEnabled(FeatureFlagPayload) (interface{}, error) - // - // Method returns variant value if multivariantflag or otherwise a boolean indicating - // if the given flag is on or off for the user - GetFeatureFlag(FeatureFlagPayload) (interface{}, error) - // - // Method forces a reload of feature flags - ReloadFeatureFlags() error - // - // Get feature flags - for testing only - GetFeatureFlags() ([]FeatureFlag, error) - // - // Get all flags - returns all flags for a user - GetAllFlags(FeatureFlagPayloadNoKey) (map[string]interface{}, error) -} - -type client struct { - Config - key string - - // This channel is where the `Enqueue` method writes messages so they can be - // picked up and pushed by the backend goroutine taking care of applying the - // batching rules. - msgs chan APIMessage - - // These two channels are used to synchronize the client shutting down when - // `Close` is called. - // The first channel is closed to signal the backend goroutine that it has - // to stop, then the second one is closed by the backend goroutine to signal - // that it has finished flushing all queued messages. - quit chan struct{} - shutdown chan struct{} - - // This HTTP client is used to send requests to the backend, it uses the - // HTTP transport provided in the configuration. - http http.Client - - // A background poller for fetching feature flags - featureFlagsPoller *FeatureFlagsPoller - - distinctIdsFeatureFlagsReported *SizeLimitedMap -} - -// Instantiate a new client that uses the write key passed as first argument to -// send messages to the backend. -// The client is created with the default configuration. -func New(apiKey string) Client { - // Here we can ignore the error because the default config is always valid. - c, _ := NewWithConfig(apiKey, Config{}) - return c -} - -// Instantiate a new client that uses the write key and configuration passed as -// arguments to send messages to the backend. -// The function will return an error if the configuration contained impossible -// values (like a negative flush interval for example). -// When the function returns an error the returned client will always be nil. -func NewWithConfig(apiKey string, config Config) (cli Client, err error) { - if err = config.validate(); err != nil { - return - } - - c := &client{ - Config: makeConfig(config), - key: apiKey, - msgs: make(chan APIMessage, 100), - quit: make(chan struct{}), - shutdown: make(chan struct{}), - http: makeHttpClient(config.Transport), - distinctIdsFeatureFlagsReported: newSizeLimitedMap(SIZE_DEFAULT), - } - - if len(c.PersonalApiKey) > 0 { - c.featureFlagsPoller = newFeatureFlagsPoller(c.key, c.Config.PersonalApiKey, c.Errorf, c.Endpoint, c.http, c.DefaultFeatureFlagsPollingInterval) - } - - go c.loop() - - cli = c - return -} - -func makeHttpClient(transport http.RoundTripper) http.Client { - httpClient := http.Client{ - Transport: transport, - } - if supportsTimeout(transport) { - httpClient.Timeout = 10 * time.Second - } - return httpClient -} - -func dereferenceMessage(msg Message) Message { - switch m := msg.(type) { - case *Alias: - if m == nil { - return nil - } - return *m - case *Identify: - if m == nil { - return nil - } - return *m - case *GroupIdentify: - if m == nil { - return nil - } - return *m - case *Capture: - if m == nil { - return nil - } - return *m - } - - return msg -} - -func (c *client) Enqueue(msg Message) (err error) { - msg = dereferenceMessage(msg) - if err = msg.Validate(); err != nil { - return - } - - var ts = c.now() - - switch m := msg.(type) { - case Alias: - m.Type = "alias" - m.Timestamp = makeTimestamp(m.Timestamp, ts) - msg = m - - case Identify: - m.Type = "identify" - m.Timestamp = makeTimestamp(m.Timestamp, ts) - msg = m - - case GroupIdentify: - m.Timestamp = makeTimestamp(m.Timestamp, ts) - msg = m - - case Capture: - m.Type = "capture" - m.Timestamp = makeTimestamp(m.Timestamp, ts) - if m.SendFeatureFlags { - // Add all feature variants to event - featureVariants, err := c.getFeatureVariants(m.DistinctId, m.Groups, NewProperties(), map[string]Properties{}) - if err != nil { - c.Errorf("unable to get feature variants - %s", err) - } - for feature, variant := range featureVariants { - propKey := fmt.Sprintf("$feature/%s", feature) - m.Properties[propKey] = variant - } - // Add all feature flag keys to $active_feature_flags key - featureKeys := make([]string, len(featureVariants)) - i := 0 - for k := range featureVariants { - featureKeys[i] = k - i++ - } - m.Properties["$active_feature_flags"] = featureKeys - } - msg = m - - default: - err = fmt.Errorf("messages with custom types cannot be enqueued: %T", msg) - return - } - - defer func() { - // When the `msgs` channel is closed writing to it will trigger a panic. - // To avoid letting the panic propagate to the caller we recover from it - // and instead report that the client has been closed and shouldn't be - // used anymore. - if recover() != nil { - err = ErrClosed - } - }() - - c.msgs <- msg.APIfy() - - return -} - -func (c *client) IsFeatureEnabled(flagConfig FeatureFlagPayload) (interface{}, error) { - if err := flagConfig.validate(); err != nil { - return false, err - } - - if c.featureFlagsPoller == nil { - errorMessage := "specifying a PersonalApiKey is required for using feature flags" - c.Errorf(errorMessage) - return false, errors.New(errorMessage) - } - - result, err := c.GetFeatureFlag(flagConfig) - if err != nil { - return nil, err - } - - if result == "false" { - result = false - } else if result == "true" { - result = true - } - - return result, nil -} - -func (c *client) ReloadFeatureFlags() error { - if c.featureFlagsPoller == nil { - errorMessage := "specifying a PersonalApiKey is required for using feature flags" - c.Errorf(errorMessage) - return errors.New(errorMessage) - } - c.featureFlagsPoller.ForceReload() - return nil -} - -func (c *client) GetFeatureFlag(flagConfig FeatureFlagPayload) (interface{}, error) { - if err := flagConfig.validate(); err != nil { - return false, err - } - - if c.featureFlagsPoller == nil { - errorMessage := "specifying a PersonalApiKey is required for using feature flags" - c.Errorf(errorMessage) - return "false", errors.New(errorMessage) - } - flagValue, err := c.featureFlagsPoller.GetFeatureFlag(flagConfig) - if *flagConfig.SendFeatureFlagEvents && !c.distinctIdsFeatureFlagsReported.contains(flagConfig.DistinctId, flagConfig.Key) { - c.Enqueue(Capture{ - DistinctId: flagConfig.DistinctId, - Event: "$feature_flag_called", - Properties: NewProperties(). - Set("$feature_flag", flagConfig.Key). - Set("$feature_flag_response", flagValue). - Set("$feature_flag_errored", err != nil), - Groups: flagConfig.Groups, - }) - c.distinctIdsFeatureFlagsReported.add(flagConfig.DistinctId, flagConfig.Key) - } - return flagValue, err -} - -func (c *client) GetFeatureFlags() ([]FeatureFlag, error) { - if c.featureFlagsPoller == nil { - errorMessage := "specifying a PersonalApiKey is required for using feature flags" - c.Errorf(errorMessage) - return nil, errors.New(errorMessage) - } - return c.featureFlagsPoller.GetFeatureFlags(), nil -} - -func (c *client) GetAllFlags(flagConfig FeatureFlagPayloadNoKey) (map[string]interface{}, error) { - - if err := flagConfig.validate(); err != nil { - return nil, err - } - - if c.featureFlagsPoller == nil { - errorMessage := "specifying a PersonalApiKey is required for using feature flags" - c.Errorf(errorMessage) - return nil, errors.New(errorMessage) - } - return c.featureFlagsPoller.GetAllFlags(flagConfig) -} - -// Close and flush metrics. -func (c *client) Close() (err error) { - defer func() { - // Always recover, a panic could be raised if `c`.quit was closed which - // means the method was called more than once. - if recover() != nil { - err = ErrClosed - } - }() - close(c.quit) - <-c.shutdown - return -} - -// Asychronously send a batched requests. -func (c *client) sendAsync(msgs []message, wg *sync.WaitGroup, ex *executor) { - wg.Add(1) - - if !ex.do(func() { - defer wg.Done() - defer func() { - // In case a bug is introduced in the send function that triggers - // a panic, we don't want this to ever crash the application so we - // catch it here and log it instead. - if err := recover(); err != nil { - c.Errorf("panic - %s", err) - } - }() - c.send(msgs) - }) { - wg.Done() - c.Errorf("sending messages failed - %s", ErrTooManyRequests) - c.notifyFailure(msgs, ErrTooManyRequests) - } -} - -// Send batch request. -func (c *client) send(msgs []message) { - const attempts = 10 - - b, err := json.Marshal(batch{ - ApiKey: c.key, - Messages: msgs, - }) - - if err != nil { - c.Errorf("marshalling messages - %s", err) - c.notifyFailure(msgs, err) - return - } - - for i := 0; i != attempts; i++ { - if err = c.upload(b); err == nil { - c.notifySuccess(msgs) - return - } - - // Wait for either a retry timeout or the client to be closed. - select { - case <-time.After(c.RetryAfter(i)): - case <-c.quit: - c.Errorf("%d messages dropped because they failed to be sent and the client was closed", len(msgs)) - c.notifyFailure(msgs, err) - return - } - } - - c.Errorf("%d messages dropped because they failed to be sent after %d attempts", len(msgs), attempts) - c.notifyFailure(msgs, err) -} - -// Upload serialized batch message. -func (c *client) upload(b []byte) error { - url := c.Endpoint + "/batch/" - req, err := http.NewRequest("POST", url, bytes.NewReader(b)) - if err != nil { - c.Errorf("creating request - %s", err) - return err - } - - version := getVersion() - - req.Header.Add("User-Agent", "posthog-go (version: "+version+")") - req.Header.Add("Content-Type", "application/json") - req.Header.Add("Content-Length", fmt.Sprintf("%d", len(b))) - - res, err := c.http.Do(req) - - if err != nil { - c.Errorf("sending request - %s", err) - return err - } - - defer res.Body.Close() - return c.report(res) -} - -// Report on response body. -func (c *client) report(res *http.Response) (err error) { - var body []byte - - if res.StatusCode < 300 { - c.debugf("response %s", res.Status) - return - } - - if body, err = ioutil.ReadAll(res.Body); err != nil { - c.Errorf("response %d %s - %s", res.StatusCode, res.Status, err) - return - } - - c.logf("response %d %s – %s", res.StatusCode, res.Status, string(body)) - return fmt.Errorf("%d %s", res.StatusCode, res.Status) -} - -// Batch loop. -func (c *client) loop() { - defer close(c.shutdown) - if c.featureFlagsPoller != nil { - defer c.featureFlagsPoller.shutdownPoller() - } - - wg := &sync.WaitGroup{} - defer wg.Wait() - - tick := time.NewTicker(c.Interval) - defer tick.Stop() - - ex := newExecutor(c.maxConcurrentRequests) - defer ex.close() - - mq := messageQueue{ - maxBatchSize: c.BatchSize, - maxBatchBytes: c.maxBatchBytes(), - } - - for { - select { - case msg := <-c.msgs: - c.push(&mq, msg, wg, ex) - - case <-tick.C: - c.flush(&mq, wg, ex) - - case <-c.quit: - c.debugf("exit requested – draining messages") - - // Drain the msg channel, we have to close it first so no more - // messages can be pushed and otherwise the loop would never end. - close(c.msgs) - for msg := range c.msgs { - c.push(&mq, msg, wg, ex) - } - - c.flush(&mq, wg, ex) - c.debugf("exit") - return - } - } -} - -func (c *client) push(q *messageQueue, m APIMessage, wg *sync.WaitGroup, ex *executor) { - var msg message - var err error - - if msg, err = makeMessage(m, maxMessageBytes); err != nil { - c.Errorf("%s - %v", err, m) - c.notifyFailure([]message{{m, nil}}, err) - return - } - - c.debugf("buffer (%d/%d) %v", len(q.pending), c.BatchSize, m) - - if msgs := q.push(msg); msgs != nil { - c.debugf("exceeded messages batch limit with batch of %d messages – flushing", len(msgs)) - c.sendAsync(msgs, wg, ex) - } -} - -func (c *client) flush(q *messageQueue, wg *sync.WaitGroup, ex *executor) { - if msgs := q.flush(); msgs != nil { - c.debugf("flushing %d messages", len(msgs)) - c.sendAsync(msgs, wg, ex) - } -} - -func (c *client) debugf(format string, args ...interface{}) { - if c.Verbose { - c.logf(format, args...) - } -} - -func (c *client) logf(format string, args ...interface{}) { - c.Logger.Logf(format, args...) -} - -func (c *client) Errorf(format string, args ...interface{}) { - c.Logger.Errorf(format, args...) -} - -func (c *client) maxBatchBytes() int { - b, _ := json.Marshal(batch{ - Messages: []message{}, - }) - return maxBatchBytes - len(b) -} - -func (c *client) notifySuccess(msgs []message) { - if c.Callback != nil { - for _, m := range msgs { - c.Callback.Success(m.msg) - } - } -} - -func (c *client) notifyFailure(msgs []message, err error) { - if c.Callback != nil { - for _, m := range msgs { - c.Callback.Failure(m.msg, err) - } - } -} - -func (c *client) getFeatureVariants(distinctId string, groups Groups, personProperties Properties, groupProperties map[string]Properties) (map[string]interface{}, error) { - if c.featureFlagsPoller == nil { - errorMessage := "specifying a PersonalApiKey is required for using feature flags" - c.Errorf(errorMessage) - return nil, errors.New(errorMessage) - } - - featureVariants, err := c.featureFlagsPoller.getFeatureFlagVariants(distinctId, groups, personProperties, groupProperties) - if err != nil { - return nil, err - } - return featureVariants, nil -} diff --git a/vendor/github.com/posthog/posthog-go/properties.go b/vendor/github.com/posthog/posthog-go/properties.go deleted file mode 100644 index 46205131a..000000000 --- a/vendor/github.com/posthog/posthog-go/properties.go +++ /dev/null @@ -1,25 +0,0 @@ -package posthog - -// This type is used to represent properties in messages that support it. -// It is a free-form object so the application can set any value it sees fit but -// a few helper method are defined to make it easier to instantiate properties with -// common fields. -// Here's a quick example of how this type is meant to be used: -// -// posthog.Page{ -// DistinctId: "0123456789", -// Properties: posthog.NewProperties() -// .Set("revenue", 10.0) -// .Set("currency", "USD"), -// } -// -type Properties map[string]interface{} - -func NewProperties() Properties { - return make(Properties, 10) -} - -func (p Properties) Set(name string, value interface{}) Properties { - p[name] = value - return p -} diff --git a/vendor/github.com/posthog/posthog-go/timeout_15.go b/vendor/github.com/posthog/posthog-go/timeout_15.go deleted file mode 100644 index 17d882b87..000000000 --- a/vendor/github.com/posthog/posthog-go/timeout_15.go +++ /dev/null @@ -1,16 +0,0 @@ -// +build !go1.6 - -package posthog - -import "net/http" - -// http clients on versions of go before 1.6 only support timeout if the -// transport implements the `CancelRequest` method. -func supportsTimeout(transport http.RoundTripper) bool { - _, ok := transport.(requestCanceler) - return ok -} - -type requestCanceler interface { - CancelRequest(*http.Request) -} diff --git a/vendor/github.com/posthog/posthog-go/timeout_16.go b/vendor/github.com/posthog/posthog-go/timeout_16.go deleted file mode 100644 index b5bf68aa8..000000000 --- a/vendor/github.com/posthog/posthog-go/timeout_16.go +++ /dev/null @@ -1,10 +0,0 @@ -// +build go1.6 - -package posthog - -import "net/http" - -// http clients on versions of go after 1.6 always support timeout. -func supportsTimeout(transport http.RoundTripper) bool { - return true -} diff --git a/vendor/github.com/posthog/posthog-go/util.go b/vendor/github.com/posthog/posthog-go/util.go deleted file mode 100644 index a6264c6a3..000000000 --- a/vendor/github.com/posthog/posthog-go/util.go +++ /dev/null @@ -1,44 +0,0 @@ -package posthog - -type SizeLimitedMap struct { - ids map[string][]string - size int -} - -func newSizeLimitedMap(size int) *SizeLimitedMap { - newMap := SizeLimitedMap{ - ids: map[string][]string{}, - size: size, - } - - return &newMap -} - -func (sizeLimitedMap *SizeLimitedMap) add(key string, element string) { - - if len(sizeLimitedMap.ids) >= sizeLimitedMap.size { - sizeLimitedMap.ids = map[string][]string{} - } - - if val, ok := sizeLimitedMap.ids[key]; ok { - sizeLimitedMap.ids[key] = append(val, element) - } else { - sizeLimitedMap.ids[key] = []string{element} - } -} - -func (sizeLimitedMap *SizeLimitedMap) contains(key string, element string) bool { - if val, ok := sizeLimitedMap.ids[key]; ok { - for _, v := range val { - if v == element { - return true - } - } - } - - return false -} - -func (sizeLimitedMap *SizeLimitedMap) count() int { - return len(sizeLimitedMap.ids) -} diff --git a/vendor/github.com/posthog/posthog-go/version.go b/vendor/github.com/posthog/posthog-go/version.go deleted file mode 100644 index 9ab111d2b..000000000 --- a/vendor/github.com/posthog/posthog-go/version.go +++ /dev/null @@ -1,14 +0,0 @@ -package posthog - -import "flag" - -// Version of the client. -const Version = "2.0.0" - -// make tests easier by using a constant version -func getVersion() string { - if flag.Lookup("test.v") != nil { - return "1.0.0" - } - return Version -} diff --git a/vendor/github.com/streamdal/streamdal/libs/protos/build/go/protos/sp_command.pb.go b/vendor/github.com/streamdal/streamdal/libs/protos/build/go/protos/sp_command.pb.go index 2e50c430d..7d8d129ee 100644 --- a/vendor/github.com/streamdal/streamdal/libs/protos/build/go/protos/sp_command.pb.go +++ b/vendor/github.com/streamdal/streamdal/libs/protos/build/go/protos/sp_command.pb.go @@ -36,6 +36,7 @@ type Command struct { // *Command_KeepAlive // *Command_Kv // *Command_Tail + // *Command_DeleteAudiences Command isCommand_Command `protobuf_oneof:"command"` } @@ -113,6 +114,13 @@ func (x *Command) GetTail() *TailCommand { return nil } +func (x *Command) GetDeleteAudiences() *DeleteAudiencesCommand { + if x, ok := x.GetCommand().(*Command_DeleteAudiences); ok { + return x.DeleteAudiences + } + return nil +} + type isCommand_Command interface { isCommand_Command() } @@ -137,10 +145,17 @@ type Command_Kv struct { type Command_Tail struct { // Emitted by server when a user makes a Tail() call - // Consumed by all server instances and by SDKs + // Consumed by all server instances and by SDK Tail *TailCommand `protobuf:"bytes,103,opt,name=tail,proto3,oneof"` } +type Command_DeleteAudiences struct { + // Emitted by the server when a user deletes an audience or service + // Consumed by SDK to delete audience from it's internal cache so + // that the heartbeat does not send the audience back to the server + DeleteAudiences *DeleteAudiencesCommand `protobuf:"bytes,104,opt,name=delete_audiences,json=deleteAudiences,proto3,oneof"` +} + func (*Command_SetPipelines) isCommand_Command() {} func (*Command_KeepAlive) isCommand_Command() {} @@ -149,6 +164,8 @@ func (*Command_Kv) isCommand_Command() {} func (*Command_Tail) isCommand_Command() {} +func (*Command_DeleteAudiences) isCommand_Command() {} + type SetPipelinesCommand struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -348,6 +365,53 @@ func (x *TailCommand) GetRequest() *TailRequest { return nil } +type DeleteAudiencesCommand struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Audiences []*Audience `protobuf:"bytes,1,rep,name=audiences,proto3" json:"audiences,omitempty"` +} + +func (x *DeleteAudiencesCommand) Reset() { + *x = DeleteAudiencesCommand{} + if protoimpl.UnsafeEnabled { + mi := &file_sp_command_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DeleteAudiencesCommand) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeleteAudiencesCommand) ProtoMessage() {} + +func (x *DeleteAudiencesCommand) ProtoReflect() protoreflect.Message { + mi := &file_sp_command_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DeleteAudiencesCommand.ProtoReflect.Descriptor instead. +func (*DeleteAudiencesCommand) Descriptor() ([]byte, []int) { + return file_sp_command_proto_rawDescGZIP(), []int{5} +} + +func (x *DeleteAudiencesCommand) GetAudiences() []*Audience { + if x != nil { + return x.Audiences + } + return nil +} + var File_sp_command_proto protoreflect.FileDescriptor var file_sp_command_proto_rawDesc = []byte{ @@ -357,7 +421,7 @@ var file_sp_command_proto_rawDesc = []byte{ 0x74, 0x6f, 0x1a, 0x0f, 0x73, 0x70, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x0b, 0x73, 0x70, 0x5f, 0x6b, 0x76, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x11, 0x73, 0x70, 0x5f, 0x70, 0x69, 0x70, 0x65, 0x6c, 0x69, 0x6e, 0x65, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x22, 0x91, 0x02, 0x0a, 0x07, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x12, + 0x6f, 0x74, 0x6f, 0x22, 0xde, 0x02, 0x0a, 0x07, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x12, 0x2c, 0x0a, 0x08, 0x61, 0x75, 0x64, 0x69, 0x65, 0x6e, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, 0x41, 0x75, 0x64, 0x69, 0x65, 0x6e, 0x63, 0x65, 0x52, 0x08, 0x61, 0x75, 0x64, 0x69, 0x65, 0x6e, 0x63, 0x65, 0x12, 0x42, 0x0a, @@ -373,40 +437,50 @@ var file_sp_command_proto_rawDesc = []byte{ 0x73, 0x2e, 0x4b, 0x56, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x48, 0x00, 0x52, 0x02, 0x6b, 0x76, 0x12, 0x29, 0x0a, 0x04, 0x74, 0x61, 0x69, 0x6c, 0x18, 0x67, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, 0x54, 0x61, 0x69, 0x6c, 0x43, 0x6f, 0x6d, - 0x6d, 0x61, 0x6e, 0x64, 0x48, 0x00, 0x52, 0x04, 0x74, 0x61, 0x69, 0x6c, 0x42, 0x09, 0x0a, 0x07, - 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x22, 0xf1, 0x01, 0x0a, 0x13, 0x53, 0x65, 0x74, 0x50, - 0x69, 0x70, 0x65, 0x6c, 0x69, 0x6e, 0x65, 0x73, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x12, - 0x2e, 0x0a, 0x09, 0x70, 0x69, 0x70, 0x65, 0x6c, 0x69, 0x6e, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, - 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, 0x50, 0x69, 0x70, 0x65, - 0x6c, 0x69, 0x6e, 0x65, 0x52, 0x09, 0x70, 0x69, 0x70, 0x65, 0x6c, 0x69, 0x6e, 0x65, 0x73, 0x12, - 0x4f, 0x0a, 0x0c, 0x77, 0x61, 0x73, 0x6d, 0x5f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x18, - 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, 0x53, - 0x65, 0x74, 0x50, 0x69, 0x70, 0x65, 0x6c, 0x69, 0x6e, 0x65, 0x73, 0x43, 0x6f, 0x6d, 0x6d, 0x61, - 0x6e, 0x64, 0x2e, 0x57, 0x61, 0x73, 0x6d, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x45, 0x6e, - 0x74, 0x72, 0x79, 0x52, 0x0b, 0x77, 0x61, 0x73, 0x6d, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, - 0x1a, 0x59, 0x0a, 0x10, 0x57, 0x61, 0x73, 0x6d, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x45, - 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x2f, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, 0x73, - 0x68, 0x61, 0x72, 0x65, 0x64, 0x2e, 0x57, 0x61, 0x73, 0x6d, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, - 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x12, 0x0a, 0x10, 0x4b, - 0x65, 0x65, 0x70, 0x41, 0x6c, 0x69, 0x76, 0x65, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x22, - 0x64, 0x0a, 0x09, 0x4b, 0x56, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x12, 0x39, 0x0a, 0x0c, - 0x69, 0x6e, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x03, - 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, 0x4b, 0x56, 0x49, 0x6e, - 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0c, 0x69, 0x6e, 0x73, 0x74, 0x72, - 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x1c, 0x0a, 0x09, 0x6f, 0x76, 0x65, 0x72, 0x77, - 0x72, 0x69, 0x74, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x6f, 0x76, 0x65, 0x72, - 0x77, 0x72, 0x69, 0x74, 0x65, 0x22, 0x3c, 0x0a, 0x0b, 0x54, 0x61, 0x69, 0x6c, 0x43, 0x6f, 0x6d, - 0x6d, 0x61, 0x6e, 0x64, 0x12, 0x2d, 0x0a, 0x07, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, 0x54, - 0x61, 0x69, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, 0x07, 0x72, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x42, 0x50, 0x5a, 0x3a, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, - 0x6d, 0x2f, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x64, 0x61, 0x6c, 0x2f, 0x73, 0x74, 0x72, 0x65, - 0x61, 0x6d, 0x64, 0x61, 0x6c, 0x2f, 0x6c, 0x69, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x73, 0x2f, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x2f, 0x67, 0x6f, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x73, 0xea, 0x02, 0x11, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x64, 0x61, 0x6c, 0x3a, 0x3a, 0x50, - 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x6d, 0x61, 0x6e, 0x64, 0x48, 0x00, 0x52, 0x04, 0x74, 0x61, 0x69, 0x6c, 0x12, 0x4b, 0x0a, 0x10, + 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x5f, 0x61, 0x75, 0x64, 0x69, 0x65, 0x6e, 0x63, 0x65, 0x73, + 0x18, 0x68, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, + 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x41, 0x75, 0x64, 0x69, 0x65, 0x6e, 0x63, 0x65, 0x73, 0x43, + 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x48, 0x00, 0x52, 0x0f, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, + 0x41, 0x75, 0x64, 0x69, 0x65, 0x6e, 0x63, 0x65, 0x73, 0x42, 0x09, 0x0a, 0x07, 0x63, 0x6f, 0x6d, + 0x6d, 0x61, 0x6e, 0x64, 0x22, 0xf1, 0x01, 0x0a, 0x13, 0x53, 0x65, 0x74, 0x50, 0x69, 0x70, 0x65, + 0x6c, 0x69, 0x6e, 0x65, 0x73, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x12, 0x2e, 0x0a, 0x09, + 0x70, 0x69, 0x70, 0x65, 0x6c, 0x69, 0x6e, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x10, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, 0x50, 0x69, 0x70, 0x65, 0x6c, 0x69, 0x6e, + 0x65, 0x52, 0x09, 0x70, 0x69, 0x70, 0x65, 0x6c, 0x69, 0x6e, 0x65, 0x73, 0x12, 0x4f, 0x0a, 0x0c, + 0x77, 0x61, 0x73, 0x6d, 0x5f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, 0x53, 0x65, 0x74, 0x50, + 0x69, 0x70, 0x65, 0x6c, 0x69, 0x6e, 0x65, 0x73, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x2e, + 0x57, 0x61, 0x73, 0x6d, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, + 0x52, 0x0b, 0x77, 0x61, 0x73, 0x6d, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x1a, 0x59, 0x0a, + 0x10, 0x57, 0x61, 0x73, 0x6d, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, + 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, + 0x6b, 0x65, 0x79, 0x12, 0x2f, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, 0x73, 0x68, 0x61, 0x72, + 0x65, 0x64, 0x2e, 0x57, 0x61, 0x73, 0x6d, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x52, 0x05, 0x76, + 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x12, 0x0a, 0x10, 0x4b, 0x65, 0x65, 0x70, + 0x41, 0x6c, 0x69, 0x76, 0x65, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x22, 0x64, 0x0a, 0x09, + 0x4b, 0x56, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x12, 0x39, 0x0a, 0x0c, 0x69, 0x6e, 0x73, + 0x74, 0x72, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x15, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, 0x4b, 0x56, 0x49, 0x6e, 0x73, 0x74, 0x72, + 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0c, 0x69, 0x6e, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, + 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x1c, 0x0a, 0x09, 0x6f, 0x76, 0x65, 0x72, 0x77, 0x72, 0x69, 0x74, + 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x6f, 0x76, 0x65, 0x72, 0x77, 0x72, 0x69, + 0x74, 0x65, 0x22, 0x3c, 0x0a, 0x0b, 0x54, 0x61, 0x69, 0x6c, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, + 0x64, 0x12, 0x2d, 0x0a, 0x07, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, 0x54, 0x61, 0x69, 0x6c, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, 0x07, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x22, 0x48, 0x0a, 0x16, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x41, 0x75, 0x64, 0x69, 0x65, 0x6e, + 0x63, 0x65, 0x73, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x12, 0x2e, 0x0a, 0x09, 0x61, 0x75, + 0x64, 0x69, 0x65, 0x6e, 0x63, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x10, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, 0x41, 0x75, 0x64, 0x69, 0x65, 0x6e, 0x63, 0x65, 0x52, + 0x09, 0x61, 0x75, 0x64, 0x69, 0x65, 0x6e, 0x63, 0x65, 0x73, 0x42, 0x50, 0x5a, 0x3a, 0x67, 0x69, + 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x64, + 0x61, 0x6c, 0x2f, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x64, 0x61, 0x6c, 0x2f, 0x6c, 0x69, 0x62, + 0x73, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2f, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x2f, 0x67, + 0x6f, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0xea, 0x02, 0x11, 0x53, 0x74, 0x72, 0x65, 0x61, + 0x6d, 0x64, 0x61, 0x6c, 0x3a, 0x3a, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x62, 0x06, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -421,36 +495,39 @@ func file_sp_command_proto_rawDescGZIP() []byte { return file_sp_command_proto_rawDescData } -var file_sp_command_proto_msgTypes = make([]protoimpl.MessageInfo, 6) +var file_sp_command_proto_msgTypes = make([]protoimpl.MessageInfo, 7) var file_sp_command_proto_goTypes = []interface{}{ - (*Command)(nil), // 0: protos.Command - (*SetPipelinesCommand)(nil), // 1: protos.SetPipelinesCommand - (*KeepAliveCommand)(nil), // 2: protos.KeepAliveCommand - (*KVCommand)(nil), // 3: protos.KVCommand - (*TailCommand)(nil), // 4: protos.TailCommand - nil, // 5: protos.SetPipelinesCommand.WasmModulesEntry - (*Audience)(nil), // 6: protos.Audience - (*Pipeline)(nil), // 7: protos.Pipeline - (*KVInstruction)(nil), // 8: protos.KVInstruction - (*TailRequest)(nil), // 9: protos.TailRequest - (*shared.WasmModule)(nil), // 10: protos.shared.WasmModule + (*Command)(nil), // 0: protos.Command + (*SetPipelinesCommand)(nil), // 1: protos.SetPipelinesCommand + (*KeepAliveCommand)(nil), // 2: protos.KeepAliveCommand + (*KVCommand)(nil), // 3: protos.KVCommand + (*TailCommand)(nil), // 4: protos.TailCommand + (*DeleteAudiencesCommand)(nil), // 5: protos.DeleteAudiencesCommand + nil, // 6: protos.SetPipelinesCommand.WasmModulesEntry + (*Audience)(nil), // 7: protos.Audience + (*Pipeline)(nil), // 8: protos.Pipeline + (*KVInstruction)(nil), // 9: protos.KVInstruction + (*TailRequest)(nil), // 10: protos.TailRequest + (*shared.WasmModule)(nil), // 11: protos.shared.WasmModule } var file_sp_command_proto_depIdxs = []int32{ - 6, // 0: protos.Command.audience:type_name -> protos.Audience + 7, // 0: protos.Command.audience:type_name -> protos.Audience 1, // 1: protos.Command.set_pipelines:type_name -> protos.SetPipelinesCommand 2, // 2: protos.Command.keep_alive:type_name -> protos.KeepAliveCommand 3, // 3: protos.Command.kv:type_name -> protos.KVCommand 4, // 4: protos.Command.tail:type_name -> protos.TailCommand - 7, // 5: protos.SetPipelinesCommand.pipelines:type_name -> protos.Pipeline - 5, // 6: protos.SetPipelinesCommand.wasm_modules:type_name -> protos.SetPipelinesCommand.WasmModulesEntry - 8, // 7: protos.KVCommand.instructions:type_name -> protos.KVInstruction - 9, // 8: protos.TailCommand.request:type_name -> protos.TailRequest - 10, // 9: protos.SetPipelinesCommand.WasmModulesEntry.value:type_name -> protos.shared.WasmModule - 10, // [10:10] is the sub-list for method output_type - 10, // [10:10] is the sub-list for method input_type - 10, // [10:10] is the sub-list for extension type_name - 10, // [10:10] is the sub-list for extension extendee - 0, // [0:10] is the sub-list for field type_name + 5, // 5: protos.Command.delete_audiences:type_name -> protos.DeleteAudiencesCommand + 8, // 6: protos.SetPipelinesCommand.pipelines:type_name -> protos.Pipeline + 6, // 7: protos.SetPipelinesCommand.wasm_modules:type_name -> protos.SetPipelinesCommand.WasmModulesEntry + 9, // 8: protos.KVCommand.instructions:type_name -> protos.KVInstruction + 10, // 9: protos.TailCommand.request:type_name -> protos.TailRequest + 7, // 10: protos.DeleteAudiencesCommand.audiences:type_name -> protos.Audience + 11, // 11: protos.SetPipelinesCommand.WasmModulesEntry.value:type_name -> protos.shared.WasmModule + 12, // [12:12] is the sub-list for method output_type + 12, // [12:12] is the sub-list for method input_type + 12, // [12:12] is the sub-list for extension type_name + 12, // [12:12] is the sub-list for extension extendee + 0, // [0:12] is the sub-list for field type_name } func init() { file_sp_command_proto_init() } @@ -522,12 +599,25 @@ func file_sp_command_proto_init() { return nil } } + file_sp_command_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DeleteAudiencesCommand); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } } file_sp_command_proto_msgTypes[0].OneofWrappers = []interface{}{ (*Command_SetPipelines)(nil), (*Command_KeepAlive)(nil), (*Command_Kv)(nil), (*Command_Tail)(nil), + (*Command_DeleteAudiences)(nil), } type x struct{} out := protoimpl.TypeBuilder{ @@ -535,7 +625,7 @@ func file_sp_command_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_sp_command_proto_rawDesc, NumEnums: 0, - NumMessages: 6, + NumMessages: 7, NumExtensions: 0, NumServices: 0, }, diff --git a/vendor/github.com/streamdal/streamdal/sdks/go/.gitignore b/vendor/github.com/streamdal/streamdal/sdks/go/.gitignore index 1b8511ef8..44486f21e 100644 --- a/vendor/github.com/streamdal/streamdal/sdks/go/.gitignore +++ b/vendor/github.com/streamdal/streamdal/sdks/go/.gitignore @@ -1,7 +1,6 @@ .idea src/*.wasm src/version.txt -c.out test-assets/wasm/*.wasm test-assets/wasm/version.txt vendor diff --git a/vendor/github.com/streamdal/streamdal/sdks/go/Makefile b/vendor/github.com/streamdal/streamdal/sdks/go/Makefile index 02b058b80..153037bf4 100644 --- a/vendor/github.com/streamdal/streamdal/sdks/go/Makefile +++ b/vendor/github.com/streamdal/streamdal/sdks/go/Makefile @@ -32,7 +32,7 @@ test/fakes: test/coverage: description = Run all tests test/coverage: bash ./init_wasm.sh - go test -coverprofile=c.out `go list ./... | grep -v fake` + go test -coverprofile=coverage.out `go list ./... | grep -v fake` .PHONY: test/benchmark test/benchmark: description = Run all benchmarks diff --git a/vendor/github.com/streamdal/streamdal/sdks/go/README.md b/vendor/github.com/streamdal/streamdal/sdks/go/README.md index 095068c28..32405e4ea 100644 --- a/vendor/github.com/streamdal/streamdal/sdks/go/README.md +++ b/vendor/github.com/streamdal/streamdal/sdks/go/README.md @@ -3,11 +3,8 @@ Streamdal Go SDK [![Release](https://github.com/streamdal/streamdal/actions/workflows/sdks-go-release.yml/badge.svg)](https://github.com/streamdal/streamdal/actions/workflows/sdks-go-release.yml) [![Pull Request](https://github.com/streamdal/streamdal/actions/workflows/sdks-go-pr.yml/badge.svg)](https://github.com/streamdal/streamdal/blob/main/.github/workflows/sdks-go-pr.yml) [![Discord](https://img.shields.io/badge/Community-Discord-4c57e8.svg)](https://discord.gg/streamdal) - - - - - +[![Go Report Card](https://goreportcard.com/badge/github.com/streamdal/streamdal/sdks/go)](https://goreportcard.com/report/github.com/streamdal/streamdal/sdks/go) +[![codecov](https://codecov.io/github/streamdal/streamdal/graph/badge.svg?token=yYbG9PCM2k&flag=go-sdk)](https://app.codecov.io/github/streamdal/streamdal?flags[0]=go-sdk) _**Golang SDK for [Streamdal](https://streamdal.com).**_ diff --git a/vendor/github.com/streamdal/streamdal/sdks/go/audience.go b/vendor/github.com/streamdal/streamdal/sdks/go/audience.go index 5a37df089..ee13ebb63 100644 --- a/vendor/github.com/streamdal/streamdal/sdks/go/audience.go +++ b/vendor/github.com/streamdal/streamdal/sdks/go/audience.go @@ -40,6 +40,13 @@ func (s *Streamdal) addAudience(ctx context.Context, aud *protos.Audience) { }() } +func (s *Streamdal) deleteAudience(_ context.Context, aud *protos.Audience) { + s.audiencesMtx.Lock() + defer s.audiencesMtx.Unlock() + + delete(s.audiences, audToStr(aud)) +} + // addAudiences is used for RE-adding audiences that may have timed out after // a server reconnect. The method will re-add all known audiences to the server // via internal gRPC NewAudience() endpoint. This is a non-blocking method. diff --git a/vendor/github.com/streamdal/streamdal/sdks/go/codecov.yml b/vendor/github.com/streamdal/streamdal/sdks/go/codecov.yml new file mode 100644 index 000000000..8cb215942 --- /dev/null +++ b/vendor/github.com/streamdal/streamdal/sdks/go/codecov.yml @@ -0,0 +1,2 @@ +fixes: + - "github.com/streamdal/streamdal/sdks/go/::" \ No newline at end of file diff --git a/vendor/github.com/streamdal/streamdal/sdks/go/coverage.out b/vendor/github.com/streamdal/streamdal/sdks/go/coverage.out new file mode 100644 index 000000000..b62518f13 --- /dev/null +++ b/vendor/github.com/streamdal/streamdal/sdks/go/coverage.out @@ -0,0 +1,692 @@ +mode: set +github.com/streamdal/streamdal/sdks/go/kv/kv.go:53.36,54.44 1 1 +github.com/streamdal/streamdal/sdks/go/kv/kv.go:54.44,56.3 1 0 +github.com/streamdal/streamdal/sdks/go/kv/kv.go:58.2,63.8 1 1 +github.com/streamdal/streamdal/sdks/go/kv/kv.go:66.45,70.31 3 1 +github.com/streamdal/streamdal/sdks/go/kv/kv.go:70.31,72.3 1 1 +github.com/streamdal/streamdal/sdks/go/kv/kv.go:74.2,74.18 1 1 +github.com/streamdal/streamdal/sdks/go/kv/kv.go:77.49,81.29 3 1 +github.com/streamdal/streamdal/sdks/go/kv/kv.go:81.29,84.3 2 1 +github.com/streamdal/streamdal/sdks/go/kv/kv.go:86.2,87.14 2 1 +github.com/streamdal/streamdal/sdks/go/kv/kv.go:90.38,96.29 4 1 +github.com/streamdal/streamdal/sdks/go/kv/kv.go:96.29,98.3 1 1 +github.com/streamdal/streamdal/sdks/go/kv/kv.go:100.2,102.15 2 1 +github.com/streamdal/streamdal/sdks/go/kv/kv.go:105.38,109.29 3 1 +github.com/streamdal/streamdal/sdks/go/kv/kv.go:109.29,111.3 1 1 +github.com/streamdal/streamdal/sdks/go/kv/kv.go:113.2,113.14 1 1 +github.com/streamdal/streamdal/sdks/go/kv/kv.go:116.28,124.2 5 1 +github.com/streamdal/streamdal/sdks/go/kv/kv.go:126.30,134.25 5 1 +github.com/streamdal/streamdal/sdks/go/kv/kv.go:134.25,137.3 2 1 +github.com/streamdal/streamdal/sdks/go/kv/kv.go:139.2,139.13 1 1 +github.com/streamdal/streamdal/sdks/go/kv/kv.go:142.28,147.2 3 1 +github.com/streamdal/streamdal/sdks/go/kv/kv.go:149.40,150.16 1 1 +github.com/streamdal/streamdal/sdks/go/kv/kv.go:150.16,152.3 1 1 +github.com/streamdal/streamdal/sdks/go/kv/kv.go:154.2,154.23 1 1 +github.com/streamdal/streamdal/sdks/go/kv/kv.go:154.23,156.3 1 1 +github.com/streamdal/streamdal/sdks/go/kv/kv.go:158.2,158.12 1 1 +github.com/streamdal/streamdal/sdks/go/validate/validate.go:14.40,16.2 1 1 +github.com/streamdal/streamdal/sdks/go/validate/validate.go:18.38,20.2 1 1 +github.com/streamdal/streamdal/sdks/go/validate/validate.go:22.39,24.2 1 1 +github.com/streamdal/streamdal/sdks/go/validate/validate.go:26.43,27.16 1 1 +github.com/streamdal/streamdal/sdks/go/validate/validate.go:27.16,29.3 1 1 +github.com/streamdal/streamdal/sdks/go/validate/validate.go:31.2,31.27 1 1 +github.com/streamdal/streamdal/sdks/go/validate/validate.go:31.27,33.3 1 1 +github.com/streamdal/streamdal/sdks/go/validate/validate.go:35.2,35.29 1 1 +github.com/streamdal/streamdal/sdks/go/validate/validate.go:35.29,37.3 1 1 +github.com/streamdal/streamdal/sdks/go/validate/validate.go:39.2,39.29 1 1 +github.com/streamdal/streamdal/sdks/go/validate/validate.go:39.29,41.3 1 1 +github.com/streamdal/streamdal/sdks/go/validate/validate.go:43.2,43.68 1 1 +github.com/streamdal/streamdal/sdks/go/validate/validate.go:43.68,45.3 1 1 +github.com/streamdal/streamdal/sdks/go/validate/validate.go:47.2,47.12 1 1 +github.com/streamdal/streamdal/sdks/go/validate/validate.go:50.53,51.16 1 0 +github.com/streamdal/streamdal/sdks/go/validate/validate.go:51.16,53.3 1 0 +github.com/streamdal/streamdal/sdks/go/validate/validate.go:55.2,55.34 1 0 +github.com/streamdal/streamdal/sdks/go/validate/validate.go:55.34,57.3 1 0 +github.com/streamdal/streamdal/sdks/go/validate/validate.go:59.2,59.12 1 0 +github.com/streamdal/streamdal/sdks/go/validate/validate.go:62.51,63.14 1 1 +github.com/streamdal/streamdal/sdks/go/validate/validate.go:63.14,65.3 1 1 +github.com/streamdal/streamdal/sdks/go/validate/validate.go:67.2,67.49 1 1 +github.com/streamdal/streamdal/sdks/go/validate/validate.go:67.49,69.3 1 1 +github.com/streamdal/streamdal/sdks/go/validate/validate.go:71.2,71.73 1 1 +github.com/streamdal/streamdal/sdks/go/validate/validate.go:71.73,73.3 1 1 +github.com/streamdal/streamdal/sdks/go/validate/validate.go:75.2,75.12 1 1 +github.com/streamdal/streamdal/sdks/go/validate/validate.go:78.57,79.16 1 1 +github.com/streamdal/streamdal/sdks/go/validate/validate.go:79.16,81.3 1 1 +github.com/streamdal/streamdal/sdks/go/validate/validate.go:83.2,84.17 2 1 +github.com/streamdal/streamdal/sdks/go/validate/validate.go:84.17,86.3 1 1 +github.com/streamdal/streamdal/sdks/go/validate/validate.go:88.2,89.16 2 1 +github.com/streamdal/streamdal/sdks/go/validate/validate.go:89.16,91.3 1 1 +github.com/streamdal/streamdal/sdks/go/validate/validate.go:93.2,93.18 1 1 +github.com/streamdal/streamdal/sdks/go/validate/validate.go:93.18,95.3 1 1 +github.com/streamdal/streamdal/sdks/go/validate/validate.go:97.2,97.47 1 1 +github.com/streamdal/streamdal/sdks/go/validate/validate.go:97.47,99.3 1 0 +github.com/streamdal/streamdal/sdks/go/validate/validate.go:101.2,101.12 1 1 +github.com/streamdal/streamdal/sdks/go/validate/validate.go:104.56,105.16 1 1 +github.com/streamdal/streamdal/sdks/go/validate/validate.go:105.16,107.3 1 1 +github.com/streamdal/streamdal/sdks/go/validate/validate.go:109.2,110.17 2 1 +github.com/streamdal/streamdal/sdks/go/validate/validate.go:110.17,112.3 1 1 +github.com/streamdal/streamdal/sdks/go/validate/validate.go:114.2,115.16 2 1 +github.com/streamdal/streamdal/sdks/go/validate/validate.go:115.16,117.3 1 1 +github.com/streamdal/streamdal/sdks/go/validate/validate.go:119.2,119.18 1 1 +github.com/streamdal/streamdal/sdks/go/validate/validate.go:119.18,121.3 1 1 +github.com/streamdal/streamdal/sdks/go/validate/validate.go:123.2,123.47 1 1 +github.com/streamdal/streamdal/sdks/go/validate/validate.go:123.47,125.3 1 0 +github.com/streamdal/streamdal/sdks/go/validate/validate.go:127.2,127.12 1 1 +github.com/streamdal/streamdal/sdks/go/validate/validate.go:130.57,131.16 1 0 +github.com/streamdal/streamdal/sdks/go/validate/validate.go:131.16,133.3 1 0 +github.com/streamdal/streamdal/sdks/go/validate/validate.go:135.2,136.17 2 0 +github.com/streamdal/streamdal/sdks/go/validate/validate.go:136.17,138.3 1 0 +github.com/streamdal/streamdal/sdks/go/validate/validate.go:140.2,141.16 2 0 +github.com/streamdal/streamdal/sdks/go/validate/validate.go:141.16,143.3 1 0 +github.com/streamdal/streamdal/sdks/go/validate/validate.go:145.2,145.18 1 0 +github.com/streamdal/streamdal/sdks/go/validate/validate.go:145.18,147.3 1 0 +github.com/streamdal/streamdal/sdks/go/validate/validate.go:149.2,149.47 1 0 +github.com/streamdal/streamdal/sdks/go/validate/validate.go:149.47,151.3 1 0 +github.com/streamdal/streamdal/sdks/go/validate/validate.go:153.2,153.12 1 0 +github.com/streamdal/streamdal/sdks/go/validate/validate.go:156.58,157.16 1 0 +github.com/streamdal/streamdal/sdks/go/validate/validate.go:157.16,159.3 1 0 +github.com/streamdal/streamdal/sdks/go/validate/validate.go:161.2,162.17 2 0 +github.com/streamdal/streamdal/sdks/go/validate/validate.go:162.17,164.3 1 0 +github.com/streamdal/streamdal/sdks/go/validate/validate.go:166.2,167.16 2 0 +github.com/streamdal/streamdal/sdks/go/validate/validate.go:167.16,169.3 1 0 +github.com/streamdal/streamdal/sdks/go/validate/validate.go:171.2,171.18 1 0 +github.com/streamdal/streamdal/sdks/go/validate/validate.go:171.18,173.3 1 0 +github.com/streamdal/streamdal/sdks/go/validate/validate.go:175.2,175.47 1 0 +github.com/streamdal/streamdal/sdks/go/validate/validate.go:175.47,177.3 1 0 +github.com/streamdal/streamdal/sdks/go/validate/validate.go:179.2,179.12 1 0 +github.com/streamdal/streamdal/sdks/go/validate/validate.go:182.44,183.15 1 1 +github.com/streamdal/streamdal/sdks/go/validate/validate.go:183.15,185.3 1 1 +github.com/streamdal/streamdal/sdks/go/validate/validate.go:187.2,187.12 1 1 +github.com/streamdal/streamdal/sdks/go/metrics/counter.go:19.51,25.2 4 1 +github.com/streamdal/streamdal/sdks/go/metrics/counter.go:27.46,32.2 3 1 +github.com/streamdal/streamdal/sdks/go/metrics/counter.go:35.36,40.2 3 1 +github.com/streamdal/streamdal/sdks/go/metrics/counter.go:42.49,46.2 3 1 +github.com/streamdal/streamdal/sdks/go/metrics/counter.go:48.48,51.29 3 1 +github.com/streamdal/streamdal/sdks/go/metrics/counter.go:51.29,53.3 1 1 +github.com/streamdal/streamdal/sdks/go/metrics/counter.go:54.2,54.37 1 1 +github.com/streamdal/streamdal/sdks/go/metrics/counter.go:57.27,62.2 3 1 +github.com/streamdal/streamdal/sdks/go/metrics/metrics.go:79.41,80.44 1 1 +github.com/streamdal/streamdal/sdks/go/metrics/metrics.go:80.44,82.3 1 0 +github.com/streamdal/streamdal/sdks/go/metrics/metrics.go:84.2,96.47 2 1 +github.com/streamdal/streamdal/sdks/go/metrics/metrics.go:96.47,102.3 2 1 +github.com/streamdal/streamdal/sdks/go/metrics/metrics.go:105.2,112.15 5 1 +github.com/streamdal/streamdal/sdks/go/metrics/metrics.go:115.40,116.16 1 1 +github.com/streamdal/streamdal/sdks/go/metrics/metrics.go:116.16,118.3 1 1 +github.com/streamdal/streamdal/sdks/go/metrics/metrics.go:120.2,120.29 1 1 +github.com/streamdal/streamdal/sdks/go/metrics/metrics.go:120.29,122.3 1 1 +github.com/streamdal/streamdal/sdks/go/metrics/metrics.go:124.2,124.28 1 1 +github.com/streamdal/streamdal/sdks/go/metrics/metrics.go:124.28,126.3 1 1 +github.com/streamdal/streamdal/sdks/go/metrics/metrics.go:128.2,130.12 2 1 +github.com/streamdal/streamdal/sdks/go/metrics/metrics.go:133.33,134.27 1 1 +github.com/streamdal/streamdal/sdks/go/metrics/metrics.go:134.27,136.3 1 1 +github.com/streamdal/streamdal/sdks/go/metrics/metrics.go:138.2,138.29 1 1 +github.com/streamdal/streamdal/sdks/go/metrics/metrics.go:138.29,140.3 1 1 +github.com/streamdal/streamdal/sdks/go/metrics/metrics.go:142.2,142.24 1 1 +github.com/streamdal/streamdal/sdks/go/metrics/metrics.go:142.24,144.3 1 1 +github.com/streamdal/streamdal/sdks/go/metrics/metrics.go:147.2,147.29 1 1 +github.com/streamdal/streamdal/sdks/go/metrics/metrics.go:147.29,149.3 1 1 +github.com/streamdal/streamdal/sdks/go/metrics/metrics.go:151.2,151.20 1 1 +github.com/streamdal/streamdal/sdks/go/metrics/metrics.go:151.20,153.3 1 1 +github.com/streamdal/streamdal/sdks/go/metrics/metrics.go:156.76,157.52 1 1 +github.com/streamdal/streamdal/sdks/go/metrics/metrics.go:157.52,159.3 1 0 +github.com/streamdal/streamdal/sdks/go/metrics/metrics.go:163.2,165.12 2 1 +github.com/streamdal/streamdal/sdks/go/metrics/metrics.go:168.60,169.18 1 1 +github.com/streamdal/streamdal/sdks/go/metrics/metrics.go:169.18,171.3 1 1 +github.com/streamdal/streamdal/sdks/go/metrics/metrics.go:173.2,173.22 1 1 +github.com/streamdal/streamdal/sdks/go/metrics/metrics.go:173.22,175.3 1 1 +github.com/streamdal/streamdal/sdks/go/metrics/metrics.go:177.2,177.12 1 1 +github.com/streamdal/streamdal/sdks/go/metrics/metrics.go:180.62,192.2 5 1 +github.com/streamdal/streamdal/sdks/go/metrics/metrics.go:194.70,198.53 3 1 +github.com/streamdal/streamdal/sdks/go/metrics/metrics.go:198.53,200.3 1 0 +github.com/streamdal/streamdal/sdks/go/metrics/metrics.go:202.2,202.19 1 1 +github.com/streamdal/streamdal/sdks/go/metrics/metrics.go:206.53,212.47 4 1 +github.com/streamdal/streamdal/sdks/go/metrics/metrics.go:212.47,214.3 1 1 +github.com/streamdal/streamdal/sdks/go/metrics/metrics.go:216.2,216.22 1 1 +github.com/streamdal/streamdal/sdks/go/metrics/metrics.go:219.76,222.8 2 1 +github.com/streamdal/streamdal/sdks/go/metrics/metrics.go:222.8,225.3 2 0 +github.com/streamdal/streamdal/sdks/go/metrics/metrics.go:227.2,230.12 3 1 +github.com/streamdal/streamdal/sdks/go/metrics/metrics.go:235.74,247.27 5 1 +github.com/streamdal/streamdal/sdks/go/metrics/metrics.go:247.27,249.15 1 1 +github.com/streamdal/streamdal/sdks/go/metrics/metrics.go:249.15,252.4 2 1 +github.com/streamdal/streamdal/sdks/go/metrics/metrics.go:254.3,254.10 1 1 +github.com/streamdal/streamdal/sdks/go/metrics/metrics.go:255.35,256.45 1 1 +github.com/streamdal/streamdal/sdks/go/metrics/metrics.go:257.38,259.50 2 0 +github.com/streamdal/streamdal/sdks/go/metrics/metrics.go:260.31,265.14 4 1 +github.com/streamdal/streamdal/sdks/go/metrics/metrics.go:268.3,268.17 1 1 +github.com/streamdal/streamdal/sdks/go/metrics/metrics.go:268.17,270.4 1 0 +github.com/streamdal/streamdal/sdks/go/metrics/metrics.go:272.3,272.108 1 1 +github.com/streamdal/streamdal/sdks/go/metrics/metrics.go:272.108,279.73 4 0 +github.com/streamdal/streamdal/sdks/go/metrics/metrics.go:279.73,284.5 3 0 +github.com/streamdal/streamdal/sdks/go/metrics/metrics.go:287.3,287.13 1 1 +github.com/streamdal/streamdal/sdks/go/metrics/metrics.go:290.2,290.46 1 1 +github.com/streamdal/streamdal/sdks/go/metrics/metrics.go:293.38,300.42 4 1 +github.com/streamdal/streamdal/sdks/go/metrics/metrics.go:300.42,302.15 1 1 +github.com/streamdal/streamdal/sdks/go/metrics/metrics.go:302.15,305.4 2 1 +github.com/streamdal/streamdal/sdks/go/metrics/metrics.go:307.3,307.10 1 1 +github.com/streamdal/streamdal/sdks/go/metrics/metrics.go:308.19,311.37 2 1 +github.com/streamdal/streamdal/sdks/go/metrics/metrics.go:311.37,315.26 2 1 +github.com/streamdal/streamdal/sdks/go/metrics/metrics.go:315.26,316.14 1 0 +github.com/streamdal/streamdal/sdks/go/metrics/metrics.go:320.5,326.33 3 1 +github.com/streamdal/streamdal/sdks/go/metrics/metrics.go:328.31,331.19 3 1 +github.com/streamdal/streamdal/sdks/go/metrics/metrics.go:334.3,334.13 1 1 +github.com/streamdal/streamdal/sdks/go/metrics/metrics.go:337.2,337.44 1 1 +github.com/streamdal/streamdal/sdks/go/metrics/metrics.go:340.38,347.42 4 1 +github.com/streamdal/streamdal/sdks/go/metrics/metrics.go:347.42,348.15 1 1 +github.com/streamdal/streamdal/sdks/go/metrics/metrics.go:348.15,351.4 2 1 +github.com/streamdal/streamdal/sdks/go/metrics/metrics.go:353.3,353.10 1 1 +github.com/streamdal/streamdal/sdks/go/metrics/metrics.go:354.19,357.45 2 1 +github.com/streamdal/streamdal/sdks/go/metrics/metrics.go:357.45,359.32 1 1 +github.com/streamdal/streamdal/sdks/go/metrics/metrics.go:359.32,361.14 2 0 +github.com/streamdal/streamdal/sdks/go/metrics/metrics.go:364.5,364.70 1 1 +github.com/streamdal/streamdal/sdks/go/metrics/metrics.go:364.70,366.14 2 0 +github.com/streamdal/streamdal/sdks/go/metrics/metrics.go:369.5,373.31 4 1 +github.com/streamdal/streamdal/sdks/go/metrics/metrics.go:375.31,380.14 4 1 +github.com/streamdal/streamdal/sdks/go/metrics/metrics.go:383.3,383.13 1 1 +github.com/streamdal/streamdal/sdks/go/metrics/metrics.go:386.2,386.44 1 1 +github.com/streamdal/streamdal/sdks/go/audience.go:20.76,22.30 1 1 +github.com/streamdal/streamdal/sdks/go/audience.go:22.30,24.3 1 1 +github.com/streamdal/streamdal/sdks/go/audience.go:26.2,28.24 2 1 +github.com/streamdal/streamdal/sdks/go/audience.go:28.24,30.3 1 1 +github.com/streamdal/streamdal/sdks/go/audience.go:32.2,36.12 3 1 +github.com/streamdal/streamdal/sdks/go/audience.go:36.12,37.75 1 1 +github.com/streamdal/streamdal/sdks/go/audience.go:37.75,39.4 1 1 +github.com/streamdal/streamdal/sdks/go/audience.go:43.77,48.2 3 0 +github.com/streamdal/streamdal/sdks/go/audience.go:53.55,57.34 3 1 +github.com/streamdal/streamdal/sdks/go/audience.go:57.34,60.17 2 1 +github.com/streamdal/streamdal/sdks/go/audience.go:60.17,62.12 2 1 +github.com/streamdal/streamdal/sdks/go/audience.go:66.3,66.13 1 1 +github.com/streamdal/streamdal/sdks/go/audience.go:66.13,67.76 1 1 +github.com/streamdal/streamdal/sdks/go/audience.go:67.76,69.5 1 0 +github.com/streamdal/streamdal/sdks/go/audience.go:74.80,78.24 3 1 +github.com/streamdal/streamdal/sdks/go/audience.go:78.24,80.3 1 1 +github.com/streamdal/streamdal/sdks/go/audience.go:82.2,83.11 2 1 +github.com/streamdal/streamdal/sdks/go/audience.go:86.62,91.31 4 1 +github.com/streamdal/streamdal/sdks/go/audience.go:91.31,93.3 1 0 +github.com/streamdal/streamdal/sdks/go/audience.go:95.2,95.13 1 1 +github.com/streamdal/streamdal/sdks/go/audience.go:98.44,99.16 1 1 +github.com/streamdal/streamdal/sdks/go/audience.go:99.16,101.3 1 1 +github.com/streamdal/streamdal/sdks/go/audience.go:103.2,103.126 1 1 +github.com/streamdal/streamdal/sdks/go/audience.go:106.44,107.15 1 1 +github.com/streamdal/streamdal/sdks/go/audience.go:107.15,109.3 1 1 +github.com/streamdal/streamdal/sdks/go/audience.go:111.2,114.21 3 1 +github.com/streamdal/streamdal/sdks/go/audience.go:114.21,116.3 1 1 +github.com/streamdal/streamdal/sdks/go/audience.go:118.2,119.16 2 1 +github.com/streamdal/streamdal/sdks/go/audience.go:119.16,121.3 1 0 +github.com/streamdal/streamdal/sdks/go/audience.go:123.2,128.3 1 1 +github.com/streamdal/streamdal/sdks/go/audience.go:131.65,138.2 1 1 +github.com/streamdal/streamdal/sdks/go/function.go:27.74,31.16 3 1 +github.com/streamdal/streamdal/sdks/go/function.go:31.16,33.3 1 0 +github.com/streamdal/streamdal/sdks/go/function.go:35.2,35.24 1 1 +github.com/streamdal/streamdal/sdks/go/function.go:35.24,37.3 1 0 +github.com/streamdal/streamdal/sdks/go/function.go:39.2,41.49 2 1 +github.com/streamdal/streamdal/sdks/go/function.go:41.49,44.3 1 0 +github.com/streamdal/streamdal/sdks/go/function.go:46.2,47.16 2 1 +github.com/streamdal/streamdal/sdks/go/function.go:47.16,49.64 1 0 +github.com/streamdal/streamdal/sdks/go/function.go:49.64,51.4 1 0 +github.com/streamdal/streamdal/sdks/go/function.go:52.3,52.57 1 0 +github.com/streamdal/streamdal/sdks/go/function.go:55.2,59.63 3 1 +github.com/streamdal/streamdal/sdks/go/function.go:59.63,61.3 1 0 +github.com/streamdal/streamdal/sdks/go/function.go:64.2,65.16 2 1 +github.com/streamdal/streamdal/sdks/go/function.go:65.16,67.87 1 0 +github.com/streamdal/streamdal/sdks/go/function.go:67.87,69.4 1 0 +github.com/streamdal/streamdal/sdks/go/function.go:70.3,70.56 1 0 +github.com/streamdal/streamdal/sdks/go/function.go:74.2,74.86 1 1 +github.com/streamdal/streamdal/sdks/go/function.go:74.86,76.3 1 0 +github.com/streamdal/streamdal/sdks/go/function.go:78.2,78.22 1 1 +github.com/streamdal/streamdal/sdks/go/function.go:81.80,85.41 3 1 +github.com/streamdal/streamdal/sdks/go/function.go:85.41,87.3 1 1 +github.com/streamdal/streamdal/sdks/go/function.go:89.2,89.35 1 1 +github.com/streamdal/streamdal/sdks/go/function.go:92.112,95.8 2 1 +github.com/streamdal/streamdal/sdks/go/function.go:95.8,97.3 1 1 +github.com/streamdal/streamdal/sdks/go/function.go:102.2,108.16 5 1 +github.com/streamdal/streamdal/sdks/go/function.go:108.16,110.3 1 0 +github.com/streamdal/streamdal/sdks/go/function.go:113.2,115.16 2 1 +github.com/streamdal/streamdal/sdks/go/function.go:118.65,122.41 3 1 +github.com/streamdal/streamdal/sdks/go/function.go:122.41,124.3 1 1 +github.com/streamdal/streamdal/sdks/go/function.go:127.2,129.29 2 1 +github.com/streamdal/streamdal/sdks/go/function.go:132.89,148.41 6 1 +github.com/streamdal/streamdal/sdks/go/function.go:148.41,150.3 1 1 +github.com/streamdal/streamdal/sdks/go/function.go:152.2,153.14 2 1 +github.com/streamdal/streamdal/sdks/go/function.go:156.82,158.16 2 1 +github.com/streamdal/streamdal/sdks/go/function.go:158.16,160.3 1 0 +github.com/streamdal/streamdal/sdks/go/function.go:163.2,164.14 2 1 +github.com/streamdal/streamdal/sdks/go/function.go:164.14,166.3 1 0 +github.com/streamdal/streamdal/sdks/go/function.go:169.2,170.18 2 1 +github.com/streamdal/streamdal/sdks/go/function.go:170.18,172.3 1 0 +github.com/streamdal/streamdal/sdks/go/function.go:175.2,176.20 2 1 +github.com/streamdal/streamdal/sdks/go/function.go:176.20,178.3 1 0 +github.com/streamdal/streamdal/sdks/go/function.go:180.2,187.8 1 1 +github.com/streamdal/streamdal/sdks/go/function.go:190.69,196.2 4 1 +github.com/streamdal/streamdal/sdks/go/function.go:198.65,203.2 3 1 +github.com/streamdal/streamdal/sdks/go/function.go:205.87,210.9 2 1 +github.com/streamdal/streamdal/sdks/go/function.go:210.9,213.30 2 1 +github.com/streamdal/streamdal/sdks/go/function.go:213.30,216.4 1 0 +github.com/streamdal/streamdal/sdks/go/function.go:219.3,220.28 2 1 +github.com/streamdal/streamdal/sdks/go/function.go:223.2,230.38 3 1 +github.com/streamdal/streamdal/sdks/go/function.go:231.35,234.39 1 1 +github.com/streamdal/streamdal/sdks/go/function.go:235.38,237.30 1 1 +github.com/streamdal/streamdal/sdks/go/function.go:238.10,239.58 1 0 +github.com/streamdal/streamdal/sdks/go/function.go:242.2,250.46 6 1 +github.com/streamdal/streamdal/sdks/go/function.go:250.46,252.3 1 0 +github.com/streamdal/streamdal/sdks/go/function.go:254.2,254.46 1 1 +github.com/streamdal/streamdal/sdks/go/function.go:254.46,256.3 1 0 +github.com/streamdal/streamdal/sdks/go/function.go:258.2,270.34 3 1 +github.com/streamdal/streamdal/sdks/go/function.go:270.34,274.3 1 1 +github.com/streamdal/streamdal/sdks/go/function.go:276.2,276.52 1 1 +github.com/streamdal/streamdal/sdks/go/function.go:276.52,278.3 1 0 +github.com/streamdal/streamdal/sdks/go/function.go:280.2,281.16 2 1 +github.com/streamdal/streamdal/sdks/go/function.go:281.16,283.3 1 0 +github.com/streamdal/streamdal/sdks/go/function.go:285.2,285.17 1 1 +github.com/streamdal/streamdal/sdks/go/function.go:288.67,290.9 2 1 +github.com/streamdal/streamdal/sdks/go/function.go:290.9,292.3 1 0 +github.com/streamdal/streamdal/sdks/go/function.go:294.2,294.17 1 1 +github.com/streamdal/streamdal/sdks/go/go_sdk.go:328.43,329.44 1 1 +github.com/streamdal/streamdal/sdks/go/go_sdk.go:329.44,331.3 1 0 +github.com/streamdal/streamdal/sdks/go/go_sdk.go:336.2,336.50 1 1 +github.com/streamdal/streamdal/sdks/go/go_sdk.go:336.50,338.3 1 0 +github.com/streamdal/streamdal/sdks/go/go_sdk.go:342.2,346.16 4 1 +github.com/streamdal/streamdal/sdks/go/go_sdk.go:346.16,349.3 2 0 +github.com/streamdal/streamdal/sdks/go/go_sdk.go:351.2,357.16 2 1 +github.com/streamdal/streamdal/sdks/go/go_sdk.go:357.16,360.3 2 0 +github.com/streamdal/streamdal/sdks/go/go_sdk.go:362.2,365.16 2 1 +github.com/streamdal/streamdal/sdks/go/go_sdk.go:365.16,368.3 2 0 +github.com/streamdal/streamdal/sdks/go/go_sdk.go:370.2,371.16 2 1 +github.com/streamdal/streamdal/sdks/go/go_sdk.go:371.16,374.3 2 0 +github.com/streamdal/streamdal/sdks/go/go_sdk.go:376.2,405.16 2 1 +github.com/streamdal/streamdal/sdks/go/go_sdk.go:405.16,407.3 1 0 +github.com/streamdal/streamdal/sdks/go/go_sdk.go:409.2,409.25 1 1 +github.com/streamdal/streamdal/sdks/go/go_sdk.go:409.25,412.3 2 0 +github.com/streamdal/streamdal/sdks/go/go_sdk.go:414.2,414.64 1 1 +github.com/streamdal/streamdal/sdks/go/go_sdk.go:414.64,416.3 1 0 +github.com/streamdal/streamdal/sdks/go/go_sdk.go:418.2,421.12 2 1 +github.com/streamdal/streamdal/sdks/go/go_sdk.go:421.12,422.99 1 1 +github.com/streamdal/streamdal/sdks/go/go_sdk.go:422.99,424.4 1 0 +github.com/streamdal/streamdal/sdks/go/go_sdk.go:428.2,434.9 3 1 +github.com/streamdal/streamdal/sdks/go/go_sdk.go:435.22,436.60 1 0 +github.com/streamdal/streamdal/sdks/go/go_sdk.go:437.37,439.28 1 1 +github.com/streamdal/streamdal/sdks/go/go_sdk.go:439.28,442.4 2 0 +github.com/streamdal/streamdal/sdks/go/go_sdk.go:444.3,444.16 1 1 +github.com/streamdal/streamdal/sdks/go/go_sdk.go:448.29,451.2 2 1 +github.com/streamdal/streamdal/sdks/go/go_sdk.go:453.40,454.16 1 1 +github.com/streamdal/streamdal/sdks/go/go_sdk.go:454.16,456.3 1 1 +github.com/streamdal/streamdal/sdks/go/go_sdk.go:458.2,458.28 1 1 +github.com/streamdal/streamdal/sdks/go/go_sdk.go:458.28,460.3 1 0 +github.com/streamdal/streamdal/sdks/go/go_sdk.go:462.2,462.27 1 1 +github.com/streamdal/streamdal/sdks/go/go_sdk.go:462.27,464.28 2 1 +github.com/streamdal/streamdal/sdks/go/go_sdk.go:464.28,466.4 1 1 +github.com/streamdal/streamdal/sdks/go/go_sdk.go:470.2,470.25 1 1 +github.com/streamdal/streamdal/sdks/go/go_sdk.go:470.25,472.3 1 0 +github.com/streamdal/streamdal/sdks/go/go_sdk.go:475.2,475.27 1 1 +github.com/streamdal/streamdal/sdks/go/go_sdk.go:475.27,477.3 1 0 +github.com/streamdal/streamdal/sdks/go/go_sdk.go:480.2,480.46 1 1 +github.com/streamdal/streamdal/sdks/go/go_sdk.go:480.46,482.3 1 0 +github.com/streamdal/streamdal/sdks/go/go_sdk.go:485.2,485.26 1 1 +github.com/streamdal/streamdal/sdks/go/go_sdk.go:485.26,487.15 2 1 +github.com/streamdal/streamdal/sdks/go/go_sdk.go:487.15,489.4 1 1 +github.com/streamdal/streamdal/sdks/go/go_sdk.go:491.3,492.17 2 1 +github.com/streamdal/streamdal/sdks/go/go_sdk.go:492.17,494.4 1 1 +github.com/streamdal/streamdal/sdks/go/go_sdk.go:496.3,496.28 1 1 +github.com/streamdal/streamdal/sdks/go/go_sdk.go:500.2,500.30 1 1 +github.com/streamdal/streamdal/sdks/go/go_sdk.go:500.30,502.15 2 1 +github.com/streamdal/streamdal/sdks/go/go_sdk.go:502.15,504.4 1 1 +github.com/streamdal/streamdal/sdks/go/go_sdk.go:506.3,507.17 2 1 +github.com/streamdal/streamdal/sdks/go/go_sdk.go:507.17,509.4 1 0 +github.com/streamdal/streamdal/sdks/go/go_sdk.go:511.3,511.32 1 1 +github.com/streamdal/streamdal/sdks/go/go_sdk.go:515.2,515.23 1 1 +github.com/streamdal/streamdal/sdks/go/go_sdk.go:515.23,517.3 1 0 +github.com/streamdal/streamdal/sdks/go/go_sdk.go:520.2,520.73 1 1 +github.com/streamdal/streamdal/sdks/go/go_sdk.go:520.73,522.3 1 1 +github.com/streamdal/streamdal/sdks/go/go_sdk.go:524.2,524.25 1 1 +github.com/streamdal/streamdal/sdks/go/go_sdk.go:524.25,525.28 1 0 +github.com/streamdal/streamdal/sdks/go/go_sdk.go:525.28,527.4 1 0 +github.com/streamdal/streamdal/sdks/go/go_sdk.go:529.3,529.39 1 0 +github.com/streamdal/streamdal/sdks/go/go_sdk.go:529.39,531.4 1 0 +github.com/streamdal/streamdal/sdks/go/go_sdk.go:535.2,535.19 1 1 +github.com/streamdal/streamdal/sdks/go/go_sdk.go:535.19,537.3 1 1 +github.com/streamdal/streamdal/sdks/go/go_sdk.go:539.2,539.34 1 1 +github.com/streamdal/streamdal/sdks/go/go_sdk.go:539.34,541.3 1 1 +github.com/streamdal/streamdal/sdks/go/go_sdk.go:543.2,543.32 1 1 +github.com/streamdal/streamdal/sdks/go/go_sdk.go:543.32,545.3 1 1 +github.com/streamdal/streamdal/sdks/go/go_sdk.go:547.2,547.34 1 1 +github.com/streamdal/streamdal/sdks/go/go_sdk.go:547.34,549.3 1 1 +github.com/streamdal/streamdal/sdks/go/go_sdk.go:551.2,551.12 1 1 +github.com/streamdal/streamdal/sdks/go/go_sdk.go:554.56,555.16 1 1 +github.com/streamdal/streamdal/sdks/go/go_sdk.go:555.16,557.3 1 1 +github.com/streamdal/streamdal/sdks/go/go_sdk.go:559.2,559.29 1 1 +github.com/streamdal/streamdal/sdks/go/go_sdk.go:559.29,561.3 1 0 +github.com/streamdal/streamdal/sdks/go/go_sdk.go:563.2,563.29 1 1 +github.com/streamdal/streamdal/sdks/go/go_sdk.go:563.29,565.3 1 0 +github.com/streamdal/streamdal/sdks/go/go_sdk.go:567.2,567.94 1 1 +github.com/streamdal/streamdal/sdks/go/go_sdk.go:567.94,569.3 1 0 +github.com/streamdal/streamdal/sdks/go/go_sdk.go:571.2,571.12 1 1 +github.com/streamdal/streamdal/sdks/go/go_sdk.go:574.40,580.32 4 1 +github.com/streamdal/streamdal/sdks/go/go_sdk.go:580.32,581.34 1 0 +github.com/streamdal/streamdal/sdks/go/go_sdk.go:581.34,585.4 3 0 +github.com/streamdal/streamdal/sdks/go/go_sdk.go:589.2,591.50 2 1 +github.com/streamdal/streamdal/sdks/go/go_sdk.go:594.69,596.16 2 1 +github.com/streamdal/streamdal/sdks/go/go_sdk.go:596.16,598.3 1 0 +github.com/streamdal/streamdal/sdks/go/go_sdk.go:600.2,600.47 1 1 +github.com/streamdal/streamdal/sdks/go/go_sdk.go:600.47,608.50 2 0 +github.com/streamdal/streamdal/sdks/go/go_sdk.go:608.50,610.4 1 0 +github.com/streamdal/streamdal/sdks/go/go_sdk.go:613.2,613.12 1 1 +github.com/streamdal/streamdal/sdks/go/go_sdk.go:616.59,618.25 2 1 +github.com/streamdal/streamdal/sdks/go/go_sdk.go:618.25,619.11 1 1 +github.com/streamdal/streamdal/sdks/go/go_sdk.go:619.11,622.4 2 0 +github.com/streamdal/streamdal/sdks/go/go_sdk.go:624.3,624.10 1 1 +github.com/streamdal/streamdal/sdks/go/go_sdk.go:625.38,628.14 3 1 +github.com/streamdal/streamdal/sdks/go/go_sdk.go:629.11,629.11 0 1 +github.com/streamdal/streamdal/sdks/go/go_sdk.go:633.3,640.76 2 1 +github.com/streamdal/streamdal/sdks/go/go_sdk.go:640.76,641.59 1 1 +github.com/streamdal/streamdal/sdks/go/go_sdk.go:641.59,646.5 3 0 +github.com/streamdal/streamdal/sdks/go/go_sdk.go:647.4,647.63 1 1 +github.com/streamdal/streamdal/sdks/go/go_sdk.go:650.3,650.13 1 1 +github.com/streamdal/streamdal/sdks/go/go_sdk.go:653.2,653.43 1 1 +github.com/streamdal/streamdal/sdks/go/go_sdk.go:657.215,662.16 3 1 +github.com/streamdal/streamdal/sdks/go/go_sdk.go:662.16,664.3 1 0 +github.com/streamdal/streamdal/sdks/go/go_sdk.go:666.2,680.16 6 1 +github.com/streamdal/streamdal/sdks/go/go_sdk.go:680.16,682.3 1 0 +github.com/streamdal/streamdal/sdks/go/go_sdk.go:684.2,689.16 4 1 +github.com/streamdal/streamdal/sdks/go/go_sdk.go:689.16,691.3 1 0 +github.com/streamdal/streamdal/sdks/go/go_sdk.go:693.2,694.57 2 1 +github.com/streamdal/streamdal/sdks/go/go_sdk.go:694.57,696.3 1 0 +github.com/streamdal/streamdal/sdks/go/go_sdk.go:700.2,702.18 2 1 +github.com/streamdal/streamdal/sdks/go/go_sdk.go:705.96,712.9 5 1 +github.com/streamdal/streamdal/sdks/go/go_sdk.go:712.9,714.3 1 1 +github.com/streamdal/streamdal/sdks/go/go_sdk.go:716.2,716.18 1 1 +github.com/streamdal/streamdal/sdks/go/go_sdk.go:719.104,728.21 2 1 +github.com/streamdal/streamdal/sdks/go/go_sdk.go:728.21,731.3 2 1 +github.com/streamdal/streamdal/sdks/go/go_sdk.go:733.2,733.10 1 1 +github.com/streamdal/streamdal/sdks/go/go_sdk.go:736.69,737.30 1 1 +github.com/streamdal/streamdal/sdks/go/go_sdk.go:737.30,738.56 1 0 +github.com/streamdal/streamdal/sdks/go/go_sdk.go:741.2,746.3 1 1 +github.com/streamdal/streamdal/sdks/go/go_sdk.go:748.88,749.23 1 1 +github.com/streamdal/streamdal/sdks/go/go_sdk.go:750.16,752.36 1 1 +github.com/streamdal/streamdal/sdks/go/go_sdk.go:753.17,762.4 2 0 +github.com/streamdal/streamdal/sdks/go/go_sdk.go:763.10,771.4 1 0 +github.com/streamdal/streamdal/sdks/go/go_sdk.go:775.41,776.53 1 0 +github.com/streamdal/streamdal/sdks/go/go_sdk.go:776.53,778.3 1 0 +github.com/streamdal/streamdal/sdks/go/go_sdk.go:781.50,784.6 2 0 +github.com/streamdal/streamdal/sdks/go/go_sdk.go:784.6,785.10 1 0 +github.com/streamdal/streamdal/sdks/go/go_sdk.go:786.38,788.10 2 0 +github.com/streamdal/streamdal/sdks/go/go_sdk.go:789.27,791.54 2 0 +github.com/streamdal/streamdal/sdks/go/go_sdk.go:796.106,803.14 2 1 +github.com/streamdal/streamdal/sdks/go/go_sdk.go:803.14,807.3 3 1 +github.com/streamdal/streamdal/sdks/go/go_sdk.go:809.2,809.24 1 1 +github.com/streamdal/streamdal/sdks/go/go_sdk.go:809.24,815.3 4 0 +github.com/streamdal/streamdal/sdks/go/go_sdk.go:817.2,817.52 1 1 +github.com/streamdal/streamdal/sdks/go/go_sdk.go:817.52,822.3 3 1 +github.com/streamdal/streamdal/sdks/go/go_sdk.go:824.2,830.15 4 1 +github.com/streamdal/streamdal/sdks/go/go_sdk.go:830.15,832.3 1 1 +github.com/streamdal/streamdal/sdks/go/go_sdk.go:835.2,841.48 6 1 +github.com/streamdal/streamdal/sdks/go/go_sdk.go:841.48,847.3 5 1 +github.com/streamdal/streamdal/sdks/go/go_sdk.go:850.2,863.25 4 1 +github.com/streamdal/streamdal/sdks/go/go_sdk.go:863.25,868.3 2 0 +github.com/streamdal/streamdal/sdks/go/go_sdk.go:870.2,870.38 1 1 +github.com/streamdal/streamdal/sdks/go/go_sdk.go:870.38,878.3 5 0 +github.com/streamdal/streamdal/sdks/go/go_sdk.go:880.2,887.37 3 1 +github.com/streamdal/streamdal/sdks/go/go_sdk.go:887.37,904.39 8 1 +github.com/streamdal/streamdal/sdks/go/go_sdk.go:904.39,913.11 4 1 +github.com/streamdal/streamdal/sdks/go/go_sdk.go:914.37,927.26 7 1 +github.com/streamdal/streamdal/sdks/go/go_sdk.go:927.26,929.34 1 0 +github.com/streamdal/streamdal/sdks/go/go_sdk.go:929.34,931.7 1 0 +github.com/streamdal/streamdal/sdks/go/go_sdk.go:931.12,933.7 1 0 +github.com/streamdal/streamdal/sdks/go/go_sdk.go:935.6,937.23 2 0 +github.com/streamdal/streamdal/sdks/go/go_sdk.go:938.11,938.29 1 1 +github.com/streamdal/streamdal/sdks/go/go_sdk.go:938.29,945.6 3 0 +github.com/streamdal/streamdal/sdks/go/go_sdk.go:948.5,948.129 1 1 +github.com/streamdal/streamdal/sdks/go/go_sdk.go:949.12,949.12 0 1 +github.com/streamdal/streamdal/sdks/go/go_sdk.go:955.4,956.18 2 1 +github.com/streamdal/streamdal/sdks/go/go_sdk.go:956.18,970.26 7 0 +github.com/streamdal/streamdal/sdks/go/go_sdk.go:970.26,979.58 2 0 +github.com/streamdal/streamdal/sdks/go/go_sdk.go:979.58,981.7 1 0 +github.com/streamdal/streamdal/sdks/go/go_sdk.go:981.12,983.7 1 0 +github.com/streamdal/streamdal/sdks/go/go_sdk.go:985.6,987.23 2 0 +github.com/streamdal/streamdal/sdks/go/go_sdk.go:988.11,988.29 1 0 +github.com/streamdal/streamdal/sdks/go/go_sdk.go:988.29,997.6 4 0 +github.com/streamdal/streamdal/sdks/go/go_sdk.go:1000.5,1004.13 3 0 +github.com/streamdal/streamdal/sdks/go/go_sdk.go:1008.4,1008.39 1 1 +github.com/streamdal/streamdal/sdks/go/go_sdk.go:1008.39,1010.5 1 1 +github.com/streamdal/streamdal/sdks/go/go_sdk.go:1012.4,1013.18 2 1 +github.com/streamdal/streamdal/sdks/go/go_sdk.go:1013.18,1017.5 1 1 +github.com/streamdal/streamdal/sdks/go/go_sdk.go:1019.4,1027.29 2 1 +github.com/streamdal/streamdal/sdks/go/go_sdk.go:1028.49,1035.59 5 1 +github.com/streamdal/streamdal/sdks/go/go_sdk.go:1036.50,1043.60 5 1 +github.com/streamdal/streamdal/sdks/go/go_sdk.go:1044.50,1051.60 5 1 +github.com/streamdal/streamdal/sdks/go/go_sdk.go:1052.12,1054.118 2 0 +github.com/streamdal/streamdal/sdks/go/go_sdk.go:1059.4,1073.61 7 1 +github.com/streamdal/streamdal/sdks/go/go_sdk.go:1073.61,1075.5 1 1 +github.com/streamdal/streamdal/sdks/go/go_sdk.go:1077.4,1077.25 1 1 +github.com/streamdal/streamdal/sdks/go/go_sdk.go:1077.25,1086.57 2 0 +github.com/streamdal/streamdal/sdks/go/go_sdk.go:1086.57,1088.6 1 0 +github.com/streamdal/streamdal/sdks/go/go_sdk.go:1088.11,1090.6 1 0 +github.com/streamdal/streamdal/sdks/go/go_sdk.go:1092.5,1094.22 2 0 +github.com/streamdal/streamdal/sdks/go/go_sdk.go:1095.10,1095.28 1 1 +github.com/streamdal/streamdal/sdks/go/go_sdk.go:1095.28,1104.5 4 1 +github.com/streamdal/streamdal/sdks/go/go_sdk.go:1107.4,1109.93 2 1 +github.com/streamdal/streamdal/sdks/go/go_sdk.go:1114.3,1117.44 2 1 +github.com/streamdal/streamdal/sdks/go/go_sdk.go:1124.2,1124.21 1 1 +github.com/streamdal/streamdal/sdks/go/go_sdk.go:1124.21,1126.3 1 0 +github.com/streamdal/streamdal/sdks/go/go_sdk.go:1128.2,1128.13 1 1 +github.com/streamdal/streamdal/sdks/go/go_sdk.go:1151.13,1153.21 1 1 +github.com/streamdal/streamdal/sdks/go/go_sdk.go:1153.21,1155.3 1 1 +github.com/streamdal/streamdal/sdks/go/go_sdk.go:1158.2,1158.54 1 1 +github.com/streamdal/streamdal/sdks/go/go_sdk.go:1158.54,1161.94 2 1 +github.com/streamdal/streamdal/sdks/go/go_sdk.go:1161.94,1163.4 1 0 +github.com/streamdal/streamdal/sdks/go/go_sdk.go:1165.3,1172.113 2 1 +github.com/streamdal/streamdal/sdks/go/go_sdk.go:1176.2,1176.32 1 1 +github.com/streamdal/streamdal/sdks/go/go_sdk.go:1176.32,1179.3 2 0 +github.com/streamdal/streamdal/sdks/go/go_sdk.go:1182.2,1182.75 1 1 +github.com/streamdal/streamdal/sdks/go/go_sdk.go:1182.75,1188.3 2 1 +github.com/streamdal/streamdal/sdks/go/go_sdk.go:1188.8,1188.78 1 1 +github.com/streamdal/streamdal/sdks/go/go_sdk.go:1188.78,1194.3 2 1 +github.com/streamdal/streamdal/sdks/go/go_sdk.go:1196.2,1199.20 2 1 +github.com/streamdal/streamdal/sdks/go/go_sdk.go:1202.89,1203.36 1 0 +github.com/streamdal/streamdal/sdks/go/go_sdk.go:1203.36,1205.3 1 0 +github.com/streamdal/streamdal/sdks/go/go_sdk.go:1207.2,1207.29 1 0 +github.com/streamdal/streamdal/sdks/go/go_sdk.go:1207.29,1208.27 1 0 +github.com/streamdal/streamdal/sdks/go/go_sdk.go:1208.27,1210.4 1 0 +github.com/streamdal/streamdal/sdks/go/go_sdk.go:1212.3,1212.23 1 0 +github.com/streamdal/streamdal/sdks/go/go_sdk.go:1224.127,1226.27 1 1 +github.com/streamdal/streamdal/sdks/go/go_sdk.go:1226.27,1228.3 1 0 +github.com/streamdal/streamdal/sdks/go/go_sdk.go:1231.2,1231.65 1 1 +github.com/streamdal/streamdal/sdks/go/go_sdk.go:1231.65,1234.3 2 0 +github.com/streamdal/streamdal/sdks/go/go_sdk.go:1236.2,1236.23 1 1 +github.com/streamdal/streamdal/sdks/go/go_sdk.go:1236.23,1243.36 3 1 +github.com/streamdal/streamdal/sdks/go/go_sdk.go:1244.60,1245.36 1 0 +github.com/streamdal/streamdal/sdks/go/go_sdk.go:1246.56,1247.32 1 1 +github.com/streamdal/streamdal/sdks/go/go_sdk.go:1248.11,1249.33 1 1 +github.com/streamdal/streamdal/sdks/go/go_sdk.go:1253.3,1253.38 1 1 +github.com/streamdal/streamdal/sdks/go/go_sdk.go:1253.38,1255.39 1 1 +github.com/streamdal/streamdal/sdks/go/go_sdk.go:1255.39,1257.5 1 1 +github.com/streamdal/streamdal/sdks/go/go_sdk.go:1257.10,1260.5 1 0 +github.com/streamdal/streamdal/sdks/go/go_sdk.go:1266.2,1266.17 1 1 +github.com/streamdal/streamdal/sdks/go/go_sdk.go:1266.17,1272.3 3 1 +github.com/streamdal/streamdal/sdks/go/go_sdk.go:1277.42,1278.22 1 1 +github.com/streamdal/streamdal/sdks/go/go_sdk.go:1278.22,1280.3 1 1 +github.com/streamdal/streamdal/sdks/go/go_sdk.go:1282.2,1282.26 1 0 +github.com/streamdal/streamdal/sdks/go/register.go:19.56,28.2 1 1 +github.com/streamdal/streamdal/sdks/go/register.go:30.60,40.41 3 1 +github.com/streamdal/streamdal/sdks/go/register.go:40.41,44.3 3 0 +github.com/streamdal/streamdal/sdks/go/register.go:45.2,58.16 4 1 +github.com/streamdal/streamdal/sdks/go/register.go:58.16,60.3 1 0 +github.com/streamdal/streamdal/sdks/go/register.go:62.2,64.27 2 1 +github.com/streamdal/streamdal/sdks/go/register.go:64.27,65.11 1 1 +github.com/streamdal/streamdal/sdks/go/register.go:65.11,68.4 2 1 +github.com/streamdal/streamdal/sdks/go/register.go:72.3,72.20 1 1 +github.com/streamdal/streamdal/sdks/go/register.go:72.20,75.53 2 0 +github.com/streamdal/streamdal/sdks/go/register.go:75.53,79.5 3 0 +github.com/streamdal/streamdal/sdks/go/register.go:81.4,84.18 3 0 +github.com/streamdal/streamdal/sdks/go/register.go:84.18,85.64 1 0 +github.com/streamdal/streamdal/sdks/go/register.go:85.64,91.6 4 0 +github.com/streamdal/streamdal/sdks/go/register.go:93.5,96.15 3 0 +github.com/streamdal/streamdal/sdks/go/register.go:99.4,106.40 3 0 +github.com/streamdal/streamdal/sdks/go/register.go:110.3,111.17 2 1 +github.com/streamdal/streamdal/sdks/go/register.go:111.17,115.55 1 1 +github.com/streamdal/streamdal/sdks/go/register.go:115.55,121.5 4 0 +github.com/streamdal/streamdal/sdks/go/register.go:123.4,123.75 1 1 +github.com/streamdal/streamdal/sdks/go/register.go:123.75,128.5 4 1 +github.com/streamdal/streamdal/sdks/go/register.go:131.4,134.65 2 0 +github.com/streamdal/streamdal/sdks/go/register.go:134.65,136.5 1 0 +github.com/streamdal/streamdal/sdks/go/register.go:136.10,136.68 1 0 +github.com/streamdal/streamdal/sdks/go/register.go:136.68,138.5 1 0 +github.com/streamdal/streamdal/sdks/go/register.go:138.10,140.5 1 0 +github.com/streamdal/streamdal/sdks/go/register.go:142.4,144.14 2 0 +github.com/streamdal/streamdal/sdks/go/register.go:149.3,151.64 2 1 +github.com/streamdal/streamdal/sdks/go/register.go:151.64,154.4 2 1 +github.com/streamdal/streamdal/sdks/go/register.go:156.3,156.13 1 0 +github.com/streamdal/streamdal/sdks/go/register.go:159.2,159.21 1 1 +github.com/streamdal/streamdal/sdks/go/register.go:159.21,163.3 1 0 +github.com/streamdal/streamdal/sdks/go/register.go:165.2,167.12 2 1 +github.com/streamdal/streamdal/sdks/go/register.go:170.83,171.16 1 1 +github.com/streamdal/streamdal/sdks/go/register.go:171.16,174.3 2 1 +github.com/streamdal/streamdal/sdks/go/register.go:176.2,176.31 1 1 +github.com/streamdal/streamdal/sdks/go/register.go:176.31,179.3 2 1 +github.com/streamdal/streamdal/sdks/go/register.go:181.2,181.77 1 1 +github.com/streamdal/streamdal/sdks/go/register.go:181.77,184.3 2 1 +github.com/streamdal/streamdal/sdks/go/register.go:186.2,188.28 2 1 +github.com/streamdal/streamdal/sdks/go/register.go:189.36,191.33 2 0 +github.com/streamdal/streamdal/sdks/go/register.go:192.26,194.44 2 0 +github.com/streamdal/streamdal/sdks/go/register.go:195.28,197.38 2 0 +github.com/streamdal/streamdal/sdks/go/register.go:198.39,200.49 2 0 +github.com/streamdal/streamdal/sdks/go/register.go:201.10,202.61 1 1 +github.com/streamdal/streamdal/sdks/go/register.go:205.2,205.12 1 1 +github.com/streamdal/streamdal/sdks/go/register.go:208.98,209.16 1 0 +github.com/streamdal/streamdal/sdks/go/register.go:209.16,211.3 1 0 +github.com/streamdal/streamdal/sdks/go/register.go:213.2,213.37 1 0 +github.com/streamdal/streamdal/sdks/go/register.go:213.37,215.3 1 0 +github.com/streamdal/streamdal/sdks/go/register.go:217.2,218.25 2 0 +github.com/streamdal/streamdal/sdks/go/register.go:218.25,221.3 2 0 +github.com/streamdal/streamdal/sdks/go/register.go:223.2,223.32 1 0 +github.com/streamdal/streamdal/sdks/go/register.go:223.32,226.3 2 0 +github.com/streamdal/streamdal/sdks/go/register.go:228.2,228.12 1 0 +github.com/streamdal/streamdal/sdks/go/register.go:231.85,234.17 2 0 +github.com/streamdal/streamdal/sdks/go/register.go:234.17,237.3 2 0 +github.com/streamdal/streamdal/sdks/go/register.go:239.2,239.30 1 0 +github.com/streamdal/streamdal/sdks/go/register.go:239.30,242.3 2 0 +github.com/streamdal/streamdal/sdks/go/register.go:244.2,248.32 3 0 +github.com/streamdal/streamdal/sdks/go/register.go:249.54,251.54 2 0 +github.com/streamdal/streamdal/sdks/go/register.go:252.53,254.53 2 0 +github.com/streamdal/streamdal/sdks/go/register.go:255.54,257.54 2 0 +github.com/streamdal/streamdal/sdks/go/register.go:258.55,260.55 2 0 +github.com/streamdal/streamdal/sdks/go/register.go:261.10,262.77 1 0 +github.com/streamdal/streamdal/sdks/go/register.go:265.2,265.12 1 0 +github.com/streamdal/streamdal/sdks/go/register.go:268.84,269.47 1 1 +github.com/streamdal/streamdal/sdks/go/register.go:269.47,271.3 1 0 +github.com/streamdal/streamdal/sdks/go/register.go:273.2,273.36 1 1 +github.com/streamdal/streamdal/sdks/go/register.go:273.36,274.51 1 1 +github.com/streamdal/streamdal/sdks/go/register.go:274.51,276.12 2 0 +github.com/streamdal/streamdal/sdks/go/register.go:279.3,279.19 1 1 +github.com/streamdal/streamdal/sdks/go/register.go:280.75,282.50 2 1 +github.com/streamdal/streamdal/sdks/go/register.go:283.41,285.29 2 1 +github.com/streamdal/streamdal/sdks/go/register.go:286.45,288.16 2 1 +github.com/streamdal/streamdal/sdks/go/register.go:289.11,291.12 2 0 +github.com/streamdal/streamdal/sdks/go/register.go:295.2,295.12 1 1 +github.com/streamdal/streamdal/sdks/go/register.go:298.80,299.16 1 1 +github.com/streamdal/streamdal/sdks/go/register.go:299.16,301.3 1 1 +github.com/streamdal/streamdal/sdks/go/register.go:303.2,303.58 1 1 +github.com/streamdal/streamdal/sdks/go/register.go:303.58,305.3 1 0 +github.com/streamdal/streamdal/sdks/go/register.go:307.2,307.52 1 1 +github.com/streamdal/streamdal/sdks/go/register.go:307.52,309.32 1 1 +github.com/streamdal/streamdal/sdks/go/register.go:309.32,311.11 2 0 +github.com/streamdal/streamdal/sdks/go/register.go:311.11,313.5 1 0 +github.com/streamdal/streamdal/sdks/go/register.go:315.4,315.36 1 0 +github.com/streamdal/streamdal/sdks/go/register.go:319.2,326.12 5 1 +github.com/streamdal/streamdal/sdks/go/schema.go:9.79,14.9 4 1 +github.com/streamdal/streamdal/sdks/go/schema.go:14.9,16.3 1 1 +github.com/streamdal/streamdal/sdks/go/schema.go:18.2,18.26 1 1 +github.com/streamdal/streamdal/sdks/go/schema.go:21.87,28.2 3 1 +github.com/streamdal/streamdal/sdks/go/schema.go:31.136,34.24 2 1 +github.com/streamdal/streamdal/sdks/go/schema.go:34.24,37.3 1 1 +github.com/streamdal/streamdal/sdks/go/schema.go:39.2,39.62 1 1 +github.com/streamdal/streamdal/sdks/go/schema.go:39.62,41.3 1 1 +github.com/streamdal/streamdal/sdks/go/schema.go:44.2,46.55 2 1 +github.com/streamdal/streamdal/sdks/go/schema.go:46.55,49.3 1 0 +github.com/streamdal/streamdal/sdks/go/schema.go:52.2,54.12 2 1 +github.com/streamdal/streamdal/sdks/go/schema.go:54.12,56.17 2 1 +github.com/streamdal/streamdal/sdks/go/schema.go:56.17,58.4 1 0 +github.com/streamdal/streamdal/sdks/go/schema.go:60.3,60.78 1 1 +github.com/streamdal/streamdal/sdks/go/schema.go:63.2,63.13 1 1 +github.com/streamdal/streamdal/sdks/go/tail.go:48.34,50.22 1 1 +github.com/streamdal/streamdal/sdks/go/tail.go:50.22,52.3 1 1 +github.com/streamdal/streamdal/sdks/go/tail.go:54.2,54.26 1 0 +github.com/streamdal/streamdal/sdks/go/tail.go:57.117,59.21 2 1 +github.com/streamdal/streamdal/sdks/go/tail.go:59.21,61.3 1 1 +github.com/streamdal/streamdal/sdks/go/tail.go:63.2,63.29 1 1 +github.com/streamdal/streamdal/sdks/go/tail.go:63.29,66.19 2 1 +github.com/streamdal/streamdal/sdks/go/tail.go:66.19,69.46 2 1 +github.com/streamdal/streamdal/sdks/go/tail.go:69.46,71.13 2 0 +github.com/streamdal/streamdal/sdks/go/tail.go:75.4,75.22 1 1 +github.com/streamdal/streamdal/sdks/go/tail.go:78.3,78.25 1 1 +github.com/streamdal/streamdal/sdks/go/tail.go:78.25,79.12 1 0 +github.com/streamdal/streamdal/sdks/go/tail.go:82.3,93.24 2 1 +github.com/streamdal/streamdal/sdks/go/tail.go:97.54,99.70 1 1 +github.com/streamdal/streamdal/sdks/go/tail.go:99.70,107.3 3 1 +github.com/streamdal/streamdal/sdks/go/tail.go:109.2,110.24 2 1 +github.com/streamdal/streamdal/sdks/go/tail.go:113.37,114.38 1 1 +github.com/streamdal/streamdal/sdks/go/tail.go:114.38,117.17 2 1 +github.com/streamdal/streamdal/sdks/go/tail.go:117.17,119.4 1 0 +github.com/streamdal/streamdal/sdks/go/tail.go:121.3,123.35 2 1 +github.com/streamdal/streamdal/sdks/go/tail.go:126.2,126.12 1 1 +github.com/streamdal/streamdal/sdks/go/tail.go:129.91,130.19 1 1 +github.com/streamdal/streamdal/sdks/go/tail.go:130.19,133.3 2 1 +github.com/streamdal/streamdal/sdks/go/tail.go:137.2,141.27 3 0 +github.com/streamdal/streamdal/sdks/go/tail.go:141.27,142.11 1 0 +github.com/streamdal/streamdal/sdks/go/tail.go:142.11,145.4 2 0 +github.com/streamdal/streamdal/sdks/go/tail.go:147.3,147.10 1 0 +github.com/streamdal/streamdal/sdks/go/tail.go:148.29,152.14 4 0 +github.com/streamdal/streamdal/sdks/go/tail.go:153.34,157.14 4 0 +github.com/streamdal/streamdal/sdks/go/tail.go:158.31,159.44 1 0 +github.com/streamdal/streamdal/sdks/go/tail.go:159.44,160.54 1 0 +github.com/streamdal/streamdal/sdks/go/tail.go:160.54,163.6 2 0 +github.com/streamdal/streamdal/sdks/go/tail.go:164.5,164.60 1 0 +github.com/streamdal/streamdal/sdks/go/tail.go:164.60,169.6 3 0 +github.com/streamdal/streamdal/sdks/go/tail.go:170.5,170.48 1 0 +github.com/streamdal/streamdal/sdks/go/tail.go:173.3,173.13 1 0 +github.com/streamdal/streamdal/sdks/go/tail.go:180.84,181.62 1 1 +github.com/streamdal/streamdal/sdks/go/tail.go:181.62,183.3 1 0 +github.com/streamdal/streamdal/sdks/go/tail.go:186.2,215.79 5 1 +github.com/streamdal/streamdal/sdks/go/tail.go:215.79,219.3 2 0 +github.com/streamdal/streamdal/sdks/go/tail.go:222.2,224.12 2 1 +github.com/streamdal/streamdal/sdks/go/tail.go:227.83,228.61 1 1 +github.com/streamdal/streamdal/sdks/go/tail.go:228.61,230.3 1 0 +github.com/streamdal/streamdal/sdks/go/tail.go:232.2,236.21 4 1 +github.com/streamdal/streamdal/sdks/go/tail.go:236.21,239.3 2 1 +github.com/streamdal/streamdal/sdks/go/tail.go:241.2,241.41 1 1 +github.com/streamdal/streamdal/sdks/go/tail.go:241.41,244.3 1 1 +github.com/streamdal/streamdal/sdks/go/tail.go:246.2,247.47 2 1 +github.com/streamdal/streamdal/sdks/go/tail.go:247.47,250.3 1 0 +github.com/streamdal/streamdal/sdks/go/tail.go:252.2,255.12 3 1 +github.com/streamdal/streamdal/sdks/go/tail.go:259.80,264.8 4 1 +github.com/streamdal/streamdal/sdks/go/tail.go:264.8,266.3 1 1 +github.com/streamdal/streamdal/sdks/go/tail.go:268.2,268.12 1 1 +github.com/streamdal/streamdal/sdks/go/tail.go:271.86,276.8 4 1 +github.com/streamdal/streamdal/sdks/go/tail.go:276.8,278.3 1 0 +github.com/streamdal/streamdal/sdks/go/tail.go:280.2,280.12 1 1 +github.com/streamdal/streamdal/sdks/go/tail.go:283.75,289.35 4 1 +github.com/streamdal/streamdal/sdks/go/tail.go:289.35,291.3 1 0 +github.com/streamdal/streamdal/sdks/go/tail.go:293.2,295.31 2 1 +github.com/streamdal/streamdal/sdks/go/tail.go:295.31,297.3 1 1 +github.com/streamdal/streamdal/sdks/go/tail.go:300.75,306.41 4 1 +github.com/streamdal/streamdal/sdks/go/tail.go:306.41,308.3 1 1 +github.com/streamdal/streamdal/sdks/go/tail.go:310.2,312.37 2 0 +github.com/streamdal/streamdal/sdks/go/tail.go:312.37,314.3 1 0 +github.com/streamdal/streamdal/sdks/go/tail.go:317.47,325.35 5 1 +github.com/streamdal/streamdal/sdks/go/tail.go:325.35,327.3 1 1 +github.com/streamdal/streamdal/sdks/go/tail.go:329.2,329.31 1 1 +github.com/streamdal/streamdal/sdks/go/tail.go:332.47,340.41 5 0 +github.com/streamdal/streamdal/sdks/go/tail.go:340.41,342.3 1 0 +github.com/streamdal/streamdal/sdks/go/tail.go:344.2,344.37 1 0 +github.com/streamdal/streamdal/sdks/go/tail.go:347.84,348.62 1 0 +github.com/streamdal/streamdal/sdks/go/tail.go:348.62,350.3 1 0 +github.com/streamdal/streamdal/sdks/go/tail.go:352.2,356.21 4 0 +github.com/streamdal/streamdal/sdks/go/tail.go:356.21,359.3 2 0 +github.com/streamdal/streamdal/sdks/go/tail.go:361.2,362.9 2 0 +github.com/streamdal/streamdal/sdks/go/tail.go:362.9,365.3 2 0 +github.com/streamdal/streamdal/sdks/go/tail.go:368.2,375.12 4 0 +github.com/streamdal/streamdal/sdks/go/tail.go:378.85,379.63 1 0 +github.com/streamdal/streamdal/sdks/go/tail.go:379.63,381.3 1 0 +github.com/streamdal/streamdal/sdks/go/tail.go:383.2,387.21 4 0 +github.com/streamdal/streamdal/sdks/go/tail.go:387.21,390.3 2 0 +github.com/streamdal/streamdal/sdks/go/tail.go:392.2,393.9 2 0 +github.com/streamdal/streamdal/sdks/go/tail.go:393.9,396.3 2 0 +github.com/streamdal/streamdal/sdks/go/tail.go:399.2,406.12 4 0 diff --git a/vendor/github.com/streamdal/streamdal/sdks/go/register.go b/vendor/github.com/streamdal/streamdal/sdks/go/register.go index 1f0fe2c31..72e928eca 100644 --- a/vendor/github.com/streamdal/streamdal/sdks/go/register.go +++ b/vendor/github.com/streamdal/streamdal/sdks/go/register.go @@ -9,6 +9,7 @@ import ( "github.com/pkg/errors" "github.com/relistan/go-director" + "github.com/streamdal/streamdal/libs/protos/build/go/protos" "github.com/streamdal/streamdal/libs/protos/build/go/protos/shared" @@ -19,7 +20,7 @@ func (s *Streamdal) genClientInfo() *protos.ClientInfo { return &protos.ClientInfo{ ClientType: protos.ClientType(s.config.ClientType), LibraryName: "go-sdk", - LibraryVersion: "0.1.32", + LibraryVersion: "0.1.36", Language: "go", Arch: runtime.GOARCH, Os: runtime.GOOS, @@ -194,6 +195,9 @@ func (s *Streamdal) handleCommand(ctx context.Context, cmd *protos.Command) erro case *protos.Command_Tail: s.config.Logger.Debug("Received tail command") err = s.handleTailCommand(ctx, cmd) + case *protos.Command_DeleteAudiences: + s.config.Logger.Debug("Received delete command") + err = s.handleDeleteAudiencesCommand(ctx, cmd) default: err = fmt.Errorf("unknown command type: %+v", cmd.Command) } @@ -201,6 +205,29 @@ func (s *Streamdal) handleCommand(ctx context.Context, cmd *protos.Command) erro return err } +func (s *Streamdal) handleDeleteAudiencesCommand(ctx context.Context, cmd *protos.Command) error { + if cmd == nil { + return errors.New("cmd cannot be nil") + } + + if cmd.GetDeleteAudiences() == nil { + return errors.New("cmd.delete_audiences cannot be nil") + } + + audiences := cmd.GetDeleteAudiences().GetAudiences() + if len(audiences) == 0 { + s.config.Logger.Debugf("Received delete command with empty audiences") + return nil + } + + for _, aud := range audiences { + s.deleteAudience(ctx, aud) + s.config.Logger.Debugf("Deleted audience '%s' from cache", audToStr(aud)) + } + + return nil +} + func (s *Streamdal) handleTailCommand(_ context.Context, cmd *protos.Command) error { tail := cmd.GetTail() diff --git a/vendor/github.com/xtgo/uuid/AUTHORS b/vendor/github.com/xtgo/uuid/AUTHORS deleted file mode 100644 index a6f045160..000000000 --- a/vendor/github.com/xtgo/uuid/AUTHORS +++ /dev/null @@ -1,5 +0,0 @@ -# This source file refers to The gocql Authors for copyright purposes. - -Christoph Hack -Jonathan Rudenberg -Thorsten von Eicken diff --git a/vendor/github.com/xtgo/uuid/LICENSE b/vendor/github.com/xtgo/uuid/LICENSE deleted file mode 100644 index 18d25f923..000000000 --- a/vendor/github.com/xtgo/uuid/LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -Copyright (c) 2012 The gocql Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/vendor/github.com/xtgo/uuid/uuid.go b/vendor/github.com/xtgo/uuid/uuid.go deleted file mode 100644 index a0fd7a5a5..000000000 --- a/vendor/github.com/xtgo/uuid/uuid.go +++ /dev/null @@ -1,204 +0,0 @@ -// Copyright (c) 2012 The gocql Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Package uuid can be used to generate and parse universally unique -// identifiers, a standardized format in the form of a 128 bit number. -// -// http://tools.ietf.org/html/rfc4122 -package uuid - -import ( - "crypto/rand" - "encoding/hex" - "errors" - "io" - "net" - "strconv" - "time" -) - -type UUID [16]byte - -var hardwareAddr []byte - -const ( - VariantNCSCompat = 0 - VariantIETF = 2 - VariantMicrosoft = 6 - VariantFuture = 7 -) - -func init() { - if interfaces, err := net.Interfaces(); err == nil { - for _, i := range interfaces { - if i.Flags&net.FlagLoopback == 0 && len(i.HardwareAddr) > 0 { - hardwareAddr = i.HardwareAddr - break - } - } - } - if hardwareAddr == nil { - // If we failed to obtain the MAC address of the current computer, - // we will use a randomly generated 6 byte sequence instead and set - // the multicast bit as recommended in RFC 4122. - hardwareAddr = make([]byte, 6) - _, err := io.ReadFull(rand.Reader, hardwareAddr) - if err != nil { - panic(err) - } - hardwareAddr[0] = hardwareAddr[0] | 0x01 - } -} - -// Parse parses a 32 digit hexadecimal number (that might contain hyphens) -// representing an UUID. -func Parse(input string) (UUID, error) { - var u UUID - j := 0 - for i := 0; i < len(input); i++ { - b := input[i] - switch { - default: - fallthrough - case j == 32: - goto err - case b == '-': - continue - case '0' <= b && b <= '9': - b -= '0' - case 'a' <= b && b <= 'f': - b -= 'a' - 10 - case 'A' <= b && b <= 'F': - b -= 'A' - 10 - } - u[j/2] |= b << byte(^j&1<<2) - j++ - } - if j == 32 { - return u, nil - } -err: - return UUID{}, errors.New("invalid UUID " + strconv.Quote(input)) -} - -// FromBytes converts a raw byte slice to an UUID. It will panic if the slice -// isn't exactly 16 bytes long. -func FromBytes(input []byte) UUID { - var u UUID - if len(input) != 16 { - panic("UUIDs must be exactly 16 bytes long") - } - copy(u[:], input) - return u -} - -// NewRandom generates a totally random UUID (version 4) as described in -// RFC 4122. -func NewRandom() UUID { - var u UUID - io.ReadFull(rand.Reader, u[:]) - u[6] &= 0x0F // clear version - u[6] |= 0x40 // set version to 4 (random uuid) - u[8] &= 0x3F // clear variant - u[8] |= 0x80 // set to IETF variant - return u -} - -var timeBase = time.Date(1582, time.October, 15, 0, 0, 0, 0, time.UTC).Unix() - -// NewTime generates a new time based UUID (version 1) as described in RFC -// 4122. This UUID contains the MAC address of the node that generated the -// UUID, a timestamp and a sequence number. -func NewTime() UUID { - var u UUID - - now := time.Now().In(time.UTC) - t := uint64(now.Unix()-timeBase)*10000000 + uint64(now.Nanosecond()/100) - u[0], u[1], u[2], u[3] = byte(t>>24), byte(t>>16), byte(t>>8), byte(t) - u[4], u[5] = byte(t>>40), byte(t>>32) - u[6], u[7] = byte(t>>56)&0x0F, byte(t>>48) - - var clockSeq [2]byte - io.ReadFull(rand.Reader, clockSeq[:]) - u[8] = clockSeq[1] - u[9] = clockSeq[0] - - copy(u[10:], hardwareAddr) - - u[6] |= 0x10 // set version to 1 (time based uuid) - u[8] &= 0x3F // clear variant - u[8] |= 0x80 // set to IETF variant - - return u -} - -// String returns the UUID in it's canonical form, a 32 digit hexadecimal -// number in the form of xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx. -func (u UUID) String() string { - buf := [36]byte{8: '-', 13: '-', 18: '-', 23: '-'} - hex.Encode(buf[0:], u[0:4]) - hex.Encode(buf[9:], u[4:6]) - hex.Encode(buf[14:], u[6:8]) - hex.Encode(buf[19:], u[8:10]) - hex.Encode(buf[24:], u[10:]) - return string(buf[:]) -} - -// Bytes returns the raw byte slice for this UUID. A UUID is always 128 bits -// (16 bytes) long. -func (u UUID) Bytes() []byte { - return u[:] -} - -// Variant returns the variant of this UUID. This package will only generate -// UUIDs in the IETF variant. -func (u UUID) Variant() int { - x := u[8] - switch byte(0) { - case x & 0x80: - return VariantNCSCompat - case x & 0x40: - return VariantIETF - case x & 0x20: - return VariantMicrosoft - } - return VariantFuture -} - -// Version extracts the version of this UUID variant. The RFC 4122 describes -// five kinds of UUIDs. -func (u UUID) Version() int { - return int(u[6] & 0xF0 >> 4) -} - -// Node extracts the MAC address of the node who generated this UUID. It will -// return nil if the UUID is not a time based UUID (version 1). -func (u UUID) Node() []byte { - if u.Version() != 1 { - return nil - } - return u[10:] -} - -// Timestamp extracts the timestamp information from a time based UUID -// (version 1). -func (u UUID) Timestamp() uint64 { - if u.Version() != 1 { - return 0 - } - return uint64(u[0])<<24 + uint64(u[1])<<16 + uint64(u[2])<<8 + - uint64(u[3]) + uint64(u[4])<<40 + uint64(u[5])<<32 + - uint64(u[7])<<48 + uint64(u[6]&0x0F)<<56 -} - -// Time is like Timestamp, except that it returns a time.Time. -func (u UUID) Time() time.Time { - t := u.Timestamp() - if t == 0 { - return time.Time{} - } - sec := t / 10000000 - nsec := t - sec - return time.Unix(int64(sec)+timeBase, int64(nsec)) -} diff --git a/vendor/modules.txt b/vendor/modules.txt index 6c1968094..5ec85714d 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -629,9 +629,6 @@ github.com/pierrec/lz4/v4/internal/xxh32 # github.com/pkg/errors v0.9.1 ## explicit github.com/pkg/errors -# github.com/posthog/posthog-go v0.0.0-20220817142604-0b0bbf0f9c0f -## explicit; go 1.15 -github.com/posthog/posthog-go # github.com/prometheus/client_golang v1.11.1 ## explicit; go 1.13 github.com/prometheus/client_golang/prometheus @@ -718,12 +715,12 @@ github.com/streadway/amqp # github.com/streamdal/pgoutput v0.3.3 ## explicit; go 1.15 github.com/streamdal/pgoutput -# github.com/streamdal/streamdal/libs/protos v0.1.57 +# github.com/streamdal/streamdal/libs/protos v0.1.58 ## explicit; go 1.20 github.com/streamdal/streamdal/libs/protos/build/go/protos github.com/streamdal/streamdal/libs/protos/build/go/protos/shared github.com/streamdal/streamdal/libs/protos/build/go/protos/steps -# github.com/streamdal/streamdal/sdks/go v0.1.32 +# github.com/streamdal/streamdal/sdks/go v0.1.36 ## explicit; go 1.19 github.com/streamdal/streamdal/sdks/go github.com/streamdal/streamdal/sdks/go/helper @@ -817,9 +814,6 @@ github.com/xdg/scram # github.com/xdg/stringprep v1.0.0 ## explicit github.com/xdg/stringprep -# github.com/xtgo/uuid v0.0.0-20140804021211-a0b114877d4c -## explicit -github.com/xtgo/uuid # github.com/youmark/pkcs8 v0.0.0-20181117223130-1be2e3e5546d ## explicit github.com/youmark/pkcs8