-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from ardityawahyu/adding-influx-to-handler
adding influx client to handler option
- Loading branch information
Showing
10 changed files
with
75 additions
and
110 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package commons | ||
|
||
import ( | ||
"github.com/gomodule/redigo/redis" | ||
"github.com/kitabisa/buroq/config" | ||
"github.com/kitabisa/perkakas/v2/log" | ||
"github.com/kitabisa/perkakas/v2/metrics/influx" | ||
"gopkg.in/gorp.v2" | ||
) | ||
|
||
type Options struct { | ||
Config config.Provider | ||
DbMysql *gorp.DbMap | ||
DbPostgre *gorp.DbMap | ||
CachePool *redis.Pool | ||
Influx *influx.Client | ||
Logger *log.Logger | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,11 @@ | ||
package handler | ||
|
||
import ( | ||
"github.com/gomodule/redigo/redis" | ||
"github.com/kitabisa/buroq/config" | ||
"github.com/kitabisa/buroq/internal/app/commons" | ||
"github.com/kitabisa/buroq/internal/app/service" | ||
"github.com/kitabisa/perkakas/v2/log" | ||
"gopkg.in/gorp.v2" | ||
) | ||
|
||
type HandlerOption struct { | ||
Config config.Provider | ||
Services *service.Service | ||
DbMysql *gorp.DbMap | ||
DbPostgre *gorp.DbMap | ||
CachePool *redis.Pool | ||
Logger *log.Logger | ||
commons.Options | ||
*service.Services | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,17 @@ | ||
package service | ||
|
||
import ( | ||
"github.com/gomodule/redigo/redis" | ||
"github.com/kitabisa/buroq/internal/app/commons" | ||
"github.com/kitabisa/buroq/internal/app/repository" | ||
"github.com/kitabisa/perkakas/v2/log" | ||
"github.com/kitabisa/perkakas/v2/metrics/influx" | ||
"gopkg.in/gorp.v2" | ||
) | ||
|
||
// Option anything any service object needed | ||
type Option struct { | ||
DbMysql *gorp.DbMap | ||
DbPostgre *gorp.DbMap | ||
CachePool *redis.Pool | ||
Repo *repository.Repository | ||
Influx *influx.Client | ||
Logger *log.Logger | ||
commons.Options | ||
*repository.Repository | ||
} | ||
|
||
// Service all service object injected here | ||
type Service struct { | ||
type Services struct { | ||
HealthCheck IHealthCheck | ||
} |