2022-03-26 17:41:17 +00:00
|
|
|
package dao
|
|
|
|
|
|
|
|
import (
|
|
|
|
"context"
|
|
|
|
)
|
|
|
|
|
|
|
|
type (
|
|
|
|
UserID int
|
|
|
|
|
|
|
|
User struct {
|
|
|
|
ID UserID
|
|
|
|
Name string
|
|
|
|
}
|
|
|
|
|
|
|
|
Dao interface {
|
|
|
|
Create(ctx context.Context, u *User) (UserID, error)
|
|
|
|
Update(ctx context.Context, u *User) error
|
|
|
|
Delete(ctx context.Context, id UserID) error
|
|
|
|
Lookup(ctx context.Context, id UserID) (User, error)
|
|
|
|
List(ctx context.Context) ([]User, error)
|
2022-04-13 15:07:35 +00:00
|
|
|
Close() error
|
2022-03-26 17:41:17 +00:00
|
|
|
}
|
|
|
|
)
|