-
Notifications
You must be signed in to change notification settings - Fork 16
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 #116 from inovex/enforce-adapter-interface
Assert optional interfaces for adapter implementations
- Loading branch information
Showing
7 changed files
with
48 additions
and
27 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
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,24 @@ | ||
package port | ||
|
||
import ( | ||
"context" | ||
|
||
"github.com/charmbracelet/log" | ||
|
||
"github.com/inovex/CalendarSync/internal/auth" | ||
) | ||
|
||
// LogSetter can be implemented by a struct to allows injection of a logger instance | ||
type LogSetter interface { | ||
SetLogger(logger *log.Logger) | ||
} | ||
|
||
// Configurable is an interface which defines how arbitrary configuration data can be passed | ||
// to a struct which implements this interface. Clients should be configurable. | ||
type Configurable interface { | ||
Initialize(ctx context.Context, config map[string]interface{}) error | ||
} | ||
|
||
type OAuth2Adapter interface { | ||
SetupOauth2(ctx context.Context, credentials auth.Credentials, storage auth.Storage, bindPort uint) error | ||
} |
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