-
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.
refactor: extract adapter interfaces into subpackage and assert them
The optional interfaces that can be implemented by an adapter are now located in the adapter/connector package. This allows the adapter implementations to import and assert that those interfaces are implemented.
- Loading branch information
1 parent
51f456d
commit cb38329
Showing
7 changed files
with
48 additions
and
26 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package connector | ||
|
||
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(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
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