Documentation ¶
Overview ¶
Package parcel shows package status for UPS, Fedex and others
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FedEx ¶
type FedEx struct { HTTPClient *http.Client Key string Password string Account string Meter string }
FedEx holds settings for the FedEx API
type FedExResponse ¶
type FedExResponse struct { Response Body struct { TrackReply struct { HighestSeverity string `xml:"HighestSeverity"` Notifications []struct { Severity string Source string Code int Message string LocalizedMessage string } Version struct { ServiceID string Major int Intermediate int Minor int } CompletedTrackDetails struct { HighestSeverity string Notifications []struct { Severity string Source string Code int Message string LocalizedMessage string } DuplicateWaybill bool MoreData bool TrackDetails struct { TrackingNumber string TrackingNumberUniqueIdentifier string Notification struct { Severity string Source string Code int Message string LocalizedMessage string } StatusDetail struct { CreationTime string Code string Description string Location struct { StreetLines string City string StateOrProvinceCode string CountryCode string CountryName string Residential bool } AncillaryDetails []struct { Reason string ReasonDescription string } } CarrierCode string OperatingCompanyOrCarrierDescription string OtherIdentifiers []struct { PackageIdentifier struct { Type string Value string } } Service struct { Type string Description string ShortDescription string } PackageWeight struct { Units string Value float64 } ShipmentWeight struct { Units string Value float64 } Packaging string PackagingType string PackageSequenceNumber int PackageCount int SpecialHandlings []struct { Type string Description string PaymentType string } ShipTimestamp string ActualDeliveryTimestamp string DestinationAddress struct { StreetLines string City string StateOrProvinceCode string CountryCode string CountryName string Residential bool } ActualDeliveryAddress struct { StreetLines string City string StateOrProvinceCode string CountryCode string CountryName string Residential bool } DeliveryLocationType string DeliveryLocationDescription string DeliveryAttempts int DeliverySignatureName string TotalUniqueAddressCountInConsolidation int NotificationEventsAvailable string RedirectToHoldEligibility string Events []struct { Timestamp string EventType string EventDescription string StatusExceptionCode string StatusExceptionDescription string Address struct { StreetLines string City string StateOrProvinceCode string CountryCode string CountryName string Residential bool } ArrivalLocation string } } } } `xml:"TrackReply"` } `xml:"Body"` }
FedExResponse is FedEx's raw XML response
func (*FedExResponse) UnmarshalXML ¶
func (r *FedExResponse) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error
UnmarshalXML sets the Response fields
type Location ¶
type Location struct { City string `json:"city"` State string `json:"state"` Country string `json:"country"` }
Location is a location of an Update
type Response ¶
type Response struct { TrackingNumber string `json:"tracking_number"` Updates []Update `json:"updates"` Expected URL string `json:"url"` }
Response is a standardized response for tracking packages
type UPSResponse ¶
type UPSResponse struct { Response TrackResponse struct { Response struct { ResponseStatus struct { Code string `json:"Code"` Description string `json:"Description"` } `json:"ResponseStatus"` TransactionReference struct { CustomerContext string `json:"CustomerContext"` } `json:"TransactionReference"` } `json:"Response"` Shipment struct { InquiryNumber struct { Code string `json:"Code"` Description string `json:"Description"` Value string `json:"Value"` } `json:"InquiryNumber"` ShipperNumber string `json:"ShipperNumber"` ShipmentAddress []struct { Type struct { Code string `json:"Code"` Description string `json:"Description"` } `json:"Type"` Address struct { AddressLine interface{} `json:"AddressLine"` City string `json:"City"` StateProvinceCode string `json:"StateProvinceCode"` PostalCode string `json:"PostalCode"` CountryCode string `json:"CountryCode"` } `json:"Address"` } `json:"ShipmentAddress"` ShipmentWeight struct { UnitOfMeasurement struct { Code string `json:"Code"` } `json:"UnitOfMeasurement"` Weight string `json:"Weight"` } `json:"ShipmentWeight"` Service struct { Code string `json:"Code"` Description string `json:"Description"` } `json:"Service"` ReferenceNumber interface{} `json:"ReferenceNumber"` DeliveryDetail struct { Type struct { Code string `json:"Code"` Description string `json:"Description"` } `json:"Type"` Date string `json:"Date"` } `json:"DeliveryDetail"` Package struct { TrackingNumber string `json:"TrackingNumber"` PackageServiceOption struct { Type struct { Code string `json:"Code"` Description string `json:"Description"` } `json:"Type"` } `json:"PackageServiceOption"` Activity []struct { ActivityLocation struct { Address struct { City string `json:"City"` StateProvinceCode string `json:"StateProvinceCode"` CountryCode string `json:"CountryCode"` } `json:"Address"` } `json:"ActivityLocation"` Status struct { Type string `json:"Type"` Description string `json:"Description"` Code string `json:"Code"` } `json:"Status"` Date string `json:"Date"` Time string `json:"Time"` } `json:"Activity"` Message struct { Code string `json:"Code"` Description string `json:"Description"` } `json:"Message"` PackageWeight struct { UnitOfMeasurement struct { Code string `json:"Code"` } `json:"UnitOfMeasurement"` Weight string `json:"Weight"` } `json:"PackageWeight"` ReferenceNumber []struct { Code string `json:"Code"` Value string `json:"Value"` } `json:"ReferenceNumber"` } `json:"Package"` } `json:"Shipment"` Disclaimer string `json:"Disclaimer"` } `json:"TrackResponse"` }
UPSResponse is UPS's raw JSON response
func (*UPSResponse) UnmarshalJSON ¶
func (r *UPSResponse) UnmarshalJSON(b []byte) error
UnmarshalJSON sets the Response fields
type USPSResponse ¶
type USPSResponse struct { Response // contains filtered or unexported fields }
USPSResponse is USPS's raw XML response
func (*USPSResponse) UnmarshalXML ¶
func (r *USPSResponse) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error
UnmarshalXML sets the Response fields
Click to show internal directories.
Click to hide internal directories.