Documentation ¶
Overview ¶
Package laborstats provides programmatic access to the ILAB Sweat & Toil API (http://developer.dol.gov/others/sweat-and-toil/).
Index ¶
- Variables
- type APIError
- type AdvancementLevel
- type AdvancementLevelAPI
- type Country
- type CountryAPI
- type CountryData
- type CountryDataAPI
- type CountryGood
- type CountryGoodsAPI
- type CountryProfile
- type CountryProfileAPI
- type CountryStat
- type CountryStatsAPI
- type Good
- type GoodAPI
- type LaborStatsAPI
- func (api *LaborStatsAPI) AddFilter(filterName string, filterValue string) error
- func (api *LaborStatsAPI) QueryAdvancementLevel() ([]AdvancementLevel, error)
- func (api *LaborStatsAPI) QueryCountry() ([]Country, error)
- func (api *LaborStatsAPI) QueryCountryGoods() ([]CountryGood, error)
- func (api *LaborStatsAPI) QueryCountryProfile() ([]CountryProfile, error)
- func (api *LaborStatsAPI) QueryCountryStats() ([]CountryStat, error)
- func (api *LaborStatsAPI) QueryGood() ([]Good, error)
- func (api *LaborStatsAPI) QueryRegion() ([]Region, error)
- func (api *LaborStatsAPI) QuerySector() ([]Sector, error)
- func (api *LaborStatsAPI) QuerySuggestedActionArea() ([]SuggestedActionArea, error)
- func (api *LaborStatsAPI) QuerySuggestedActions() ([]SuggestedAction, error)
- type QueryFilters
- type QueryRunner
- type Region
- type RegionAPI
- type Sector
- type SectorAPI
- type SuggestedAction
- type SuggestedActionAPI
- type SuggestedActionArea
- type SuggestedActionAreaAPI
Constants ¶
This section is empty.
Variables ¶
var (
LaborStatsAPIError = errors.New("The API request returned an error.")
)
Functions ¶
This section is empty.
Types ¶
type APIError ¶
type APIError struct { Message string `json:"error"` // contains filtered or unexported fields }
APIError holds error information returned from an API request.
type AdvancementLevel ¶
type AdvancementLevelAPI ¶
type AdvancementLevelAPI LaborStatsAPI
type CountryAPI ¶
type CountryAPI LaborStatsAPI
type CountryData ¶
type CountryData struct { CountryProfileID int `json:"country_profile_id"` C138Ratified string `json:"c_138_ratified,omitempty"` C182Ratified string `json:"c_182_ratified,omitempty"` CRCRatificationStatus string `json:"convention_on_the_rights_of_th,omitempty"` CRCCSARatificationStatus string `json:"crc_commercial_sexual_exploita,omitempty"` CRCACRatificationStatus string `json:"crc_armed_conflict_ratified,omitempty"` PalermoRatificationStatus string `json:"palermo_ratified,omitempty"` MinWorkAgeStatus string `json:"minimum_age_for_work_establish,omitempty"` MinWorkAge string `json:"minimum_age_for_work,omitempty"` MinHazWorkAgeStatus string `json:"minimum_age_for_hazardous_work_established,omitempty"` MinHazWorkAge string `json:"minimum_age_for_hazardous_work,omitempty"` CompEdAgeStatus string `json:"compulsory_education_age_estab,omitempty"` CompEdAge string `json:"minimum_age_for_compulsory_edu",omitempty` FreePubEdStatus string `json:"free_public_education_establis,omitepty"` }
type CountryDataAPI ¶
type CountryDataAPI LaborStatsAPI
type CountryGood ¶
type CountryGoodsAPI ¶
type CountryGoodsAPI LaborStatsAPI
type CountryProfile ¶
type CountryProfileAPI ¶
type CountryProfileAPI LaborStatsAPI
type CountryStat ¶
type CountryStat struct { CountryProfileID int `json:"country_profile_id"` CWAgeRange string `json:"cws_age_range,omitempty"` CWPercent float64 `json:"cws_total_percentage_of_workin,omitempty"` CWPopulation int `json:"cws_total_working_population"` CWAgriculture float64 `json:"cws_agriculture,omitempty"` CWService float64 `json:"cws_services,omitempty"` CWIndustry float64 `json:"cws_industry,omitempty"` SchoolAttYear string `json:"esas_year,omitempty"` SchoolAttAgeRange string `json:"esas_age_range,omitempty"` SchoolAttPercent float64 `json:"esas_percentage,omitempty"` CWASYear string `json:"cwas_year,omitempty"` CWASAgeRange string `json:"cwas_age_range,omitempty"` CWASTotal float64 `json:"cwas_total,omitempty"` PCRYear string `json:"upcr_year,omitempty"` PCRRate float64 `json:"upcr_rate,omitempty"` }
type CountryStatsAPI ¶
type CountryStatsAPI LaborStatsAPI
type GoodAPI ¶
type GoodAPI LaborStatsAPI
type LaborStatsAPI ¶
type LaborStatsAPI struct { Debug bool Filters QueryFilters RawResponse []byte SecretKey string // contains filtered or unexported fields }
func NewLaborStatsAPI ¶
func NewLaborStatsAPI(secretKey string) *LaborStatsAPI
NewLaborStatsAPI configures and returns a new API instance.
func (*LaborStatsAPI) AddFilter ¶
func (api *LaborStatsAPI) AddFilter(filterName string, filterValue string) error
AddFilter adds a filter parameter to the API request. The currently available filters are "limit", "start_date", "end_date", and "order".
func (*LaborStatsAPI) QueryAdvancementLevel ¶
func (api *LaborStatsAPI) QueryAdvancementLevel() ([]AdvancementLevel, error)
QueryAdvancementLevel submits an API request against the AdvancementLevel endpoint.
func (*LaborStatsAPI) QueryCountry ¶
func (api *LaborStatsAPI) QueryCountry() ([]Country, error)
QueryCountry submits an API request against the Country endpoint.
func (*LaborStatsAPI) QueryCountryGoods ¶
func (api *LaborStatsAPI) QueryCountryGoods() ([]CountryGood, error)
QueryCountryGoods submits an API request against the Country Goods endpoint.
func (*LaborStatsAPI) QueryCountryProfile ¶
func (api *LaborStatsAPI) QueryCountryProfile() ([]CountryProfile, error)
QueryCountryProfile submits an API request against the Country Profile endpoint.
func (*LaborStatsAPI) QueryCountryStats ¶
func (api *LaborStatsAPI) QueryCountryStats() ([]CountryStat, error)
QueryCountryStats submits an API request against the Country Statistics endpoint.
func (*LaborStatsAPI) QueryGood ¶
func (api *LaborStatsAPI) QueryGood() ([]Good, error)
QueryGood submits an API request against the "Good" endpoint.
func (*LaborStatsAPI) QueryRegion ¶
func (api *LaborStatsAPI) QueryRegion() ([]Region, error)
QueryRegion submits an API request against the Region endpoint.
func (*LaborStatsAPI) QuerySector ¶
func (api *LaborStatsAPI) QuerySector() ([]Sector, error)
QuerySector submits an API request against the Sector endpoint.
func (*LaborStatsAPI) QuerySuggestedActionArea ¶
func (api *LaborStatsAPI) QuerySuggestedActionArea() ([]SuggestedActionArea, error)
QuerySuggestedActionArea submits an API request against the Suggested Action Area endpoint.
func (*LaborStatsAPI) QuerySuggestedActions ¶
func (api *LaborStatsAPI) QuerySuggestedActions() ([]SuggestedAction, error)
QuerySuggestedActions submits an API request against the Suggested Actions endpoint.
type QueryFilters ¶
type QueryRunner ¶
type QueryRunner interface {
// contains filtered or unexported methods
}
type RegionAPI ¶
type RegionAPI LaborStatsAPI
type SectorAPI ¶
type SectorAPI LaborStatsAPI
type SuggestedAction ¶
type SuggestedActionAPI ¶
type SuggestedActionAPI LaborStatsAPI
type SuggestedActionArea ¶
type SuggestedActionAreaAPI ¶
type SuggestedActionAreaAPI LaborStatsAPI