Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type City ¶
type City struct { CityID string `json:"city_id"` ProvinceID string `json:"province_id"` Province string `json:"province"` Type string `json:"type"` CityName string `json:"city_name"` PostalCode string `json:"postal_code"` }
City response
type Cost ¶
type Cost struct { OriginDetails City `json:"origin_details"` DestinationDetails City `json:"destination_details"` Providers []Provider `json:"results"` }
Cost
type CostWrapper ¶
type CostWrapper struct { Rajaongkir struct { Query struct { Origin string `json:"origin"` Destination string `json:"destination"` Weight int `json:"weight"` Courier string `json:"courier"` } `json:"query"` Status Status `json:"status"` OriginDetails City `json:"origin_details"` DestinationDetails City `json:"destination_details"` Results []Provider `json:"results"` } `json:"rajaongkir"` }
CostWrapper
type Provider ¶
type Provider struct { Code string `json:"code"` Name string `json:"name"` Costs []ServiceCost `json:"costs"` }
Provider response
type QueryRequest ¶
type QueryRequest struct { CityID string ProvinceID string Origin string Destination string Weight int Courier string }
QueryRequest set of query paramters
type RajaOngkirService ¶
type RajaOngkirService interface { GetProvince(QueryRequest) ServiceResult GetCity(QueryRequest) ServiceResult GetCost(QueryRequest) ServiceResult }
RajaOngkirService Generic abstraction for Raja Ongkir Service
type ServiceCost ¶
type ServiceCost struct { Service string `json:"service"` Description string `json:"description"` Cost []ServiceCostDetail `json:"cost"` }
ServiceCost response
type ServiceCostDetail ¶
type ServiceCostDetail struct { Value int `json:"value"` EstimatedDay string `json:"etd"` Note string `json:"note"` }
ServiceCostDetail response
Source Files ¶
Click to show internal directories.
Click to hide internal directories.