user

package
v0.0.0-...-0c3f707 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CLAUser

type CLAUser struct {
	UserID         string
	Name           string
	Emails         []string
	LFEmail        string
	LFUsername     string
	LfidProvider   Provider
	GithubProvider Provider
	ProjectIDs     []string
	ClaIDs         []string
	CompanyIDs     []string
}

CLAUser data model

func (*CLAUser) IsAuthorizedForProject

func (claUser *CLAUser) IsAuthorizedForProject(projectSFID string) bool

IsAuthorizedForProject checks if user have access of the project {

type Provider

type Provider struct {
	ProviderUserID string
}

Provider data model

type Repository

type Repository struct {
	// contains filtered or unexported fields
}

Repository object/struct

func NewRepository

func NewRepository(db *sqlx.DB) Repository

NewRepository creates a new user repository

func (Repository) GetClaManagerCorporateClaIDs

func (repo Repository) GetClaManagerCorporateClaIDs(userID string) ([]string, error)

GetClaManagerCorporateClaIDs returns a list of CLA manager corporate CLAs associated with the specified user

func (Repository) GetUserAndProfilesByLFID

func (repo Repository) GetUserAndProfilesByLFID(lfidUsername string) (CLAUser, error)

GetUserAndProfilesByLFID get user profile by LFID

func (Repository) GetUserByGithubID

func (repo Repository) GetUserByGithubID(githubID string) (CLAUser, error)

GetUserByGithubID returns the user details based on the github ID

func (Repository) GetUserCompanyIDs

func (repo Repository) GetUserCompanyIDs(userID string) ([]string, error)

GetUserCompanyIDs returns a list of company IDs based on the user

func (Repository) GetUserProjectIDs

func (repo Repository) GetUserProjectIDs(userID string) ([]string, error)

GetUserProjectIDs get the user project ID's based on the specified user ID

type RepositoryDynamo

type RepositoryDynamo struct {
	Stage          string
	DynamoDBClient *dynamodb.DynamoDB
}

RepositoryDynamo data model

func (RepositoryDynamo) GetClaManagerCorporateClaIDs

func (repo RepositoryDynamo) GetClaManagerCorporateClaIDs(userID string) ([]string, error)

GetClaManagerCorporateClaIDs returns a list of corporate CLAs when provided the user ID

func (RepositoryDynamo) GetUser

func (repo RepositoryDynamo) GetUser(userID string) (User, error)

GetUser returns the user model when provided the user ID

func (RepositoryDynamo) GetUserAndProfilesByLFID

func (repo RepositoryDynamo) GetUserAndProfilesByLFID(lfidUsername string) (CLAUser, error)

GetUserAndProfilesByLFID returns the user profile by LFID

func (RepositoryDynamo) GetUserCompanyIDs

func (repo RepositoryDynamo) GetUserCompanyIDs(userID string) ([]string, error)

GetUserCompanyIDs returns a list of company IDs associated with the specified user

func (RepositoryDynamo) GetUserProjectIDs

func (repo RepositoryDynamo) GetUserProjectIDs(LfUsername string) ([]string, error)

GetUserProjectIDs returns a list of user's projects when provided the user id

func (RepositoryDynamo) SetCompanyID

func (repo RepositoryDynamo) SetCompanyID(userID, companyID string) (*User, error)

SetCompanyID sets the specified user's company id

type RepositoryInterface

type RepositoryInterface interface {
	GetUserAndProfilesByLFID(lfidUsername string) (CLAUser, error)
	GetUserProjectIDs(userID string) ([]string, error)
	GetClaManagerCorporateClaIDs(userID string) ([]string, error)
}

RepositoryInterface interface methods

type RepositoryService

type RepositoryService interface {
	GetUserAndProfilesByLFID(lfidUsername string) (CLAUser, error)
	GetUserProjectIDs(userID string) ([]string, error)
	GetClaManagerCorporateClaIDs(userID string) ([]string, error)
	GetUserCompanyIDs(userID string) ([]string, error)
	GetUser(userID string) (User, error)
	SetCompanyID(userID, companyID string) (*User, error)
}

RepositoryService interface methods

func NewDynamoRepository

func NewDynamoRepository(awsSession *session.Session, stage string) RepositoryService

NewDynamoRepository creates a new dynamo repository model

type Service

type Service interface {
	GetUserAndProfilesByLFID(lfidUsername string) (CLAUser, error)
	GetUserProjectIDs(userID string) ([]string, error)
	GetClaManagerCorporateClaIDs(userID string) ([]string, error)
}

Service interface defining the public functions

func NewService

func NewService(repo RepositoryInterface) Service

NewService creates a new user service

type User

type User struct {
	UserID             string   `json:"user_id"`
	LFEmail            string   `json:"lf_email"`
	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"`
	UserCompanyID      string   `json:"user_company_id"`
	UserGithubUsername string   `json:"user_github_username"`
}

User data model

Jump to

Keyboard shortcuts

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