mirror of
https://github.com/christianselig/apollo-backend
synced 2024-11-13 07:27:43 +00:00
26 lines
424 B
Go
26 lines
424 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
|
|
}
|