mirror of
https://github.com/empayre/fleet.git
synced 2024-11-06 17:05:18 +00:00
4f4185372d
This is just to pass down the context to the datastore layer, it doesn't use it just yet - this will be in a follow-up PR.
26 lines
524 B
Go
26 lines
524 B
Go
package mock
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/fleetdm/fleet/v4/server/fleet"
|
|
)
|
|
|
|
func UserByEmailWithUser(u *fleet.User) UserByEmailFunc {
|
|
return func(ctx context.Context, email string) (*fleet.User, error) {
|
|
return u, nil
|
|
}
|
|
}
|
|
|
|
func UserWithEmailNotFound() UserByEmailFunc {
|
|
return func(ctx context.Context, email string) (*fleet.User, error) {
|
|
return nil, &Error{"not found"}
|
|
}
|
|
}
|
|
|
|
func UserWithID(u *fleet.User) UserByIDFunc {
|
|
return func(ctx context.Context, id uint) (*fleet.User, error) {
|
|
return u, nil
|
|
}
|
|
}
|