Documentation
¶
Index ¶
- Constants
- type Store
- type StoreClient
- func (store *StoreClient) Connect() (*mongo.Client, context.Context, error)
- func (store *StoreClient) DeleteJobApplication(jobApplicationId uuid.UUID) error
- func (store *StoreClient) Disconnect(ctx context.Context, client *mongo.Client)
- func (store *StoreClient) GetCareerProfileByEmail(email string) (*types.CareerProfile, error)
- func (store *StoreClient) GetCareerProfileByID(profileId uuid.UUID) (*types.CareerProfile, error)
- func (store *StoreClient) GetJobApplicationByID(jobApplicationId uuid.UUID) (*types.JobApplication, error)
- func (store *StoreClient) GetJobApplications(profileId uuid.UUID) (*[]types.JobApplication, error)
- func (store *StoreClient) StoreAccessToken(profileId uuid.UUID, accessToken string, ipAddress string) (string, error)
- func (store *StoreClient) StoreCareerProfile(careerProfile *types.CareerProfile) (*types.CareerProfile, string, error)
- func (store *StoreClient) StoreJobApplication(jobApplicationRequest *types.JobApplication) (*types.JobApplication, string, error)
- func (store *StoreClient) ValidateAccessToken(profileId uuid.UUID, accessToken string, ipAddress string) (bool, error)
Constants ¶
const ( JobApplicationSubmission = 0 JobApplicationInterview = 1 JobApplicationAssessment = 2 JobApplicationOffer = 3 JobApplicationCompletion = 4 JobApplicationRejection = 5 )
const DateTimeFormat = "2006-01-02 15:04:05"
const TokenDuration = 7 * 24 * time.Hour
Set a token duration of 7 days
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Store ¶
type Store interface { Connect() (*mongo.Client, context.Context, error) Disconnect(ctx context.Context, client *mongo.Client) GetCareerProfileByEmail(email string) (*types.CareerProfile, error) GetCareerProfileByID(profileId uuid.UUID) (*types.CareerProfile, error) StoreCareerProfile(careerProfileRequest *types.CareerProfile) (*types.CareerProfile, string, error) GetJobApplications(profileId uuid.UUID) (*[]types.JobApplication, error) GetJobApplicationByID(jobApplicationId uuid.UUID) (*types.JobApplication, error) StoreJobApplication(jobApplicationRequest *types.JobApplication) (*types.JobApplication, string, error) DeleteJobApplication(jobApplicationId uuid.UUID) error StoreAccessToken(profileId uuid.UUID, accessToken string, ipAddress string) (string, error) ValidateAccessToken(profileId uuid.UUID, accessToken string, ipAddress string) (bool, error) }
type StoreClient ¶
type StoreClient struct {
// contains filtered or unexported fields
}
func NewStore ¶
func NewStore() (*StoreClient, error)
NewStore returns a store client, which has methods to interact with MongoDB
func (*StoreClient) DeleteJobApplication ¶
func (store *StoreClient) DeleteJobApplication(jobApplicationId uuid.UUID) error
DeleteJobApplication retrieves an array of job applications from MongoDB
func (*StoreClient) Disconnect ¶
func (store *StoreClient) Disconnect(ctx context.Context, client *mongo.Client)
Disconnect closes the MongoDB connection for the given client
func (*StoreClient) GetCareerProfileByEmail ¶
func (store *StoreClient) GetCareerProfileByEmail(email string) (*types.CareerProfile, error)
GetCareerProfile retrieves a CareerProfile from MongoDB
func (*StoreClient) GetCareerProfileByID ¶
func (store *StoreClient) GetCareerProfileByID(profileId uuid.UUID) (*types.CareerProfile, error)
GetCareerProfileByID retrieves a CareerProfile using the ID from MongoDB
func (*StoreClient) GetJobApplicationByID ¶
func (store *StoreClient) GetJobApplicationByID(jobApplicationId uuid.UUID) (*types.JobApplication, error)
GetJobApplicationByID retrieves job application by ID from MongoDB
func (*StoreClient) GetJobApplications ¶
func (store *StoreClient) GetJobApplications(profileId uuid.UUID) (*[]types.JobApplication, error)
GetJobApplications retrieves an array of job applications from MongoDB
func (*StoreClient) StoreAccessToken ¶
func (store *StoreClient) StoreAccessToken(profileId uuid.UUID, accessToken string, ipAddress string) (string, error)
StoreAccessToken stores an access_token for a given profile_id
func (*StoreClient) StoreCareerProfile ¶
func (store *StoreClient) StoreCareerProfile(careerProfile *types.CareerProfile) (*types.CareerProfile, string, error)
StoreCareerProfile upserts a CareerProfile in MongoDB
func (*StoreClient) StoreJobApplication ¶
func (store *StoreClient) StoreJobApplication(jobApplicationRequest *types.JobApplication) (*types.JobApplication, string, error)
StoreJobApplication upserts a JobApplication in MongoDB
func (*StoreClient) ValidateAccessToken ¶
func (store *StoreClient) ValidateAccessToken(profileId uuid.UUID, accessToken string, ipAddress string) (bool, error)
ValidateAccessToken checks that a given access_token is valid for a profile_id