Documentation ¶
Overview ¶
errors.go
model.go
service.go
store.go
validate.go
Index ¶
- Variables
- type CreateInput
- type MockStore
- func (m *MockStore) All() ([]User, error)
- func (m *MockStore) ChangePassword(password string) error
- func (m *MockStore) CreateUser(u *User) error
- func (m *MockStore) DeleteUser(id string) error
- func (m *MockStore) GetUser(id string) (*User, error)
- func (m *MockStore) UpdateUser(id string, email string, name string) (*User, error)
- type Service
- type Store
- type User
- type UserService
- func (s *UserService) All() ([]User, error)
- func (s *UserService) ChangePassword(id string, password, oldPassword string) error
- func (s *UserService) Create(input *CreateInput) (*User, error)
- func (s *UserService) Delete(id string) error
- func (s *UserService) Get(id string) (*User, error)
- func (s *UserService) GetByUsernamePassword(username, password string) (*User, error)
- func (s *UserService) Update(id string, name, email string) (*User, error)
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrIdRequired = errors.New("Id is required") ErrUsernameRequired = errors.New("Username is required") ErrPasswordRequired = errors.New("Password is required") ErrEmailRequired = errors.New("Email is required") ErrNameRequired = errors.New("Name is required") ErrOldPasswordRequired = errors.New("Old Password is required") ErrEmailInvalid = errors.New("Email is invalid") ErrOldPasswordInvalid = errors.New("Old Password is invalid") ErrInvalidUsername = errors.New("Invalid username") ErrInvalidPassword = errors.New("Invalid password") )
Functions ¶
This section is empty.
Types ¶
type CreateInput ¶
type MockStore ¶
func (*MockStore) ChangePassword ¶
func (*MockStore) CreateUser ¶
func (*MockStore) DeleteUser ¶
type Service ¶
type Service interface { Create(input *CreateInput) (*User, error) Get(id string) (*User, error) Delete(id string) error All() ([]User, error) Update(id, name, email string) (*User, error) ChangePassword(id, password, oldPassword string) error GetByUsernamePassword(username, password string) (*User, error) }
type UserService ¶
type UserService struct {
// contains filtered or unexported fields
}
func (*UserService) All ¶
func (s *UserService) All() ([]User, error)
func (*UserService) ChangePassword ¶
func (s *UserService) ChangePassword(id string, password, oldPassword string) error
func (*UserService) Create ¶
func (s *UserService) Create(input *CreateInput) (*User, error)
func (*UserService) Delete ¶
func (s *UserService) Delete(id string) error
func (*UserService) GetByUsernamePassword ¶
func (s *UserService) GetByUsernamePassword(username, password string) (*User, error)
Source Files ¶
Click to show internal directories.
Click to hide internal directories.