-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Implement cacher and logger ports
- Loading branch information
1 parent
4b403a0
commit 4f8bce4
Showing
3 changed files
with
25 additions
and
0 deletions.
There are no files selected for viewing
Empty file.
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,13 @@ | ||
package ports | ||
|
||
import ( | ||
"context" | ||
"time" | ||
) | ||
|
||
type Cacher interface { | ||
Get(ctx context.Context, key string) ([]byte, error) | ||
Set(ctx context.Context, key string, val []byte, ttl time.Duration) error | ||
Delete(ctx context.Context, key string) error | ||
Flush(ctx context.Context) 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package ports | ||
|
||
import "io" | ||
|
||
type Logger interface { | ||
SetDebugLevel(dl bool) | ||
SetWriter(w io.Writer) | ||
Error(v ...any) | ||
Info(v ...any) | ||
Debug(v ...any) | ||
Panic(v ...any) | ||
} |