Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Areas ¶
type Areas struct { Status string `json:"status"` Data struct { Title string `json:"title"` Content string `json:"content"` Rows []AreaRows `json:"rows"` } `json:"data"` }
Areas struct contains response from API GetAreas.
type AreasV3 ¶ added in v1.0.0
type AreasV3 struct { Metadata struct { Path string `json:"path"` HttpStatusCode int `json:"http_status_code"` HttpStatus string `json:"http_status"` Timestamp int `json:"timestamp"` } `json:"metadata"` Data []struct { Suburb struct { Id int `json:"id"` Name string `json:"name"` Lat float64 `json:"lat"` Lng float64 `json:"lng"` } `json:"suburb"` City struct { Id int `json:"id"` Name string `json:"name"` Lat float64 `json:"lat"` Lng float64 `json:"lng"` } `json:"city"` Province struct { Id int `json:"id"` Name string `json:"name"` Lat float64 `json:"lat"` Lng float64 `json:"lng"` } `json:"province"` Country struct { Id int `json:"id"` Name string `json:"name"` Code string `json:"code"` } `json:"country"` Id int `json:"id"` Name string `json:"name"` Postcode string `json:"postcode"` Lat float64 `json:"lat"` Lng float64 `json:"lng"` } `json:"data"` Pagination struct { CurrentPage int `json:"current_page"` CurrentElements int `json:"current_elements"` TotalPages int `json:"total_pages"` TotalElements int `json:"total_elements"` } `json:"pagination"` }
type Cities ¶
type Cities struct { Status string `json:"status"` Data struct { Title string `json:"title"` Content string `json:"content"` Rows []CityRows `json:"rows"` } `json:"data"` }
func GetCitiesWithContext ¶
GetCitiesWithContext retrieves cities based on province ID with context.
func GetOriginCities ¶
GetOriginCities retrieves provinces in which Shipper provides pickup service.
type CitiesV3 ¶ added in v1.0.0
type CitiesV3 struct { Metadata struct { Path string `json:"path"` HttpStatusCode int `json:"http_status_code"` HttpStatus string `json:"http_status"` Timestamp int `json:"timestamp"` } `json:"metadata"` Data []struct { Province struct { Id int `json:"id"` Name string `json:"name"` Lat float64 `json:"lat"` Lng float64 `json:"lng"` } `json:"province"` Country struct { Id int `json:"id"` Name string `json:"name"` Code string `json:"code"` } `json:"country"` Id int `json:"id"` Name string `json:"name"` Lat float64 `json:"lat"` Lng float64 `json:"lng"` } `json:"data"` Pagination struct { CurrentPage int `json:"current_page"` CurrentElements int `json:"current_elements"` TotalPages int `json:"total_pages"` TotalElements int `json:"total_elements"` } `json:"pagination"` }
type Coordinate ¶ added in v1.0.0
type Countries ¶
type Countries struct { Status string `json:"status"` Data struct { Title string `json:"title"` Content string `json:"content"` Rows []CountryRows `json:"rows"` } `json:"data"` }
func GetCountries ¶
GetCountries retrieves country data in a list.
type CountriesV3 ¶ added in v1.0.0
type CountriesV3 struct { Metadata struct { Path string `json:"path"` HttpStatusCode int `json:"http_status_code"` HttpStatus string `json:"http_status"` Timestamp int `json:"timestamp"` } `json:"metadata"` Data []struct { Id int `json:"id"` Name string `json:"name"` Code string `json:"code"` } `json:"data"` Pagination struct { CurrentPage int `json:"current_page"` CurrentElements int `json:"current_elements"` TotalPages int `json:"total_pages"` TotalElements int `json:"total_elements"` } `json:"pagination"` }
func (CountriesV3) ToCountries ¶ added in v1.0.0
func (r CountriesV3) ToCountries() Countries
type CountryRows ¶ added in v1.0.0
type Locations ¶
type Locations struct { Status string `json:"status"` Data struct { Title string `json:"title"` Content string `json:"content"` Rows []LocationsRows `json:"rows"` } `json:"data"` }
Locations struct contains response from API SearchLocations.
func SearchLocation ¶
SearchLocation retrieves every area, suburb, and city whose names include the submitted substring (including postcode).
type LocationsRows ¶ added in v1.0.0
type LocationsRows struct { AreaID int `json:"area_id"` AreaName string `json:"area_name"` AreaAlias string `json:"area_alias"` CityID int `json:"city_id"` CityName string `json:"city_name"` Label string `json:"label"` OrderList int `json:"order_list"` ProvinceID int `json:"province_id"` ProvinceName string `json:"province_name"` SuburbID int `json:"suburb_id"` SuburbName string `json:"suburb_name"` SuburbAlias string `json:"suburb_alias"` Value string `json:"value"` }
type LocationsV3 ¶ added in v1.0.0
type LocationsV3 struct { Metadata structs.Metadata `json:"metadata"` Data []struct { AdmLevel1 Level `json:"adm_level_1"` AdmLevel2 Level `json:"adm_level_2"` AdmLevel3 Level `json:"adm_level_3"` AdmLevel4 Level `json:"adm_level_4"` AdmLevel5 Level `json:"adm_level_5"` AdmLevelCur Level `json:"adm_level_cur"` DisplayTxt string `json:"display_txt"` Postcodes []string `json:"postcodes"` } `json:"data"` Pagination struct { CurrentPage int `json:"current_page"` CurrentElements int `json:"current_elements"` TotalPages int `json:"total_pages"` TotalElements int `json:"total_elements"` } `json:"pagination"` }
func (LocationsV3) ToLocations ¶ added in v1.0.0
func (r LocationsV3) ToLocations() Locations
type ProvinceRows ¶ added in v1.0.0
type Provinces ¶
type Provinces struct { Status string `json:"status"` Data struct { Title string `json:"title"` Content string `json:"content"` Rows []ProvinceRows `json:"rows"` } `json:"data"` }
Provinces struct contains response from API GetProvinces.
func GetProvinces ¶
GetProvinces retrieves all provinces in Indonesia in a list.
type ProvincesV3 ¶ added in v1.0.0
type ProvincesV3 struct { Metadata struct { Path string `json:"path"` HttpStatusCode int `json:"http_status_code"` HttpStatus string `json:"http_status"` Timestamp int `json:"timestamp"` } `json:"metadata"` Data []struct { Id int `json:"id"` Name string `json:"name"` Lat float64 `json:"lat"` Lng float64 `json:"lng"` Country struct { Id int `json:"id"` Name string `json:"name"` Code string `json:"code"` } `json:"country"` } `json:"data"` Pagination struct { CurrentPage int `json:"current_page"` CurrentElements int `json:"current_elements"` TotalPages int `json:"total_pages"` TotalElements int `json:"total_elements"` } `json:"pagination"` }
func (ProvincesV3) ToProvince ¶ added in v1.0.0
func (r ProvincesV3) ToProvince() Provinces
type Suburbs ¶
type Suburbs struct { Status string `json:"status"` Data struct { Title string `json:"title"` Content string `json:"content"` Rows []SuburbsRows `json:"rows"` } `json:"data"` }
Suburbs struct contains response from API GetSuburbs.
func GetSuburbs ¶
GetSuburbs retrieves suburbs based on submitted city ID.
type SuburbsRows ¶ added in v1.0.0
type SuburbsV3 ¶ added in v1.0.0
type SuburbsV3 struct { Metadata struct { Path string `json:"path"` HttpStatusCode int `json:"http_status_code"` HttpStatus string `json:"http_status"` Timestamp int `json:"timestamp"` } `json:"metadata"` Data []struct { Id int `json:"id"` Name string `json:"name"` Lat float64 `json:"lat"` Lng float64 `json:"lng"` City struct { Id int `json:"id"` Name string `json:"name"` Lat float64 `json:"lat"` Lng float64 `json:"lng"` } `json:"city"` Province struct { Id int `json:"id"` Name string `json:"name"` Lat float64 `json:"lat"` Lng float64 `json:"lng"` } `json:"province"` Country struct { Id int `json:"id"` Name string `json:"name"` Code string `json:"code"` } `json:"country"` } `json:"data"` Pagination struct { CurrentPage int `json:"current_page"` CurrentElements int `json:"current_elements"` TotalPages int `json:"total_pages"` TotalElements int `json:"total_elements"` } `json:"pagination"` }