From 0af9787b5b75b25cef08b4acbb3083ea895e49ec Mon Sep 17 00:00:00 2001 From: Lennart Hengstmengel Date: Wed, 13 Oct 2021 15:13:02 +0200 Subject: [PATCH] fix: removed examples, moved to another repo --- composer.json | 1 - examples/assets/schemas/clickstream.avsc | 107 ----------------------- examples/src/Events/DemoEvent.php | 61 ------------- examples/src/Utils/ClientBuilder.php | 33 ------- examples/src/send.php | 24 ----- 5 files changed, 226 deletions(-) delete mode 100644 examples/assets/schemas/clickstream.avsc delete mode 100644 examples/src/Events/DemoEvent.php delete mode 100644 examples/src/Utils/ClientBuilder.php delete mode 100644 examples/src/send.php diff --git a/composer.json b/composer.json index 868df63..d3ab1b6 100644 --- a/composer.json +++ b/composer.json @@ -11,7 +11,6 @@ ], "autoload": { "psr-4": { - "Examples\\": "examples/src/", "Streammachine\\Driver\\": "src/", "Tests\\": "tests/" } diff --git a/examples/assets/schemas/clickstream.avsc b/examples/assets/schemas/clickstream.avsc deleted file mode 100644 index d615e05..0000000 --- a/examples/assets/schemas/clickstream.avsc +++ /dev/null @@ -1,107 +0,0 @@ -{ - "name": "ClickstreamEvent", - "type": "record", - "namespace": "io.streammachine.public_schemas.clickstream", - "strmSchemaId": "clickstream", - "fields": [ - { - "name": "strmMeta", - "type": { - "type": "record", - "name": "StrmMeta", - "fields": [ - { - "name": "eventContractRef", - "type": "string" - }, - { - "name": "nonce", - "type": [ - "null", - "int" - ], - "default": null - }, - { - "name": "timestamp", - "type": [ - "null", - "long" - ], - "default": null, - "logicalType": "date" - }, - { - "name": "keyLink", - "type": [ - "null", - "string" - ], - "default": null - }, - { - "name": "billingId", - "type": [ - "null", - "string" - ], - "default": null - }, - { - "name": "consentLevels", - "type": { - "type": "array", - "items": "int" - } - } - ] - }, - "doc": "TODO strmMeta will be nullable eventually, but Gateway functionality needs to be verified first!" - }, - { - "name": "producerSessionId", - "type": "string" - }, - { - "name": "url", - "type": "string" - }, - { - "name": "eventType", - "type": "string" - }, - { - "name": "referrer", - "type": "string" - }, - { - "name": "userAgent", - "type": "string" - }, - { - "name": "conversion", - "type": "int" - }, - { - "name": "customer", - "type": { - "name": "Customer", - "type": "record", - "fields": [ - { - "name": "id", - "type": "string" - } - ] - } - }, - { - "name": "abTests", - "type": { - "type": "array", - "items": "string" - } - } - ] -} - diff --git a/examples/src/Events/DemoEvent.php b/examples/src/Events/DemoEvent.php deleted file mode 100644 index 81f3534..0000000 --- a/examples/src/Events/DemoEvent.php +++ /dev/null @@ -1,61 +0,0 @@ - [ - 'eventContractRef' => $this->getStrmSchemaRef(), - 'nonce' => null, - 'timestamp' => null, - 'keyLink' => null, - 'billingId' => null, - 'consentLevels' => $this->consentLevels, - ], - 'producerSessionId' => $this->producerSessionId, - 'url' => $this->url, - 'eventType' => $this->eventType, - 'referrer' => $this->referrer, - 'userAgent' => $this->userAgent, - 'conversion' => $this->conversion, - 'customer' => $this->customer, - 'abTests' => $this->abTests, - ]; - } - - public function getStrmSchema(): AvroSchema - { - $json = file_get_contents(realpath(dirname(__FILE__)) . '/../../assets/schemas/clickstream.avsc'); - - return AvroSchema::parse($json); - } -} diff --git a/examples/src/Utils/ClientBuilder.php b/examples/src/Utils/ClientBuilder.php deleted file mode 100644 index cec474c..0000000 --- a/examples/src/Utils/ClientBuilder.php +++ /dev/null @@ -1,33 +0,0 @@ - "); - } - - return [$args[1], $args[2], $args[3]]; - } -} diff --git a/examples/src/send.php b/examples/src/send.php deleted file mode 100644 index 4d81683..0000000 --- a/examples/src/send.php +++ /dev/null @@ -1,24 +0,0 @@ -consentLevels = [0]; -$event->producerSessionId = 'producer'; -$event->url = 'https://www.google.com'; -$event->eventType = 'click'; -$event->referrer = 'foo'; -$event->userAgent = 'bar'; -$event->conversion = 0; -$event->customer = ['id' => 'bla']; -$event->abTests = ['a', 'b']; - -$sender->send($event, SerializationType::AVRO_BINARY);