Documentation
¶
Index ¶
- Variables
- type User
- type UserProvider
- func (up *UserProvider) Create(ctx context.Context, u User) (User, error)
- func (up *UserProvider) Delete(ctx context.Context, id string) error
- func (up *UserProvider) Get(ctx context.Context, id string) (User, error)
- func (up UserProvider) List(ctx context.Context, offset, limit int) ([]User, error)
- func (up *UserProvider) Update(ctx context.Context, u User) error
- type UserRepo
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrAppNotFound = errors.New("not found") ErrAppNotImplemented = errors.New("not implemented") )
Functions ¶
This section is empty.
Types ¶
type UserProvider ¶ added in v0.9.0
type UserProvider struct {
// contains filtered or unexported fields
}
func NewUserProvider ¶ added in v0.9.0
func NewUserProvider(repo UserRepo) (*UserProvider, error)
func (*UserProvider) Delete ¶ added in v0.9.0
func (up *UserProvider) Delete(ctx context.Context, id string) error
type UserRepo ¶
type UserRepo interface {
CreateUser(ctx context.Context, u User) (User, error)
FindUserByID(ctx context.Context, id int) (User, error)
FindUserByName(ctx context.Context, name string) (User, error)
DeleteUser(ctx context.Context, id int) error
UpdateUser(ctx context.Context, u User) error
ListUsers(ctx context.Context, offset, limit int) ([]User, error)
}
Click to show internal directories.
Click to hide internal directories.