Documentation ¶
Overview ¶
Package common provides the shared functions and objects by all packages
Index ¶
Constants ¶
View Source
const VERSION string = "2.0.0-alpha"
VERSION is the version number of this package
Variables ¶
This section is empty.
Functions ¶
func BuildURLWithQueryString ¶
func BuildURLWithQueryString(uri string, params interface{}) (string, *error.AfterShipError)
BuildURLWithQueryString returns the url with query string
Types ¶
type AfterShipConf ¶
type AfterShipConf struct { APIKey string // Endpoint is the URL of AfterShip API, default 'https://api.aftership.com/v4' Endpoint string // UserAagentPrefix is the prefix of User-Agent in headers, default 'aftership-sdk-go' UserAagentPrefix string }
AfterShipConf is the config of AfterShip SDK client
type SingleTrackingOptionalParams ¶
type SingleTrackingOptionalParams struct { TrackingPostalCode string `url:"tracking_postal_code,omitempty" json:"tracking_postal_code,omitempty"` // The postal code of receiver's address. Required by some couriers, such asdeutsch-post TrackingShipDate string `url:"tracking_ship_date,omitempty" json:"tracking_ship_date,omitempty"` // Shipping date in YYYYMMDD format. Required by some couriers, such asdeutsch-post TrackingDestinationCountry string `url:"tracking_destination_country,omitempty" json:"tracking_destination_country,omitempty"` // Destination Country of the shipment for a specific courier. Required by some couriers, such aspostnl-3s TrackingAccountNumber string `url:"tracking_account_number,omitempty" json:"tracking_account_number,omitempty"` // Account number of the shipper for a specific courier. Required by some couriers, such asdynamic-logistics TrackingKey string `url:"tracking_key,omitempty" json:"tracking_key,omitempty"` // Key of the shipment for a specific courier. Required by some couriers, such assic-teliway TrackingOriginCountry string `url:"tracking_origin_country,omitempty" json:"tracking_origin_country,omitempty"` // Origin Country of the shipment for a specific courier. Required by some couriers, such asdhl TrackingState string `url:"tracking_state,omitempty" json:"tracking_state,omitempty"` // Located state of the shipment for a specific courier. Required by some couriers, such asstar-track-courier }
SingleTrackingOptionalParams is the optional parameters in single tracking query
type SingleTrackingParam ¶
type SingleTrackingParam struct { ID string Slug string TrackingNumber string OptionalParams *SingleTrackingOptionalParams }
SingleTrackingParam identifies a single tracking its mandatory to provide either Id or Slug and TrackingNumber both
func (*SingleTrackingParam) BuildTrackingURL ¶
func (param *SingleTrackingParam) BuildTrackingURL(path string, subPath string) (string, *error.AfterShipError)
BuildTrackingURL returns the tracking URL
Click to show internal directories.
Click to hide internal directories.