mirror of
https://github.com/christianselig/apollo-backend
synced 2024-12-26 08:15:27 +00:00
Add golangci-lint
This commit is contained in:
parent
1249f54bf2
commit
2a5ad833eb
2 changed files with 39 additions and 0 deletions
2
.github/workflows/test.yml
vendored
2
.github/workflows/test.yml
vendored
|
@ -14,5 +14,7 @@ jobs:
|
|||
uses: actions/setup-go@v2
|
||||
with:
|
||||
go-version: ${{ matrix.go-version }}
|
||||
- name: Lint
|
||||
uses: golangci/golangci-lint-action@v2
|
||||
- name: Test
|
||||
run: go test ./... -v
|
||||
|
|
37
internal/domain/account.go
Normal file
37
internal/domain/account.go
Normal file
|
@ -0,0 +1,37 @@
|
|||
package domain
|
||||
|
||||
import "context"
|
||||
|
||||
// Account represents an account we need to periodically check in the notifications worker.
|
||||
type Account struct {
|
||||
ID int64
|
||||
|
||||
// Reddit information
|
||||
Username string
|
||||
AccountID string
|
||||
AccessToken string
|
||||
RefreshToken string
|
||||
ExpiresAt int64
|
||||
|
||||
// Tracking how far behind we are
|
||||
LastMessageID string
|
||||
LastCheckedAt float64
|
||||
}
|
||||
|
||||
// AccountRepository represents the account's repository contract
|
||||
type AccountRepository interface {
|
||||
GetByID(ctx context.Context, id int64) (Account, error)
|
||||
GetByRedditID(ctx context.Context, id string) (Account, error)
|
||||
|
||||
Update(ctx context.Context, ac *Account) error
|
||||
Create(ctx context.Context, ac *Account) error
|
||||
Delete(ctx context.Context, id int64) error
|
||||
}
|
||||
|
||||
// AccountUsecase represents the account's usecases
|
||||
type AccountUsecase interface {
|
||||
GetByID(ctx context.Context, id int64) (Account, error)
|
||||
GetByRedditID(ctx context.Context, id string) (Account, error)
|
||||
CreateOrUpdate(ctx context.Context, ac *Account) error
|
||||
Delete(ctx context.Context, id int64) error
|
||||
}
|
Loading…
Reference in a new issue