Documentation ¶
Index ¶
- type Store
- func (m *Store) AddUser(u *UserFull) error
- func (m *Store) DeleteUserFromEmail(email string) error
- func (m *Store) DeleteUserFromId(id uint64) error
- func (m *Store) EditUser(u *UserFull) error
- func (m *Store) GetUserByEmail(email string) (u User, err error)
- func (m *Store) GetUserById(id uint64) (u User, err error)
- func (m *Store) GetUserFullByEmail(email string) (u UserFull, err error)
- func (m *Store) GetUserFullById(id uint64) (u UserFull, err error)
- func (m *Store) ListAllUsers() (u []User, err error)
- func (m *Store) ListContactUsers() (u []User, err error)
- func (m *Store) ListTeamManagersUsers(teamId uint64) (u []User, err error)
- type User
- type UserFull
- type UserRepo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store contains our dependency
func (*Store) DeleteUserFromEmail ¶
func (*Store) DeleteUserFromId ¶
func (*Store) GetUserByEmail ¶
GetUserByEmail returns basic user information to be used for other services.
func (*Store) GetUserById ¶
GetUserByEmail returns basic user information to be used for other services.
func (*Store) GetUserFullByEmail ¶
GetUserFullByEmail will return all user information to be used for profile and management.
func (*Store) GetUserFullById ¶
GetUserFullByEmail will return all user information to be used for profile and management.
func (*Store) ListAllUsers ¶
ListAllUsers returns all users It doesn't return the full User object
func (*Store) ListContactUsers ¶
type User ¶
type User struct { Id uint64 `json:"id"` Email string `json:"email"` Name string `json:"name"` Phone string `json:"phone,omitempty"` Team uint64 `json:"team,omitempty"` Role string `json:"role"` FileName string `json:"file_name,omitempty"` }
User represents a user object to be used when not all data is required
type UserFull ¶
type UserFull struct { User Password string `json:"password,omitempty"` Temp string `json:"temp,omitempty"` Hash []uint8 `json:"hash,omitempty"` Salt []uint8 `json:"salt,omitempty"` LastLogin int64 `json:"last_login,omitempty"` CreatedAt int64 `json:"created_at,omitempty"` CreatedBy User `json:"created_by,omitempty"` UpdatedAt int64 `json:"updated_at,omitempty"` UpdatedBy User `json:"updated_by,omitempty"` DeletedAt int64 `json:"deleted_at,omitempty"` DeletedBy User `json:"deleted_by,omitempty"` }
UserFull represents a user and all columns
type UserRepo ¶
type UserRepo interface { GetUserByEmail(email string) (User, error) GetUserById(id uint64) (User, error) GetUserByEmailFull(email string) (UserFull, error) GetUserByIdFull(id uint64) (UserFull, error) ListAllUsers() ([]User, error) ListContactUsers() ([]User, error) ListTeamManagersUsers(teamId uint64) ([]User, error) AddUser(user *UserFull) error EditUser(user *UserFull) error DeleteUser(email string) error }
UserRepo defines all user interactions
Click to show internal directories.
Click to hide internal directories.