Skip to content

Commit

Permalink
First push
Browse files Browse the repository at this point in the history
  • Loading branch information
turbo124 committed Apr 22, 2020
1 parent 43cd49d commit 345f37a
Show file tree
Hide file tree
Showing 5 changed files with 114 additions and 10 deletions.
9 changes: 9 additions & 0 deletions config/collector.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?php

return [

'endpoint' => 'http://collector.test:8000',

'api_key' => '123456',

];
8 changes: 0 additions & 8 deletions config/config.php

This file was deleted.

76 changes: 75 additions & 1 deletion src/Collector.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,79 @@

class Collector
{
// Build your next great package.
private $config;

/**
* The Collector type
* - counter
* - histogram
* - gauge
*
* @var string
*
*/
private $type;

/**
* The Collector name
* @var string
*
*/
private $name;

private $generator;

public function __construct()
{
}

/**
* Create a collector message
*
* parameters
*
* @param [type] $config [description]
* @return [type] [description]
*/
public function create()
{
$this->generator = new Generator();

return $this;
}

public function setType(string $collector_type)
{
$this->type = $collector_type;

return $this;
}

public function setName(string $collector_name)
{
$this->name = $collector_name;

return $this;
}

public function getType()
{
return $this->type;
}

public function getName()
{
return $this->name;
}

public function inc()
{
$this->generator->increment($this);
}

public function dec()
{
$this->generator->decrement($this);
}

}
29 changes: 29 additions & 0 deletions src/Collector/Generator.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?php

namespace Turbo124\Collector\Collector;

use Turbo124\Collector\Collector;

class Generator
{

public function increment(Collector $collector)
{

}

public function decrement(Collector $collector)
{

}

private function endPoint()
{
return config('collector.endpoint');
}

private function apiKey()
{
return config('collect.api_key');
}
}
2 changes: 1 addition & 1 deletion src/CollectorServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public function boot()

if ($this->app->runningInConsole()) {
$this->publishes([
__DIR__.'/../config/config.php' => config_path('collector.php'),
__DIR__.'/../config/collector.php' => config_path('collector.php'),
], 'config');

// Publishing the views.
Expand Down

0 comments on commit 345f37a

Please sign in to comment.