Discover Packages
github.com/bubblepost/go-bpost
package
module
Version:
v0.0.0-...-de065b9
Opens a new window with list of versions in this module.
Published: May 30, 2016
License: MIT
Opens a new window with license information.
Imports: 6
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
README Documentation Source Files go-bpost Index Constants Variables Functions Types type Address type Box type Client type Customer type OrderInfo type OrderLine type StateInfo type TrackingInfo NewClient(httpClient, url, id, passPhrase) (c) FetchOrder(ref) (c) FetchTracking(ref) (c) NewRequest(method, url, tracking, body)
README
¶
go-bpost
Go client to communicate with BPOST web services
Expand ▾
Collapse ▴
Documentation
¶
type Address struct {
Street string `xml:"streetName"`
Number string `xml:"number"`
Zip string `xml:"postalCode"`
City string `xml:"locality"`
CountryCode string `xml:"countryCode"`
}
type Box struct {
Sender Customer `xml:"sender"`
Receiver Customer `xml:"nationalBox>atHome>receiver"`
Status string `xml:"status"`
Barcode string `xml:"barcode"`
}
Client manages communication with the BPOST API.
NewClient returns a new BPOST API client.
FetchOrder retrieves a single order by BPOST reference.
FetchTracking retrieves a single order by BPOST barcode.
type Customer struct {
Name string `xml:"name"`
Company string `xml:"company"`
Email string `xml:"emailAddress"`
Address Address `xml:"address"`
}
type OrderInfo struct {
AccountID int `xml:"accountId"`
OrderReference string `xml:"reference"`
Box []Box `xml:"box"`
Status string `xml:"status"`
CostCenter string `xml:"costCenter"`
Orders []OrderLine `xml:"orderLines"`
}
type OrderLine struct {
Text string `xml:"text"`
Count int `xml:"nbOfItems"`
}
type StateInfo struct {
Time string `xml:"time"`
Code string `xml:"stateCode"`
Description string `xml:"stateDescription"`
}
type TrackingInfo struct {
ItemCode string `xml:"itemCode"`
CostCenter string `xml:"costCenter"`
StateInfo []StateInfo `xml:"stateInfo"`
}
Source Files
¶
Click to show internal directories.
Click to hide internal directories.