Documentation ¶
Index ¶
- func CheckAuthorization(token string) error
- func SetUpTeamTailorTest()
- func UnauthorizedError(status int) error
- type Authorization
- type Candidate
- type CandidateConverted
- type CandidateJSONApi
- type CandidateRequest
- type CandidateRequestResume
- type CandidateResumeConverted
- type CandidateResumeJSONApi
- type ErrorStruct
- type JA
- type JAAttributes
- type JACandidate
- type JACandidateData
- type JAData
- type JAJob
- type JAJobData
- type JARelationships
- type Job
- type JobApplication
- type Meta
- type MetaTags
- type Stage
- type TeamTailor
- func (t TeamTailor) CreateJobApplication(idjob string, idcand string) (JobApplication, error)
- func (t TeamTailor) GetAllJobs() ([]Job, error)
- func (t *TeamTailor) GetCandidate(id string) (Candidate, error)
- func (t *TeamTailor) GetCandidateByEmail(email string) (*Candidate, error)
- func (t *TeamTailor) GetCandidates() ([]*Candidate, error)
- func (t TeamTailor) GetFirstJobPage() ([]Job, error)
- func (t TeamTailor) GetJob(id string) (Job, error)
- func (t TeamTailor) GetJobApplicationStage(id string) (*Stage, error)
- func (t *TeamTailor) PostCandidate(c CandidateRequest) (*Candidate, error)
- func (t *TeamTailor) PostCandidateResume(c CandidateRequestResume) (*Candidate, error)
- func (t *TeamTailor) SetHeaders(r *http.Request)
- func (t *TeamTailor) UpdateCandidate(c Candidate) error
- type TeamTailorErrorResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckAuthorization ¶
CheckAuthorization checks token validity and if it has the correct permissions TODO: Also check if permissions are correct, right now it only checks Reads and not Write
func SetUpTeamTailorTest ¶
func SetUpTeamTailorTest()
func UnauthorizedError ¶
Types ¶
type Authorization ¶
type Candidate ¶
type Candidate struct { ID string `json:"-" jsonapi:"primary,candidates"` Email string `json:"email" jsonapi:"attr,email"` Connected bool `json:"connected" jsonapi:"attr,connected"` Created string `json:"created-at" jsonapi:"attr,created-at"` Firstname string `json:"first-name" jsonapi:"attr,first-name"` Lastname string `json:"last-name" jsonapi:"attr,last-name"` LinkedinUID string `json:"linkedin-uid" jsonapi:"attr,linkedin-uid"` LinkedinURL string `json:"linkedin-url" jsonapi:"attr,linkedin-url"` FacebookUID string `json:"facebook-id" jsonapi:"attr,facebook-id"` Phone string `json:"phone" jsonapi:"attr,phone"` Picture string `json:"picture" jsonapi:"attr,picture"` Pitch string `json:"pitch" jsonapi:"attr,pitch"` Sourced bool `json:"sourced" jsonapi:"attr,sourced"` Tags []string `json:"tags" jsonapi:"attr,tags"` UpdatedAt string `json:"updated-at" jsonapi:"attr,updated-at"` ReferringURL string `json:"referring-url" jsonapi:"attr,referring-url"` Resume string `json:"resume" jsonapi:"attr,resume"` Unsubscribed bool `json:"unsubscribed" jsonapi:"attr,unsubscribed"` }
func (*Candidate) SetToOneReferenceID ¶
JSON API INTERFACE FUNCTIONS
type CandidateConverted ¶
type CandidateConverted struct { Type string `json:"type"` Candidate *CandidateRequest `json:"attributes"` }
type CandidateJSONApi ¶
type CandidateJSONApi struct {
Data *CandidateConverted `json:"data"`
}
type CandidateRequest ¶
type CandidateRequest struct { Email string `json:"email" jsonapi:"attr, email"` Connected bool `json:"connected" jsonapi:"attr,connected"` Created time.Time `json:"created-at" jsonapi:"attr, created-at"` Firstname string `json:"first-name" jsonapi:"attr, first-name"` Lastname string `json:"last-name" jsonapi:"attr, last-name"` LinkedinUID string `json:"linkedin-uid" jsonapi:"attr, linkedin-uid"` LinkedinURL string `json:"linkedin-url" jsonapi:"attr, linkedin-url"` FacebookUID string `json:"facebook-id" jsonapi:"attr, facebook-id"` Phone string `json:"phone" jsonapi:"attr, phone"` Picture string `json:"picture" jsonapi:"attr, picture"` Pitch string `json:"pitch" jsonapi:"attr, pitch"` Sourced bool `json:"sourced" jsonapi:"attr, sourced"` Tags []string `json:"tags" jsonapi:"attr, tags"` UpdatedAt time.Time `json:"updated-at" jsonapi:"attr, updated-at"` }
func (CandidateRequest) GetID ¶
func (c CandidateRequest) GetID() string
type CandidateRequestResume ¶
type CandidateRequestResume struct { Email string `json:"email" jsonapi:"email"` Connected bool `json:"connected" jsonapi:"connected"` Created time.Time `json:"created-at" jsonapi:"created-at"` Firstname string `json:"first-name" jsonapi:"first-name"` Lastname string `json:"last-name" jsonapi:"last-name"` LinkedinUID string `json:"linkedin-uid" jsonapi:"linkedin-uid"` LinkedinURL string `json:"linkedin-url" jsonapi:"linkedin-url"` FacebookUID string `json:"facebook-id" jsonapi:"facebook-id"` Phone string `json:"phone" jsonapi:"phone"` Picture string `json:"picture" jsonapi:"picture"` Pitch string `json:"pitch" jsonapi:"pitch"` Resume string `json:"resume" jsonapi:"resume"` Sourced bool `json:"sourced" jsonapi:"sourced"` Tags []string `json:"tags" jsonapi:"tags"` UpdatedAt time.Time `json:"updated-at" jsonapi:"updated-at"` }
func (CandidateRequestResume) GetID ¶
func (c CandidateRequestResume) GetID() string
type CandidateResumeConverted ¶
type CandidateResumeConverted struct { Type string `json:"type"` Candidate *CandidateRequestResume `json:"attributes"` }
type CandidateResumeJSONApi ¶
type CandidateResumeJSONApi struct {
Data *CandidateResumeConverted `json:"data"`
}
type ErrorStruct ¶
func (ErrorStruct) Error ¶
func (e ErrorStruct) Error() string
type JAAttributes ¶
type JAAttributes struct {
Sourced bool `json:"sourced"`
}
type JACandidate ¶
type JACandidate struct {
Data JACandidateData `json:"data"`
}
type JACandidateData ¶
type JAData ¶
type JAData struct { Type string `json:"type"` Attributes JAAttributes `json:"attributes"` Relationships JARelationships `json:"relationships"` }
type JARelationships ¶
type JARelationships struct { Candidate JACandidate `json:"candidate"` Job JAJob `json:"job"` }
type Job ¶
type Job struct { ID string Type string `json:"type"` Body string `json:"body"` EndDate string `json:"end-date"` HumanStatus string `json:"human-status"` Internal bool `json:"internal"` Pinned bool `json:"pinned"` StartDate string `json:"start-date"` Status string `json:"status"` Title string `json:"title"` Tags []string `json:"tags"` Created string `json:"created-at"` }
TODO: Add picture which consists of substrings "standard" and "thumb" or "" if no picture for job
func (Job) SetToOneReferenceID ¶
type JobApplication ¶
type JobApplication struct { ID string Type string `json: "type"` Created string `json:"created-at"` CoverLetter string `json:"cover-letter"` UpdatedAt string `json:"updated-at"` RejectedAt string `json:"rejected-at"` ReferringSite string `json:"referring-site"` ReferringURL string `json:"referring-url"` Sourced bool `json:"sourced"` ChangedStateAt string `json:"changed-stage-at"` }
func (JobApplication) GetID ¶
func (ja JobApplication) GetID() string
func (JobApplication) GetName ¶
func (ja JobApplication) GetName() string
func (*JobApplication) SetID ¶
func (ja *JobApplication) SetID(ID string) error
func (JobApplication) SetToOneReferenceID ¶
func (ja JobApplication) SetToOneReferenceID(name, ID string) error
type Meta ¶
type Meta struct {
MetaTags *MetaTags `json:"meta"`
}
Meta is a wrapper for meta tags. Needed in order to Marshal()
type MetaTags ¶
MetaTags checks how many job objects and how many pages exist in the Teamtailor instance. Used if more than 30 jobs exist for a company.
type Stage ¶
type Stage struct { ID string `json:"-" jsonapi:"primary,stages"` Created string `json:"created-at" jsonapi:"attr,created-at"` UpdatedAt string `json:"updated-at" jsonapi:"attr,updated-at"` Name string `json:"name" jsonapi:"attr,name"` StageType string `json:"stage-type" jsonapi:"attr,stage-type"` JobApplicationID string `json:"job-application-id"` }
type TeamTailor ¶
type TeamTailor struct { APIHost string `json:"api-host" bson:"api-host"` Token string `json:"token" bson:"token"` APIversion string `json:"X-Api-Version" bson:"X-Api-Version"` HTTPClient *http.Client }
func NewTeamTailor ¶
func NewTeamTailor(authToken string) (TeamTailor, error)
Create TeamTailor instance
func (TeamTailor) CreateJobApplication ¶
func (t TeamTailor) CreateJobApplication(idjob string, idcand string) (JobApplication, error)
CreateJobApplication
func (TeamTailor) GetAllJobs ¶
func (t TeamTailor) GetAllJobs() ([]Job, error)
GetAllJobs returns all jobs for a company. Used if page count in Teamtailor is greater than one and multiple GET-requests are needed to get all jobs.
func (*TeamTailor) GetCandidate ¶
func (t *TeamTailor) GetCandidate(id string) (Candidate, error)
func GetCandidate
func (*TeamTailor) GetCandidateByEmail ¶
func (t *TeamTailor) GetCandidateByEmail(email string) (*Candidate, error)
func GetCandidateByEmail
func (*TeamTailor) GetCandidates ¶
func (t *TeamTailor) GetCandidates() ([]*Candidate, error)
func GetCandidates
func (TeamTailor) GetFirstJobPage ¶
func (t TeamTailor) GetFirstJobPage() ([]Job, error)
GetFirstJobPage fetches the 30 jobs that are on the first page of Teamtailor response. If there are more than 30 jobs to fetch from Teamtailor, use GetAllJobs().
func (TeamTailor) GetJobApplicationStage ¶
func (t TeamTailor) GetJobApplicationStage(id string) (*Stage, error)
GetJobApplicationStage returns the stage of a specific job application containing status in recruitment process
func (*TeamTailor) PostCandidate ¶
func (t *TeamTailor) PostCandidate(c CandidateRequest) (*Candidate, error)
PostCandidate creates and executes a POST-request to the TeamTailor API and returns the resposne body as a []byte
func (*TeamTailor) PostCandidateResume ¶
func (t *TeamTailor) PostCandidateResume(c CandidateRequestResume) (*Candidate, error)
PostCandidateResume executes POST-request with a signedURL to access a candidate's resume
func (*TeamTailor) UpdateCandidate ¶
func (t *TeamTailor) UpdateCandidate(c Candidate) error
type TeamTailorErrorResponse ¶
type TeamTailorErrorResponse struct { Errors []struct { Title string `json:"title"` Detail string `json:"detail"` Code string `json:"code"` Status string `json:"status"` } `json:"errors"` Meta struct { Texts struct { Prev string `json:"prev"` Next string `json:"next"` } `json:"texts"` } `json:"meta"` }