utils

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2025 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddRandomQueryParams

func AddRandomQueryParams(baseURL string) string

AddRandomQueryParams adds random query parameters to a URL to avoid caching

func ExtractNumericValue

func ExtractNumericValue(salaryStr string) int

ExtractNumericValue extracts numeric value from a salary string

func FetchTopPayingCompanies

func FetchTopPayingCompanies(debug bool) error

FetchTopPayingCompanies fetches the list of top paying companies from levels.fyi This is the main function that will be called by other parts of the code

func FetchTopPayingCompaniesFromLevelsFyi

func FetchTopPayingCompaniesFromLevelsFyi(debug bool) (map[string]bool, map[string]string, error)

FetchTopPayingCompaniesFromLevelsFyi fetches the list of top paying companies from levels.fyi using multiple URLs for different software engineering levels

func FindSalaryInText

func FindSalaryInText(text string) string

FindSalaryInText attempts to find salary information in text using common patterns

func FormatSalary

func FormatSalary(salary string) string

FormatSalary formats a numeric salary as a string with proper formatting

func GetSalaryFromLevelsFyi

func GetSalaryFromLevelsFyi(companyName string, debug bool) (string, error)

GetSalaryFromLevelsFyi fetches salary data from levels.fyi for a company

func IsTopPayingCompany

func IsTopPayingCompany(company string, debug bool) bool

IsTopPayingCompany checks if a company is in the list of top paying companies

func IsValidJob

func IsValidJob(title, location, titleKeyword string, remoteOnly, internshipsOnly, topPayOnly bool, company string) bool

IsValidJob checks if a job matches the search criteria

func IsValidSource

func IsValidSource(source string) bool

IsValidSource checks if the source is supported

func NormalizeCompanyName

func NormalizeCompanyName(name string) string

NormalizeCompanyName normalizes a company name for comparison

func NormalizeGreenhouseURL

func NormalizeGreenhouseURL(jobURL string) string

NormalizeGreenhouseURL normalizes Greenhouse job URLs

func PrintTopPayingCompanies

func PrintTopPayingCompanies(debug bool) error

PrintTopPayingCompanies prints the list of top paying companies

func ProcessWithLevelsFyi

func ProcessWithLevelsFyi(jobs []models.SalaryInfo, debug bool)

ProcessWithLevelsFyi enriches job listings with Levels.fyi salary data

func RandomString

func RandomString(n int) string

RandomString generates a random string of specified length

Types

type CacheData

type CacheData struct {
	Companies     map[string]bool   `json:"companies"`
	OriginalNames map[string]string `json:"original_names"`
	LastFetchTime time.Time         `json:"last_fetch_time"`
}

CacheData represents the structure of the cache file

Jump to

Keyboard shortcuts

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