controller

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2022 License: MIT Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var MatchesProcess = &MatchesProcessor{
	list:    []ProcessMatches{},
	c:       sync.NewCond(&sync.Mutex{}),
	started: false,
}

MatchesProcess holts the process matches that should be processed in the background

Functions

func ErrorRes

func ErrorRes(c *fiber.Ctx, status int, err error) error

ErrorRes returns the error response

func FiberErrorHandler

func FiberErrorHandler(c *fiber.Ctx, err error) error

FiberErrorHandler handles errors in fiber In our case that means we change the errors from text to json

func InsertData

func InsertData(dbConn db.Connection) fiber.Handler

InsertData adds the profiles to every route

func Routes

func Routes(app *fiber.App, appVersion string, testing bool)

Routes defines the routes used

Types

type GetStatusResponse

type GetStatusResponse struct {
	Status     bool   `json:"status"`
	AppVersion string `json:"appVersion"`
}

GetStatusResponse contains the response data for the getStatus route

type IMap

type IMap map[string]interface{}

IMap is a wrapper around map[string]interface{} that's faster to use

type MatchesProcessor

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

MatchesProcessor is a struct that contains a list of matches to be processed in the background

To register a match to be processed call (*MatchesProcessor).AppendMatchesToProcess After calling the above (*MatchesProcessor).processMatches should automatically pick up the match and handle it

func (*MatchesProcessor) AppendMatchesToProcess

func (p *MatchesProcessor) AppendMatchesToProcess(args ProcessMatches)

AppendMatchesToProcess adds a list of matches to be processed by (*MatchesProcessor).processMatches

type ProcessMatches

type ProcessMatches struct {
	Debug            bool
	MatchedProfiles  []match.FoundMatch
	CV               models.CV
	Logger           log.Entry
	DBConn           db.Connection
	KeyID, RequestID primitive.ObjectID
	KeyName          string
}

ProcessMatches contains the content for processing a match

func (ProcessMatches) Process

func (args ProcessMatches) Process()

Process processes the matches made to a CV - notify the dashboard /events page about the new match - safe the matches of this reference number for analytics and for detecting duplicates - send emails with the matches or send http requests

type RouteDeleteSecretOkRes

type RouteDeleteSecretOkRes struct {
	Status string `json:"status"`
}

RouteDeleteSecretOkRes is the response for the route below

type RouteGetExampleExampleAttachmentPDFBody

type RouteGetExampleExampleAttachmentPDFBody struct {
	Options *models.PdfOptions `json:"options"`
}

RouteGetExampleExampleAttachmentPDFBody is the body data for the route below

type RouteGetProfilesCountRes

type RouteGetProfilesCountRes struct {
	// Total is the total number of profiles
	Total uint64 `json:"total"`
	// Usable is the number of profiles that can be used for matching
	Usable uint64 `json:"usable"`
}

RouteGetProfilesCountRes is the response for routeGetProfilesCount

type RouteScraperScanCVBody

type RouteScraperScanCVBody struct {
	CV    models.CV `json:"cv"`
	Debug bool      `json:"debug" jsonSchema:"hidden"`
}

RouteScraperScanCVBody is the request body of the routeScraperScanCV

type RouteScraperScanCVRes

type RouteScraperScanCVRes struct {
	Success bool `json:"success"`

	// Matches is only set if the debug property is set
	Matches []match.FoundMatch `json:"matches" jsonSchema:"hidden"`
}

RouteScraperScanCVRes contains the response data of routeScraperScanCV

type RouteUpdateOrCreateSecret

type RouteUpdateOrCreateSecret struct {
	Value          json.RawMessage             `json:"value"`
	ValueStructure models.SecretValueStructure `json:"valueStructure"`
	Description    string                      `json:"description"`
	EncryptionKey  string                      `json:"encryptionKey"`
}

RouteUpdateOrCreateSecret is the post data for the route below

type UpdateProfileReq

type UpdateProfileReq struct {
	Name            *string  `json:"name"`
	Active          *bool    `json:"active"`
	AllowedScrapers []string `` /* 183-byte string literal not displayed */

	MustDesiredProfession *bool                      `json:"mustDesiredProfession"`
	DesiredProfessions    []models.ProfileProfession `json:"desiredProfessions"`

	UpdateYearsSinceWork *struct {
		YearsSinceWork *int `json:"yearsSinceWork"`
	} `json:"updateYearsSinceWork"`

	MustExpProfession     *bool                      `json:"mustExpProfession"`
	ProfessionExperienced []models.ProfileProfession `json:"professionExperienced"`

	MustDriversLicense *bool                          `json:"mustDriversLicense"`
	DriversLicenses    []models.ProfileDriversLicense `json:"driversLicenses"`

	MustEducationFinished *bool                     `json:"mustEducationFinished"`
	MustEducation         *bool                     `json:"mustEducation"`
	YearsSinceEducation   *int                      `json:"yearsSinceEducation"`
	Educations            []models.ProfileEducation `json:"educations"`

	Zipcodes []models.ProfileDutchZipcode `json:"zipCodes"`

	OnMatch *models.ProfileOnMatch `json:"onMatch"`
}

UpdateProfileReq are all the fields that can be updated in a profile All the top level fields are optional and if null should not be updated

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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