postgres

package
v0.0.0-...-dd4c408 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2025 License: AGPL-3.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PG

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

func New

func New(connStr string, logger util.Logger) (*PG, error)

func (*PG) AddEmployerCandidacyComment

func (p *PG) AddEmployerCandidacyComment(
	ctx context.Context,
	empCommentReq employer.AddEmployerCandidacyCommentRequest,
) (uuid.UUID, error)

func (*PG) AddHubCandidacyComment

func (p *PG) AddHubCandidacyComment(
	ctx context.Context,
	hubCommentReq hub.AddHubCandidacyCommentRequest,
) (uuid.UUID, error)

func (*PG) AddInterview

func (p *PG) AddInterview(
	ctx context.Context,
	req db.AddInterviewRequest,
) error

func (*PG) AddInterviewer

func (p *PG) AddInterviewer(
	ctx context.Context,
	addInterviewerReq db.AddInterviewerRequest,
) error

func (*PG) AddLocation

func (p *PG) AddLocation(
	ctx context.Context,
	addLocationRequest employer.AddLocationRequest,
) (uuid.UUID, error)

func (*PG) AddOfficialEmail

func (p *PG) AddOfficialEmail(req db.AddOfficialEmailReq) error

func (*PG) AddOpeningWatchers

func (p *PG) AddOpeningWatchers(
	ctx context.Context,
	addOpeningWatchersReq employer.AddOpeningWatchersRequest,
) error

func (*PG) AddOrgUser

func (p *PG) AddOrgUser(
	ctx context.Context,
	addOrgUserReq db.AddOrgUserReq,
) (orgUserID uuid.UUID, err error)

func (*PG) AddWorkHistory

func (p *PG) AddWorkHistory(
	ctx context.Context,
	req hub.AddWorkHistoryRequest,
) (string, error)

func (*PG) ApproveColleague

func (p *PG) ApproveColleague(ctx context.Context, handle string) error

func (*PG) AuthHubUser

func (p *PG) AuthHubUser(
	ctx context.Context,
	token string,
) (db.HubUserTO, error)

func (*PG) AuthOrgUser

func (p *PG) AuthOrgUser(
	ctx context.Context,
	sessionToken string,
) (db.OrgUserTO, error)

func (*PG) ChangeHubUserPassword

func (p *PG) ChangeHubUserPassword(
	ctx context.Context,
	hubUserID uuid.UUID,
	newPasswordHash string,
) error

func (*PG) ChangeOpeningState

func (p *PG) ChangeOpeningState(
	ctx context.Context,
	changeOpeningStateReq employer.ChangeOpeningStateRequest,
) error

func (*PG) ConnectColleague

func (p *PG) ConnectColleague(ctx context.Context, handle string) error

func (*PG) CreateApplication

func (p *PG) CreateApplication(
	ctx context.Context,
	req db.ApplyOpeningReq,
) error

func (*PG) CreateCostCenter

func (p *PG) CreateCostCenter(
	ctx context.Context,
	costCenterReq employer.AddCostCenterRequest,
) (uuid.UUID, error)

func (*PG) CreateHubUserToken

func (p *PG) CreateHubUserToken(
	ctx context.Context,
	tokenReq db.HubTokenReq,
) error

func (*PG) CreateOnboardEmail

func (p *PG) CreateOnboardEmail(
	ctx context.Context,
	onboardEmailInfo db.OnboardEmailInfo,
) error

func (*PG) CreateOpening

func (p *PG) CreateOpening(
	ctx context.Context,
	createOpeningReq employer.CreateOpeningRequest,
) (string, error)

func (*PG) CreateOrgUserToken

func (p *PG) CreateOrgUserToken(
	ctx context.Context,
	tokenReq db.EmployerTokenReq,
) error

func (*PG) DeQOnboard

func (p *PG) DeQOnboard(
	ctx context.Context,
) (*db.OnboardInfo, error)

func (*PG) DefunctCostCenter

func (p *PG) DefunctCostCenter(
	ctx context.Context,
	defunctCostCenterReq employer.DefunctCostCenterRequest,
) error

func (*PG) DefunctLocation

func (p *PG) DefunctLocation(
	ctx context.Context,
	defunctLocationReq employer.DefunctLocationRequest,
) error

func (*PG) DeleteOfficialEmail

func (p *PG) DeleteOfficialEmail(ctx context.Context, email string) error

func (*PG) DeleteWorkHistory

func (p *PG) DeleteWorkHistory(
	ctx context.Context,
	req hub.DeleteWorkHistoryRequest,
) error

func (*PG) DisableOrgUser

func (p *PG) DisableOrgUser(
	ctx context.Context,
	disableOrgUserRequest employer.DisableOrgUserRequest,
) error

func (*PG) EmployerRSVPInterview

func (p *PG) EmployerRSVPInterview(
	ctx context.Context,
	req common.RSVPInterviewRequest,
) error

func (*PG) EnableOrgUser

func (p *PG) EnableOrgUser(
	ctx context.Context,
	enableOrgUserReq db.EnableOrgUserReq,
) error

func (*PG) EndorseApplication

func (p *PG) EndorseApplication(
	ctx context.Context,
	endorseReq hub.EndorseApplicationRequest,
) error

func (*PG) FilterColleagues

func (p *PG) FilterColleagues(
	ctx context.Context,
	req hub.FilterColleaguesRequest,
) ([]hub.HubUserShort, error)

func (*PG) FilterEmployerCandidacyInfos

func (p *PG) FilterEmployerCandidacyInfos(
	ctx context.Context,
	request employer.FilterCandidacyInfosRequest,
) ([]employer.Candidacy, error)

func (*PG) FilterEmployers

func (p *PG) FilterEmployers(
	ctx context.Context,
	req hub.FilterEmployersRequest,
) ([]hub.HubEmployer, error)

func (*PG) FilterOpeningTags

func (p *PG) FilterOpeningTags(
	ctx context.Context,
	req common.FilterOpeningTagsRequest,
) ([]common.OpeningTag, error)

func (*PG) FilterOpenings

func (p *PG) FilterOpenings(
	ctx context.Context,
	filterOpeningsReq employer.FilterOpeningsRequest,
) ([]employer.OpeningInfo, error)

FilterOpenings filters openings based on the given criteria

func (*PG) FilterOrgUsers

func (p *PG) FilterOrgUsers(
	ctx context.Context,
	filterOrgUsersReq employer.FilterOrgUsersRequest,
) ([]employer.OrgUser, error)

func (*PG) FindHubOpenings

func (p *PG) FindHubOpenings(
	ctx context.Context,
	req *hub.FindHubOpeningsRequest,
) ([]hub.HubOpening, error)

func (*PG) GetApplication

func (p *PG) GetApplication(
	ctx context.Context,
	applicationID string,
) (employer.Application, error)

func (*PG) GetApplicationMailInfo

func (p *PG) GetApplicationMailInfo(
	c context.Context,
	applicationID string,
) (db.ApplicationMailInfo, error)

func (*PG) GetApplicationsForEmployer

func (p *PG) GetApplicationsForEmployer(
	c context.Context,
	req employer.GetApplicationsRequest,
) ([]employer.Application, error)

func (*PG) GetAssessment

func (p *PG) GetAssessment(
	ctx context.Context,
	req employer.GetAssessmentRequest,
) (employer.Assessment, error)

func (*PG) GetBio

func (p *PG) GetBio(ctx context.Context, handle string) (hub.Bio, error)

func (*PG) GetCCByName

func (p *PG) GetCCByName(
	ctx context.Context,
	getCCByNameReq employer.GetCostCenterRequest,
) (employer.CostCenter, error)

func (*PG) GetCandidateInfo

func (p *PG) GetCandidateInfo(
	ctx context.Context,
	candidacyID string,
) (db.CandidateInfo, error)

func (*PG) GetCostCenters

func (p *PG) GetCostCenters(
	ctx context.Context,
	costCentersList employer.GetCostCentersRequest,
) ([]employer.CostCenter, error)

func (*PG) GetDomainNames

func (p *PG) GetDomainNames(
	ctx context.Context,
	employerID uuid.UUID,
) ([]string, error)

func (*PG) GetEmployer

func (p *PG) GetEmployer(
	ctx context.Context,
	clientID string,
) (db.Employer, error)

func (*PG) GetEmployerByID

func (p *PG) GetEmployerByID(
	ctx context.Context,
	employerID uuid.UUID,
) (db.Employer, error)

func (*PG) GetEmployerCandidacyComments

func (p *PG) GetEmployerCandidacyComments(
	ctx context.Context,
	empGetCommentsReq common.GetCandidacyCommentsRequest,
) ([]common.CandidacyComment, error)

func (*PG) GetEmployerCandidacyInfo

func (p *PG) GetEmployerCandidacyInfo(
	ctx context.Context,
	getCandidacyInfoReq common.GetCandidacyInfoRequest,
) (employer.Candidacy, error)

func (*PG) GetEmployerViewBio

func (p *PG) GetEmployerViewBio(
	ctx context.Context,
	handle string,
) (employer.EmployerViewBio, error)

func (*PG) GetHubCandidacyComments

func (p *PG) GetHubCandidacyComments(
	ctx context.Context,
	hubGetCommentsReq common.GetCandidacyCommentsRequest,
) ([]common.CandidacyComment, error)

func (*PG) GetHubCandidacyInfo

func (p *PG) GetHubCandidacyInfo(
	ctx context.Context,
	getCandidacyInfoReq common.GetCandidacyInfoRequest,
) (hub.MyCandidacy, error)

func (*PG) GetHubInterviewsByCandidacy

func (p *PG) GetHubInterviewsByCandidacy(
	ctx context.Context,
	req hub.GetHubInterviewsByCandidacyRequest,
) ([]hub.HubInterview, error)

func (*PG) GetHubOpeningDetails

func (p *PG) GetHubOpeningDetails(
	ctx context.Context,
	req hub.GetHubOpeningDetailsRequest,
) (hub.HubOpeningDetails, error)

func (*PG) GetHubUserByEmail

func (p *PG) GetHubUserByEmail(
	ctx context.Context,
	email string,
) (db.HubUserTO, error)

func (*PG) GetHubUserByTFACreds

func (p *PG) GetHubUserByTFACreds(
	ctx context.Context,
	tfaToken string,
	tfaCode string,
) (db.HubUserTO, error)

func (*PG) GetHubUsersByHandles

func (p *PG) GetHubUsersByHandles(
	ctx context.Context,
	handles []common.Handle,
) ([]db.HubUserContact, error)

GetHubUsersByHandles gets the details of hub users by their handles

func (*PG) GetInterview

func (p *PG) GetInterview(
	ctx context.Context,
	interviewID string,
) (employer.EmployerInterview, error)

func (*PG) GetLocByName

func (p *PG) GetLocByName(
	ctx context.Context,
	getLocationReq employer.GetLocationRequest,
) (employer.Location, error)

func (*PG) GetLocations

func (p *PG) GetLocations(
	ctx context.Context,
	getLocationsReq employer.GetLocationsRequest,
) ([]employer.Location, error)

func (*PG) GetMyCandidacies

func (p *PG) GetMyCandidacies(
	ctx context.Context,
	getMyCandidaciesReq hub.MyCandidaciesRequest,
) ([]hub.MyCandidacy, error)

func (*PG) GetMyColleagueApprovals

func (p *PG) GetMyColleagueApprovals(
	ctx context.Context,
	req hub.MyColleagueApprovalsRequest,
) (hub.MyColleagueApprovals, error)

func (*PG) GetMyColleagueSeeks

func (p *PG) GetMyColleagueSeeks(
	ctx context.Context,
	req hub.MyColleagueSeeksRequest,
) (hub.MyColleagueSeeks, error)

func (*PG) GetMyEndorsementApprovals

func (p *PG) GetMyEndorsementApprovals(
	ctx context.Context,
	req hub.MyEndorseApprovalsRequest,
) (hub.MyEndorseApprovalsResponse, error)

func (*PG) GetMyHandle

func (p *PG) GetMyHandle(ctx context.Context) (string, error)

func (*PG) GetMyOfficialEmails

func (p *PG) GetMyOfficialEmails(
	ctx context.Context,
) ([]hub.OfficialEmail, error)

func (*PG) GetOfficialEmail

func (p *PG) GetOfficialEmail(
	ctx context.Context,
	email string,
) (*db.OfficialEmail, error)

func (*PG) GetOldestUnsentEmails

func (p *PG) GetOldestUnsentEmails(ctx context.Context) ([]db.Email, error)

func (*PG) GetOpening

func (p *PG) GetOpening(
	ctx context.Context,
	getOpeningReq employer.GetOpeningRequest,
) (employer.Opening, error)

func (*PG) GetOpeningWatchers

func (p *PG) GetOpeningWatchers(
	ctx context.Context,
	getOpeningWatchersReq employer.GetOpeningWatchersRequest,
) ([]employer.OrgUserShort, error)

GetOpeningWatchers gets the watchers of an opening

func (*PG) GetOrgUserAuth

func (p *PG) GetOrgUserAuth(
	ctx context.Context,
	orgUserCreds db.OrgUserCreds,
) (db.OrgUserAuth, error)

func (*PG) GetOrgUserByEmail

func (p *PG) GetOrgUserByEmail(
	ctx context.Context,
	email string,
) (db.OrgUserTO, error)

func (*PG) GetOrgUserByTFACreds

func (p *PG) GetOrgUserByTFACreds(
	ctx context.Context,
	tfaCode, tfaToken string,
) (db.OrgUserTO, error)

func (*PG) GetProfilePictureURL

func (p *PG) GetProfilePictureURL(
	ctx context.Context,
	handle string,
) (string, error)

GetProfilePictureURL returns the S3 URL of a user's profile picture

func (*PG) GetResumeDetails

func (p *PG) GetResumeDetails(
	ctx context.Context,
	request employer.GetResumeRequest,
) (db.ResumeDetails, error)

func (*PG) GetStaleFiles

func (p *PG) GetStaleFiles(
	ctx context.Context,
	limit int,
) ([]db.StaleFile, error)

GetStaleFiles retrieves a batch of unprocessed stale files

func (*PG) GetWatchersInfoByInterviewID

func (p *PG) GetWatchersInfoByInterviewID(
	ctx context.Context,
	interviewID string,
) (db.WatchersInfo, error)

func (*PG) HubRSVPInterview

func (p *PG) HubRSVPInterview(
	ctx context.Context,
	req hub.HubRSVPInterviewRequest,
) error

func (*PG) InitEmployerAndDomain

func (p *PG) InitEmployerAndDomain(
	ctx context.Context,
	employer db.Employer,
	domain db.Domain,
) error

func (*PG) InitEmployerTFA

func (p *PG) InitEmployerTFA(
	ctx context.Context,
	employerTFA db.EmployerTFA,
) error

func (*PG) InitHubUserPasswordReset

func (p *PG) InitHubUserPasswordReset(
	ctx context.Context,
	initPasswordResetReq db.HubUserInitPasswordReset,
) error

func (*PG) InitHubUserTFA

func (p *PG) InitHubUserTFA(
	ctx context.Context,
	tfa db.HubUserTFA,
) error

func (*PG) InviteHubUser

func (p *PG) InviteHubUser(
	ctx context.Context,
	inviteHubUserReq db.InviteHubUserReq,
) error

func (*PG) ListWorkHistory

func (p *PG) ListWorkHistory(
	ctx context.Context,
	req hub.ListWorkHistoryRequest,
) ([]hub.WorkHistory, error)

func (*PG) Logout

func (p *PG) Logout(ctx context.Context, token string) error

func (*PG) MarkFileCleaned

func (p *PG) MarkFileCleaned(
	ctx context.Context,
	fileID uuid.UUID,
	cleanedAt time.Time,
) error

MarkFileCleaned marks a file as cleaned in the database

func (*PG) MyApplications

func (p *PG) MyApplications(
	ctx context.Context,
	myApplicationsReq hub.MyApplicationsRequest,
) ([]hub.HubApplication, error)

func (*PG) OfferToCandidate

func (p *PG) OfferToCandidate(
	ctx context.Context,
	request db.OfferToCandidateReq,
) error

func (*PG) OnboardAdmin

func (p *PG) OnboardAdmin(
	ctx context.Context,
	onboardReq db.OnboardReq,
) error

func (*PG) OnboardHubUser

func (p *PG) OnboardHubUser(
	ctx context.Context,
	onboardHubUserReq db.OnboardHubUserReq,
) (string, error)

func (*PG) PruneOfficialEmailCodes

func (p *PG) PruneOfficialEmailCodes(ctx context.Context) error

func (*PG) PruneTokens

func (p *PG) PruneTokens(ctx context.Context) error

func (*PG) PutAssessment

func (p *PG) PutAssessment(
	ctx context.Context,
	req employer.PutAssessmentRequest,
) error

func (*PG) RejectApplication

func (p *PG) RejectApplication(
	ctx context.Context,
	rejectRequest db.RejectApplicationRequest,
) error

func (*PG) RejectColleague

func (p *PG) RejectColleague(ctx context.Context, handle string) error

func (*PG) RejectEndorsement

func (p *PG) RejectEndorsement(
	ctx context.Context,
	rejectReq hub.RejectEndorsementRequest,
) error

func (*PG) RemoveApplicationColorTag

func (p *PG) RemoveApplicationColorTag(
	ctx context.Context,
	req employer.RemoveApplicationColorTagRequest,
) error

func (*PG) RemoveInterviewer

func (p *PG) RemoveInterviewer(
	ctx context.Context,
	removeInterviewerReq db.RemoveInterviewerRequest,
) error

func (*PG) RemoveOpeningWatcher

func (p *PG) RemoveOpeningWatcher(
	ctx context.Context,
	removeOpeningWatcherReq employer.RemoveOpeningWatcherRequest,
) error

func (*PG) RenameCostCenter

func (p *PG) RenameCostCenter(
	ctx context.Context,
	renameCostCenterReq employer.RenameCostCenterRequest,
) error

func (*PG) RenameLocation

func (p *PG) RenameLocation(
	ctx context.Context,
	renameLocationReq employer.RenameLocationRequest,
) error

func (*PG) ResetHubUserPassword

func (p *PG) ResetHubUserPassword(
	ctx context.Context,
	hubUserPasswordReset db.HubUserPasswordReset,
) error

func (*PG) SetApplicationColorTag

func (p *PG) SetApplicationColorTag(
	ctx context.Context,
	req employer.SetApplicationColorTagRequest,
) error

func (*PG) ShortlistApplication

func (p *PG) ShortlistApplication(
	ctx context.Context,
	shortlistRequest db.ShortlistRequest,
) error

func (*PG) SignupOrgUser

func (p *PG) SignupOrgUser(
	ctx context.Context,
	signupOrgUserReq db.SignupOrgUserReq,
) error

func (*PG) UnlinkColleague

func (p *PG) UnlinkColleague(ctx context.Context, handle string) error

func (*PG) UpdateBio

func (p *PG) UpdateBio(ctx context.Context, bio hub.UpdateBioRequest) error

func (*PG) UpdateCostCenter

func (p *PG) UpdateCostCenter(
	ctx context.Context,
	updateCCReq employer.UpdateCostCenterRequest,
) error

func (*PG) UpdateEmailState

func (p *PG) UpdateEmailState(
	ctx context.Context,
	emailStateChange db.EmailStateChange,
) error

func (*PG) UpdateLocation

func (p *PG) UpdateLocation(
	ctx context.Context,
	updateLocationReq employer.UpdateLocationRequest,
) error

func (*PG) UpdateOfficialEmailVerificationCode

func (p *PG) UpdateOfficialEmailVerificationCode(
	ctx context.Context,
	req db.UpdateOfficialEmailVerificationCodeReq,
) error

func (*PG) UpdateOpening

func (pg *PG) UpdateOpening(
	ctx context.Context,
	updateOpeningReq employer.UpdateOpeningRequest,
) error

func (*PG) UpdateOrgUser

func (p *PG) UpdateOrgUser(
	ctx context.Context,
	updateOrgUserReq employer.UpdateOrgUserRequest,
) (uuid.UUID, error)

func (*PG) UpdateProfilePictureWithCleanup

func (p *PG) UpdateProfilePictureWithCleanup(
	ctx context.Context,
	hubUserID uuid.UUID,
	newPicturePath string,
) error

UpdateProfilePictureWithCleanup updates a user's profile picture URL and adds the old picture to stale_files if one exists. This is done in a single transaction. If newPicturePath is empty, the profile_picture_url will be set to NULL.

func (*PG) UpdateWorkHistory

func (p *PG) UpdateWorkHistory(
	ctx context.Context,
	req hub.UpdateWorkHistoryRequest,
) error

func (*PG) VerifyOfficialEmail

func (p *PG) VerifyOfficialEmail(
	ctx context.Context,
	email string,
	code string,
) error

func (*PG) WithdrawApplication

func (p *PG) WithdrawApplication(
	ctx context.Context,
	applicationID string,
) error

Jump to

Keyboard shortcuts

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