hhclient

package
v0.0.0-...-223e126 Latest Latest
Warning

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

Go to latest
Published: May 28, 2022 License: MIT Imports: 8 Imported by: 0

README

hh.ru client

API Documentation.

Documentation

Index

Constants

View Source
const (
	DefaultBaseURL = "https://api.hh.ru/"
)

Variables

This section is empty.

Functions

func TokenHTTPClient

func TokenHTTPClient(accessToken string) *http.Client

Types

type Client

type Client struct {
	BaseURL   *url.URL
	UserAgent string

	Me     *MeService
	Resume *ResumeService
}

func NewClient

func NewClient(token *oauth2.Token) *Client

type Company

type Company struct {
	Name        string `json:"company"`
	Position    string `json:"position"`
	Start       string `json:"start"`
	Description string `json:"description"`
}

type Me

type Me struct {
	ID          string `json:"id"`
	LastName    string `json:"last_name"`
	FirstName   string `json:"first_name"`
	MiddleName  string `json:"middle_name"`
	IsAdmin     bool   `json:"is_admin"`
	IsApplicant bool   `json:"is_applicant"`
	IsEmployer  bool   `json:"is_employer"`
	Email       string `json:"email"`
}

type MeService

type MeService service

func (*MeService) GetMe

func (m *MeService) GetMe() (*Me, error)

type Resume

type Resume struct {
	ID            string    `json:"id"`
	Title         string    `json:"title"`
	TotalViews    int       `json:"total_views"`
	NewViews      int       `json:"new_views"`
	URL           string    `json:"url"`
	LastName      string    `json:"last_name"`
	FirstName     string    `json:"first_name"`
	MiddleName    string    `json:"middle_name"`
	Age           int       `json:"age"`
	Experience    []Company `json:"experience"`
	NextPublishAt string    `json:"next_publish_at"`
}

type ResumeList

type ResumeList struct {
	Resumes []*Resume `json:"items"`
	Page    int       `json:"page"`
	PerPage int       `json:"per_page"`
	Pages   int       `json:"pages"`
	Found   int       `json:"found"`
}

type ResumeService

type ResumeService service

func (*ResumeService) EditResume

func (r *ResumeService) EditResume(resume *Resume) error

func (*ResumeService) ReadResume

func (r *ResumeService) ReadResume(resumeId string) (*Resume, error)

func (*ResumeService) ResumeMine

func (r *ResumeService) ResumeMine() ([]*Resume, error)

func (*ResumeService) ResumePublish

func (r *ResumeService) ResumePublish(resume *Resume) error

func (*ResumeService) ResumesStatus

func (r *ResumeService) ResumesStatus(resume *Resume) (*ResumeStatus, error)

type ResumeStatus

type ResumeStatus struct {
	Blocked            bool   `json:"blocked"`
	Finished           bool   `json:"finished"`
	CanPublishOrUpdate bool   `json:"can_publish_or_update"`
	PublishURL         string `json:"publish_url"`
}

type TokenTransport

type TokenTransport struct {
	AccessToken string
}

func (*TokenTransport) RoundTrip

func (t *TokenTransport) RoundTrip(req *http.Request) (*http.Response, error)

Jump to

Keyboard shortcuts

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