Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type CarrierFactory ¶
type CarrierFactory interface { GetCarrierName() string GetPackage() *Package Match() bool Validate() bool }
CarrierFactory handles the validation of tracking number for carrier
type FedExExpress ¶
type FedExExpress struct {
*Package
}
FedExExpress defines a struct for Fedex Express packages
func NewFedExExpress ¶
func NewFedExExpress(p *Package) *FedExExpress
NewFedExExpress initializes a new FedExExpress struct with package value
func (*FedExExpress) GetCarrierName ¶
func (f *FedExExpress) GetCarrierName() string
GetCarrierName Implements the CarrierFactory interface method Retuns the name of carrier
func (*FedExExpress) GetPackage ¶
func (f *FedExExpress) GetPackage() *Package
GetPackage Implements the CarrierFactory interface method Returns the package that carrier holds
func (*FedExExpress) Match ¶
func (f *FedExExpress) Match() bool
Match Implements the CarrierFactory interface method Retuns the name of carrier struct with package value
func (*FedExExpress) Validate ¶
func (f *FedExExpress) Validate() bool
Validate Implements the CarrierFactory interface method Checks whether is a package belongs to that carrier
type FedExGround96 ¶
type FedExGround96 struct {
*Package
}
FedExGround96 defines a struct for Fedex Ground packages
func NewFedExGround96 ¶
func NewFedExGround96(p *Package) *FedExGround96
NewFedExGround96 initializes a new FedExGround96 struct with package value
func (*FedExGround96) GetCarrierName ¶
func (f *FedExGround96) GetCarrierName() string
GetCarrierName Implements the CarrierFactory interface method Retuns the name of carrier
func (*FedExGround96) GetPackage ¶
func (f *FedExGround96) GetPackage() *Package
GetPackage Implements the CarrierFactory interface method Returns the package that carrier holds
func (*FedExGround96) Match ¶
func (f *FedExGround96) Match() bool
Match Implements the CarrierFactory interface method Retuns the name of carrier struct with package value
func (*FedExGround96) Validate ¶
func (f *FedExGround96) Validate() bool
Validate Implements the CarrierFactory interface method Checks whether is a package belongs to that carrier
type Package ¶
Package is the base struct of all carriers
func Identify ¶
Identify investigates the carriers and checks if the tracking number is valid for one of them
func NewPackage ¶
NewPackage initializes a new Package struct with a Tracking Number value
type UPS ¶
type UPS struct {
*Package
}
UPS is a carrier that have package struct
func (*UPS) GetCarrierName ¶
GetCarrierName Implements the CarrierFactory interface method Retuns the name of carrier struct with package value
func (*UPS) GetPackage ¶
GetPackage Implements the CarrierFactory interface method Returns the package that carrier holds
type USPS20 ¶ added in v1.1.2
type USPS20 struct {
*Package
}
USPS20 is a carrier that have package struct
func (*USPS20) GetCarrierName ¶ added in v1.1.2
GetCarrierName Implements the CarrierFactory interface method Retuns the name of carrier struct with package value
func (*USPS20) GetPackage ¶ added in v1.1.2
GetPackage Implements the CarrierFactory interface method Returns the package that carrier holds
type USPSIMpb ¶ added in v1.1.2
type USPSIMpb struct {
*Package
}
USPSIMpb is a carrier that have package struct
func NewUSPSIMpb ¶ added in v1.1.2
NewUSPSIMpb initialize a new USPSIMpb struct with package value
func (*USPSIMpb) GetCarrierName ¶ added in v1.1.2
GetCarrierName Implements the CarrierFactory interface method Retuns the name of carrier struct with package value
func (*USPSIMpb) GetPackage ¶ added in v1.1.2
GetPackage Implements the CarrierFactory interface method Returns the package that carrier holds
type USPSS10 ¶ added in v1.1.2
type USPSS10 struct {
*Package
}
USPS10 is a carrier that have package struct
func NewUSPSS10 ¶ added in v1.1.2
NewUSPSS10 initialize a new NewUSPSS10 struct with package value
func (*USPSS10) GetCarrierName ¶ added in v1.1.2
GetCarrierName Implements the CarrierFactory interface method Retuns the name of carrier struct with package value
func (*USPSS10) GetPackage ¶ added in v1.1.2
GetPackage Implements the CarrierFactory interface method Returns the package that carrier holds