user

package
v1.0.7 Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2020 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewRepository

func NewRepository(db *sqlx.DB) repository

NewRepository creates a new user repository

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

type Provider

type Provider struct {
	ProviderUserID string
}

Provider data model

type Repository

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

Repository interface methods

type RepositoryDynamo

type RepositoryDynamo struct {
	Stage          string
	DynamoDBClient *dynamodb.DynamoDB
	// contains filtered or unexported fields
}

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(userID string) ([]string, error)

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

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)
}

RepositoryService interface methods

func NewDynamoRepository

func NewDynamoRepository(awsSession *session.Session, stage, senderEmailAddress 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 Repository) 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