goaftership

package module
v0.0.0-...-cd6a222 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 24, 2020 License: MIT Imports: 5 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

goaftership

AfterShip API Client in Go

For my own personal use, so it's going to be fairly incomplete.

You're welcome to use it if you want, though.

Documentation

Index

Constants

View Source
const ST_AttemptFail = StatusTag("AttemptFail")
View Source
const ST_AvailableForPickup = StatusTag("AvailableForPickup")
View Source
const ST_Delivered = StatusTag("Delivered")
View Source
const ST_Exception = StatusTag("Exception")
View Source
const ST_Expired = StatusTag("Expired")
View Source
const ST_InTransit = StatusTag("InTransit")
View Source
const ST_InfoReceived = StatusTag("InfoReceived")
View Source
const ST_OutForDelivery = StatusTag("OutForDelivery")
View Source
const ST_Pending = StatusTag("Pending")

Variables

This section is empty.

Functions

func PostNotification

func PostNotification(apiKey string, courierSlug string, trackingNumber string, emails []string, phones []string) error

func PostTracking

func PostTracking(apiKey string, courierSlug string, trackingNumber string) error

Types

type Checkpoint

type Checkpoint struct {
	Location string    `json:"location"`
	Message  string    `json:"message"`
	Tag      StatusTag `json:"tag"`
	Time     string    `json:"checkpoint_time"`
}

type EnvelopeData

type EnvelopeData struct {
	Tracking Tracking `json:"tracking"`
}

type EnvelopeMeta

type EnvelopeMeta struct {
	Code    int    `json:"code"`
	Message string `json:"message"`
	Type    string `json:"type"`
}

type NotificationRequest

type NotificationRequest struct {
	Emails []string `json:"emails"`
	SMSes  []string `json:"smses"`
}

type RequestEnvelope

type RequestEnvelope struct {
	Tracking     TrackingRequest     `json:"tracking,omitempty"`
	Notification NotificationRequest `json:"notification,omitempty"`
}

type ResponseEnvelope

type ResponseEnvelope struct {
	Meta EnvelopeMeta `json:"meta"`
	Data EnvelopeData `json:"data"`
}

type StatusTag

type StatusTag string

type Tracking

type Tracking struct {
	Id             string       `json:"id"`
	TrackingNumber string       `json:"tracking_number"`
	Slug           string       `json:"slug"`
	Checkpoints    []Checkpoint `json:"checkpoints"`
	Tag            StatusTag    `json:"tag"`
}

func GetTracking

func GetTracking(apiKey string, courierSlug string, trackingNumber string) (*Tracking, error)

type TrackingRequest

type TrackingRequest struct {
	TrackingNumber string `json:"tracking_number"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL