diff --git a/src/Storage/Device/Honeycomb.php b/src/Storage/Device/Honeycomb.php new file mode 100644 index 00000000..37d17cc6 --- /dev/null +++ b/src/Storage/Device/Honeycomb.php @@ -0,0 +1,57 @@ +headers['host'] = 's3.honeycomb-cloud.de/'.$bucket; + } + + /** + * @return string + */ + public function getName(): string + { + return 'Honeycomb Storage'; + } + + /** + * @return string + */ + public function getDescription(): string + { + return 'Honeycomb Storage'; + } + + /** + * @return string + */ + public function getType(): string + { + return Storage::DEVICE_HONEYCOMB; + } +} \ No newline at end of file diff --git a/src/Storage/Storage.php b/src/Storage/Storage.php index cabd18c8..40f28487 100644 --- a/src/Storage/Storage.php +++ b/src/Storage/Storage.php @@ -21,6 +21,8 @@ class Storage const DEVICE_LINODE = 'linode'; + const DEVICE_HONEYCOMB = 'honeycomb'; + /** * Devices. * @@ -121,4 +123,4 @@ public static function human(int $bytes, $decimals = 2, $system = 'metric') return sprintf("%.{$decimals}f%s", $bytes / pow($mod, $factor), $units[$system][$factor]); } -} +} \ No newline at end of file diff --git a/tests/Storage/Device/HoneycombTest.php b/tests/Storage/Device/HoneycombTest.php new file mode 100644 index 00000000..5944db5c --- /dev/null +++ b/tests/Storage/Device/HoneycombTest.php @@ -0,0 +1,34 @@ +root = '/root'; + $key = $_SERVER['HONEYCOMB_ACCESS_KEY'] ?? ''; + $secret = $_SERVER['HONEYCOMB_SECRET'] ?? ''; + $bucket = 'utopia-storage-tests'; + + $this->object = new Honeycomb($this->root, $key, $secret, $bucket, Honeycomb::EU_CENTRAL_1, HONEYCOMB::ACL_PRIVATE); + } + + protected function getAdapterName(): string + { + return 'Honeycomb Storage'; + } + + protected function getAdapterType(): string + { + return $this->object->getType(); + } + + protected function getAdapterDescription(): string + { + return 'Honeycomb Storage'; + } +} \ No newline at end of file