Integration with EasyPost API for tracking shipments
NewClient("[your_api_key]")
c.GetTracker("[tracking_code]", "["carrier_name(optional)]")
it will create tracker in EasyPost and return pointer to Tracker and error. Error can be Payment required error, Unauthorized error or processing error
NewWebHookHandler([username], [secret])
it returns func(r *http.Request) (*Event, error)
which can be used in http.HandleFunc
r := http.Request{}
handler := NewWebHookHandler("username", "password")
e, err := handler(r)
res, err := e.GetResult()
switch res.(type) {
case *Tracker:
....
}