users

package
v0.0.0-...-8bc6207 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 16, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

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 NewStore

func NewStore(scope *gocb.Scope) *Store

NewStore creates a new store

func (*Store) AddUser

func (m *Store) AddUser(u *UserFull) error

func (*Store) DeleteUserFromEmail

func (m *Store) DeleteUserFromEmail(email string) error

func (*Store) DeleteUserFromId

func (m *Store) DeleteUserFromId(id uint64) error

func (*Store) EditUser

func (m *Store) EditUser(u *UserFull) error

func (*Store) GetUserByEmail

func (m *Store) GetUserByEmail(email string) (u User, err error)

GetUserByEmail returns basic user information to be used for other services.

func (*Store) GetUserById

func (m *Store) GetUserById(id uint64) (u User, err error)

GetUserByEmail returns basic user information to be used for other services.

func (*Store) GetUserFullByEmail

func (m *Store) GetUserFullByEmail(email string) (u UserFull, err error)

GetUserFullByEmail will return all user information to be used for profile and management.

func (*Store) GetUserFullById

func (m *Store) GetUserFullById(id uint64) (u UserFull, err error)

GetUserFullByEmail will return all user information to be used for profile and management.

func (*Store) ListAllUsers

func (m *Store) ListAllUsers() (u []User, err error)

ListAllUsers returns all users It doesn't return the full User object

func (*Store) ListContactUsers

func (m *Store) ListContactUsers() (u []User, err error)

func (*Store) ListTeamManagersUsers

func (m *Store) ListTeamManagersUsers(teamId uint64) (u []User, err error)

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL