mirror of
https://github.com/christianselig/apollo-backend
synced 2024-11-10 22:17:44 +00:00
27 lines
462 B
Go
27 lines
462 B
Go
package domain
|
|
|
|
import (
|
|
"context"
|
|
"strings"
|
|
)
|
|
|
|
type User struct {
|
|
ID int64
|
|
LastCheckedAt float64
|
|
|
|
// Reddit information
|
|
UserID string
|
|
Name string
|
|
}
|
|
|
|
func (u *User) NormalizedName() string {
|
|
return strings.ToLower(u.Name)
|
|
}
|
|
|
|
type UserRepository interface {
|
|
GetByID(context.Context, int64) (User, error)
|
|
GetByName(context.Context, string) (User, error)
|
|
|
|
CreateOrUpdate(context.Context, *User) error
|
|
Delete(context.Context, int64) error
|
|
}
|