Skip to content

Commit

Permalink
Update db_layer.go
Browse files Browse the repository at this point in the history
  • Loading branch information
rustatian authored May 11, 2023
1 parent 6ddab1e commit 8c23d89
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions examples/sample_1/modules/db/db_layer.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import (
bolt "go.etcd.io/bbolt"
)

// SuperLogger represents logger module (modules/logger)
// you don't need to depend on the particular structures, instead, just declare interface in-place (like Go-way)
type SuperLogger interface {
SuperLogToStdOut(message string)
}
Expand All @@ -23,6 +25,7 @@ type Repository interface {
Select()
}

// Init the plugin
func (db *DB) Init(logger SuperLogger) error {
logger.SuperLogToStdOut("initializing DB")
db.logger = logger
Expand Down

0 comments on commit 8c23d89

Please sign in to comment.