cloudfunctions

package module
v0.0.0-...-fbd37c3 Latest Latest
Warning

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

Go to latest
Published: Jan 1, 2024 License: GPL-3.0 Imports: 20 Imported by: 0

README

Candidate Gmail Label Changes

candidate_gmail_label_changes is a handler for reacting to @SRC label changes (added or removed).

This cloud function serves many purposes:

  • Allows users to trigger actions based on adding or removing labels in Gmail
  • Allows SRC to sync state changes between the user's inbox and the user's data in the database
  • Centralized logic for reacting to label change events

SelfDoc

Auto-generated code documentation to make the repository easier to navigate and contribute to.

Last Updated: 2023-05-15

The candidate_gmail_label_changes directory is for a Cloud Function in Go that handles changes to Gmail labels for emails related to candidates in the Shared Recruiting Co. platform. It allows users to trigger actions based on adding or removing labels in Gmail, sync state changes between the user's inbox and the user's data in the database, and provides centralized logic for reacting to label change events. The directory includes the implementation file, a README file, and go module files.

Files
cloudfunction.go

This file contains the implementation of a Cloud Function in Go that handles changes to Gmail labels for emails related to candidates in the Shared Recruiting Co. platform. It imports various libraries for handling Gmail API requests, database queries, and machine learning services. The Cloud Function is triggered by Cloud Events and contains functions for handling added and removed labels. The file includes methods for parsing email, inserting data into a database, and checking if an email is a known recruiting outbound message. It also handles different Gmail label changes related to job opportunities and logs relevant information for each function. Error logging and capturing is implemented using Sentry.

go.mod

This file is the go module file for the candidate_gmail_label_changes cloud function. It lists the required dependencies and their versions.

go.sum

This file (go.sum) contains a list of dependencies and their specific versions, including cryptographic hashes, used in the cloudfunctions/candidate_gmail_label_changes directory and cloud function.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CloudFunction

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

func NewCloudFunction

func NewCloudFunction(ctx context.Context, payload schema.EmailLabelChanges) (*CloudFunction, error)

func (*CloudFunction) GetJobIDForMessage

func (cf *CloudFunction) GetJobIDForMessage(msg *gmail.Message) (*uuid.UUID, error)

GetJobIDForMessage gets the job ID for a gmail message TODO Right now we make multiple requests to handle both user_email_job and candidate_company_inbound We need to consolidate these into a single query

func (*CloudFunction) InsertRecruiterEmailIntoDB

func (cf *CloudFunction) InsertRecruiterEmailIntoDB(msg *gmail.Message, company, title, recruiter string) error

func (*CloudFunction) IsKnownRecruitingEmail

func (cf *CloudFunction) IsKnownRecruitingEmail(msg *gmail.Message) bool

func (*CloudFunction) ParseEmail

func (cf *CloudFunction) ParseEmail(msg *gmail.Message) (*ml.ParseJobResponse, error)

Jump to

Keyboard shortcuts

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