Skip to content

Commit

Permalink
feat: Implement cacher and logger ports
Browse files Browse the repository at this point in the history
  • Loading branch information
mehmetumit committed Oct 30, 2023
1 parent 4b403a0 commit 4f8bce4
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 0 deletions.
Empty file added internal/core/app/app.go
Empty file.
13 changes: 13 additions & 0 deletions internal/core/ports/cacher.go
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
}
12 changes: 12 additions & 0 deletions internal/core/ports/logger.go
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)
}

0 comments on commit 4f8bce4

Please sign in to comment.