Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type CompanySanctioned ¶
type CompanySanctioned struct {
CompanyID string `dynamodbav:"company_id" json:"company_id"`
IsSanctioned bool `dynamodbav:"is_sanctioned" json:"is_sanctioned"`
}
CompanySanctioned data model (extracts OFAC sanctioned flag from the company)
type DBUser ¶
type DBUser struct {
UserID string `json:"user_id"`
UserExternalID string `json:"user_external_id"`
LFEmail string `json:"lf_email"`
Admin bool `json:"admin"`
LFUsername string `json:"lf_username"`
DateCreated string `json:"date_created"`
DateModified string `json:"date_modified"`
UserName string `json:"user_name"`
Version string `json:"version"`
UserEmails []string `json:"user_emails"`
UserGithubID string `json:"user_github_id"`
UserGithubUsername string `json:"user_github_username"`
UserGitlabID string `json:"user_gitlab_id"`
UserGitlabUsername string `json:"user_gitlab_username"`
UserCompanyID string `json:"user_company_id"`
Note string `json:"note"`
LFSub string `json:"lf_sub"`
}
DBUser data model
type Service ¶
type Service interface {
CreateUser(user *models.User, claUser *user.CLAUser) (*models.User, error)
Save(user *models.UserUpdate, claUser *user.CLAUser) (*models.User, error)
UpdateUser(userID string, updates map[string]interface{}) (*models.User, error)
Delete(userID string, claUser *user.CLAUser) error
GetUser(userID string) (*models.User, error)
GetUserByLFUserName(lfUserName string) (*models.User, error)
GetUserByUserName(userName string, fullMatch bool) (*models.User, error)
GetUserByEmail(userEmail string) (*models.User, error)
GetUsersByEmail(userEmail string) ([]*models.User, error)
GetUsersByLFEmail(userEmail string) ([]*models.User, error)
GetUserByGitHubID(gitHubID string) (*models.User, error)
GetUserByGitHubUsername(gitlabUsername string) (*models.User, error)
GetUserByGitlabID(gitHubID int) (*models.User, error)
GetUserByGitLabUsername(gitlabUsername string) (*models.User, error)
SearchUsers(field string, searchTerm string, fullMatch bool) (*models.Users, error)
UpdateUserCompanyID(userID, companyID, note string) error
ConvertUserModelToUserCompatModel(*models.User) (*models.UserCompat, error)
}
Service interface for users
func NewService ¶
func NewService(repo UserRepository, events events.Service) Service
NewService creates a new service
type UserEmails ¶
type UserEmails struct {
SS []string `json:"SS"`
}
type UserRepository ¶
type UserRepository interface {
CreateUser(user *models.User) (*models.User, error)
Save(user *models.UserUpdate) (*models.User, error)
UpdateUser(userID string, updates map[string]interface{}) (*models.User, error)
Delete(userID string) error
GetUser(userID string) (*models.User, error)
GetUserByLFUserName(lfUserName string) (*models.User, error)
GetUserByExternalID(userExternalID string) (*models.User, error)
GetUserByUserName(userName string, fullMatch bool) (*models.User, error)
GetUserByEmail(userEmail string) (*models.User, error)
GetUsersByLFEmail(userEmail string) ([]*models.User, error)
GetUserByGitHubID(gitHubID string) (*models.User, error)
GetUserByGitHubUsername(gitHubUsername string) (*models.User, error)
GetUserByGitlabID(gitlabID int) (*models.User, error)
GetUserByGitLabUsername(gitlabUsername string) (*models.User, error)
SearchUsers(searchField string, searchTerm string, fullMatch bool) (*models.Users, error)
UpdateUserCompanyID(userID, companyID, note string) error
GetUsersByEmail(userEmail string) ([]*models.User, error)
}
UserRepository interface defines the functions for the users repository
func NewRepository ¶
func NewRepository(awsSession *session.Session, stage string) UserRepository
NewRepository creates a new instance of the service
Click to show internal directories.
Click to hide internal directories.