| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
Kargo determines carrier of the tracking number barcode and checks if that tracking number barcode is valid by matching the format and calculating checksum validity. Feel free to create pull requests and issues.
Package supports
But more on the way
go get github.com/unicod3/kargoKargo's usage is pretty straight forward, supply a tracking number and get the Package struct
package main
import (
"fmt"
"github.com/unicod3/kargo"
)
func main() {
pkg, err := kargo.Identify("1Z999AA10123456784")
if err != nil {
fmt.Println(err)
}
var trackingNumber string = pkg.TrackingNumber
var carrier string = pkg.Carrier
var isValid bool = pkg.IsValid
fmt.Printf("Tracking Number: %v, Carrier: %v, Is Valid: %t",
trackingNumber, carrier, isValid)
}Output: Tracking Number: 1Z999AA10123456784, Carrier: UPS, Is Valid: true
For more examples please check out the test files.
You can run tests with standard test tool of Go:
go test -v Version 1.1.2
Version 1.0.1
Version 1.0.0
GNU General Public License v3.0 - see LICENSE for more details
| Back | FazBrowse Home | New Git URL |