Add IAM scaffold modules
This commit is contained in:
20
iam/internal/repo/user_store.go
Normal file
20
iam/internal/repo/user_store.go
Normal file
@@ -0,0 +1,20 @@
|
||||
package repo
|
||||
|
||||
type User struct {
|
||||
ID int64
|
||||
Name string
|
||||
}
|
||||
|
||||
type UserStore interface {
|
||||
FindByID(id int64) (*User, error)
|
||||
}
|
||||
|
||||
type inMemoryUserStore struct{}
|
||||
|
||||
func NewInMemoryUserStore() UserStore {
|
||||
return &inMemoryUserStore{}
|
||||
}
|
||||
|
||||
func (s *inMemoryUserStore) FindByID(id int64) (*User, error) {
|
||||
return &User{ID: id, Name: "demo"}, nil
|
||||
}
|
||||
Reference in New Issue
Block a user