Documentation
¶
Index ¶
- Variables
- type Commodity
- type Contact
- type Currency
- type CurrencyCode
- type DimensionUnit
- type Dimensions
- func (d *Dimensions) ToCentimeter() *Dimensions
- func (d *Dimensions) ToFoot() *Dimensions
- func (d *Dimensions) ToInch() *Dimensions
- func (d *Dimensions) ToKiloMeter() *Dimensions
- func (d *Dimensions) ToMeter() *Dimensions
- func (d *Dimensions) ToMile() *Dimensions
- func (d *Dimensions) ToMillimeter() *Dimensions
- func (d *Dimensions) ToYard() *Dimensions
- type EquipmentType
- type FreightClass
- type HandlingUnit
- type Metadata
- type Reference
- type Temperature
- type TemperatureUnit
- type TransportationMode
- type Volume
- type VolumeUnit
- type Weight
- type WeightUnit
Constants ¶
This section is empty.
Variables ¶
var DimensionUnits = []DimensionUnit{ Millimeter, Centimeter, Meter, Inch, Foot, Yard, Mile, KiloMeter, }
var EquipmentTypes = []EquipmentType{ DryVan, Reefer, Flatbed, StepDeck, DoubleDrop, Lowboy, PowerOnly, Container, Chassis, Tanker, Hopper, Pneumatic, Dump, Livestock, AutoCarrier, Other, }
EquipmentTypes is a list of all available equipment types.
var FreightClasses = []FreightClass{ Class50, Class55, Class60, Class65, Class70, Class77_55, Class85, Class92_5, Class100, Class110, Class125, Class150, Class175, Class200, Class250, Class300, Class400, Class500, }
FreightClasses is a list of all available freight classes.
var TransportationModes = []TransportationMode{ Air, Ocean, Rail, LTL, FTL, VLTL, Multimodal, Intermodal, Parcel, Drayage, RollOnRollOff, LoadOnLoadOff, BreakBulk, }
TransportationModes is a list of all available transportation modes.
Functions ¶
This section is empty.
Types ¶
type Commodity ¶
type Commodity struct {
Id string `json:"id" bson:"id"` // unique identifier for a commodity
Description string `json:"description" bson:"description"` // (Optional) description of a commodity
Weight *Weight `json:"weight" bson:"weight"` // weight of a commodity
Dimensions *Dimensions `json:"dimensions" bson:"dimensions"`
Volume *Volume `json:"volume" bson:"volume"` // volume of a commodity
NFMC string `json:"nfmc" bson:"nmfc"` // National Motor Freight Classification
CountryOfOrigin string `json:"countryOfOrigin" bson:"countryOfOrigin"` // country of origin of a commodity
DeclaredValue *Currency `json:"declaredValue" bson:"declaredValue"` // declared value of a commodity
IsHazardous bool `json:"isHazardous" bson:"isHazardous"` // whether the commodity is hazardous
IsStackable bool `json:"isStackable" bson:"isStackable"` // whether the commodity can be stacked
Metadata Metadata `json:"metadata" bson:"metadata"` // metadata information
MinTemperature *Temperature `json:"minTemperature" bson:"minTemperature"` // maximum temperature required for a commodity
MaxTemperature *Temperature `json:"maxTemperature" bson:"maxTemperature"` // minimum temperature required for a commodity
References []Reference `json:"references" bson:"references"` // any customer references to a commodity
UOM string `json:"uom" bson:"uom"` // unit of measure
}
Commodity represents a commodity model commodities represent the goods being shipped see https://kb.freightcms.com/packaging/commodities/
type Contact ¶
type Contact struct {
Id string `json:"id" bson:"id"` // The unique identifier for the contact.
Name string `json:"name" bson:"name"` // The name of the contact.
Email string `json:"email" bson:"email"` // The email address of the contact.
Phone string `json:"phone" bson:"phone"` // The phone number of the contact.
Fax string `json:"fax" bson:"fax"` // The fax number of the contact.
}
Contact represents a contact that can be used to reach a company, organization, or individual.
type Currency ¶
type Currency struct {
Code string `json:"code"` // The code of the currency
Name string `json:"name"` // The name of the currency
Symbol string `json:"symbol"` // The symbol of the currency
}
CurrencyModel represents a currency model
type CurrencyCode ¶ added in v1.1.0
type CurrencyCode string
CurrencyCode which is viable as of 10-Apr-2024 see https://www.iban.com/currency-codes
const ( AFN CurrencyCode = "AFN" // Afghan Afghani ALL CurrencyCode = "ALL" // Albanian Lek DZD CurrencyCode = "DZD" // Algerian Dinar USD CurrencyCode = "USD" // United States Dollar EUR CurrencyCode = "EUR" // Euro AOA CurrencyCode = "AOA" // Angolan Kwanza XCD CurrencyCode = "XCD" // East Caribbean Dollar ARS CurrencyCode = "ARS" // Argentine Peso AMD CurrencyCode = "AMD" // Armenian Dram AWG CurrencyCode = "AWG" // Aruban Florin AUD CurrencyCode = "AUD" // Australian Dollar AZN CurrencyCode = "AZN" // Azerbaijani Manat BSD CurrencyCode = "BSD" // Bahamian Dollar BHD CurrencyCode = "BHD" // Bahraini Dinar BDT CurrencyCode = "BDT" // Bangladeshi Taka BBD CurrencyCode = "BBD" // Barbadian Dollar BYN CurrencyCode = "BYN" // Belarusian Ruble XOF CurrencyCode = "XOF" // West African CFA franc BMD CurrencyCode = "BMD" // Bermudian Dollar BTN CurrencyCode = "BTN" // Bhutanese Ngultrum INR CurrencyCode = "INR" // Indian Rupee BOB CurrencyCode = "BOB" // Bolivian Boliviano BOV CurrencyCode = "BOV" // Bolivian Mvdol BAM CurrencyCode = "BAM" // Bosnia and Herzegovina Convertible Mark BWP CurrencyCode = "BWP" // Botswana Pula NOK CurrencyCode = "NOK" // Norwegian Krone BRL CurrencyCode = "BRL" // Brazilian Real BND CurrencyCode = "BND" // Brunei Dollar BGN CurrencyCode = "BGN" // Bulgarian Lev BIF CurrencyCode = "BIF" // Burundian Franc CVE CurrencyCode = "CVE" // Cape Verdean Escudo KHR CurrencyCode = "KHR" // Cambodian Riel XAF CurrencyCode = "XAF" // Central African CFA franc CAD CurrencyCode = "CAD" // Canadian Dollar KYD CurrencyCode = "KYD" // Cayman Islands Dollar CLF CurrencyCode = "CLF" // Unidad de Fomento CLP CurrencyCode = "CLP" // Chilean Peso CNY CurrencyCode = "CNY" // Chinese Yuan COP CurrencyCode = "COP" // Colombian Peso COU CurrencyCode = "COU" // Unidad de Valor Real KMF CurrencyCode = "KMF" // Comoro Franc CDF CurrencyCode = "CDF" // Congolese Franc NZD CurrencyCode = "NZD" // New Zealand Dollar CRC CurrencyCode = "CRC" // Costa Rican Colón HRK CurrencyCode = "HRK" // Croatian Kuna CUP CurrencyCode = "CUP" // Cuban Peso CUC CurrencyCode = "CUC" // Cuban Convertible Peso ANG CurrencyCode = "ANG" // Netherlands Antillean Guilder CZK CurrencyCode = "CZK" // Czech Koruna DKK CurrencyCode = "DKK" // Danish Krone DJF CurrencyCode = "DJF" // Djiboutian Franc DOP CurrencyCode = "DOP" // Dominican Peso EGP CurrencyCode = "EGP" // Egyptian Pound SVC CurrencyCode = "SVC" // Salvadoran Colón ERN CurrencyCode = "ERN" // Eritrean Nakfa ETB CurrencyCode = "ETB" // Ethiopian Birr FKP CurrencyCode = "FKP" // Falkland Islands Pound FJD CurrencyCode = "FJD" // Fijian Dollar XPF CurrencyCode = "XPF" // CFP franc GMD CurrencyCode = "GMD" // Gambian Dalasi GEL CurrencyCode = "GEL" // Georgian Lari GHS CurrencyCode = "GHS" // Ghanaian Cedi GIP CurrencyCode = "GIP" // Gibraltar Pound GTQ CurrencyCode = "GTQ" // Guatemalan Quetzal GBP CurrencyCode = "GBP" // British Pound GNF CurrencyCode = "GNF" // Guinean Franc GYD CurrencyCode = "GYD" // Guyanese Dollar HTG CurrencyCode = "HTG" // Haitian Gourde HNL CurrencyCode = "HNL" // Honduran Lempira HKD CurrencyCode = "HKD" // Hong Kong Dollar HUF CurrencyCode = "HUF" // Hungarian Forint ISK CurrencyCode = "ISK" // Icelandic Króna IDR CurrencyCode = "IDR" // Indonesian Rupiah XDR CurrencyCode = "XDR" // Special Drawing Rights IRR CurrencyCode = "IRR" // Iranian Rial IQD CurrencyCode = "IQD" // Iraqi Dinar ILS CurrencyCode = "ILS" // Israeli New Shekel JMD CurrencyCode = "JMD" // Jamaican Dollar JPY CurrencyCode = "JPY" // Japanese Yen JOD CurrencyCode = "JOD" // Jordanian Dinar KZT CurrencyCode = "KZT" // Kazakhstani Tenge KES CurrencyCode = "KES" // Kenyan Shilling KPW CurrencyCode = "KPW" // North Korean Won KRW CurrencyCode = "KRW" // South Korean Won KWD CurrencyCode = "KWD" // Kuwaiti Dinar KGS CurrencyCode = "KGS" // Kyrgyzstani Som LAK CurrencyCode = "LAK" // Lao Kip LBP CurrencyCode = "LBP" // Lebanese Pound LSL CurrencyCode = "LSL" // Lesotho Loti ZAR CurrencyCode = "ZAR" // South African Rand LRD CurrencyCode = "LRD" // Liberian Dollar LYD CurrencyCode = "LYD" // Libyan Dinar CHF CurrencyCode = "CHF" // Swiss Franc MOP CurrencyCode = "MOP" // Macanese Pataca MKD CurrencyCode = "MKD" // Macedonian Denar MGA CurrencyCode = "MGA" // Malagasy Ariary MWK CurrencyCode = "MWK" // Malawian Kwacha MYR CurrencyCode = "MYR" // Malaysian Ringgit MVR CurrencyCode = "MVR" // Maldivian Rufiyaa MRO CurrencyCode = "MRO" // Mauritanian Ouguiya MUR CurrencyCode = "MUR" // Mauritian Rupee MXN CurrencyCode = "MXN" // Mexican Peso MXV CurrencyCode = "MXV" // Mexican Unidad de Inversion (UDI) MDL CurrencyCode = "MDL" // Moldovan Leu MNT CurrencyCode = "MNT" // Mongolian Tugrik MAD CurrencyCode = "MAD" // Moroccan Dirham MZN CurrencyCode = "MZN" // Mozambican Metical MMK CurrencyCode = "MMK" // Myanmar Kyat NAD CurrencyCode = "NAD" // Namibian Dollar NPR CurrencyCode = "NPR" // Nepalese Rupee NIO CurrencyCode = "NIO" // Nicaraguan Córdoba NGN CurrencyCode = "NGN" // Nigerian Naira OMR CurrencyCode = "OMR" // Omani Rial PKR CurrencyCode = "PKR" // Pakistani Rupee PAB CurrencyCode = "PAB" // Panamanian Balboa PGK CurrencyCode = "PGK" // Papua New Guinean Kina PYG CurrencyCode = "PYG" // Paraguayan Guarani PEN CurrencyCode = "PEN" // Peruvian Nuevo Sol PHP CurrencyCode = "PHP" // Philippine Peso PLN CurrencyCode = "PLN" // Polish Zloty QAR CurrencyCode = "QAR" // Qatari Rial RON CurrencyCode = "RON" // Romanian Leu RUB CurrencyCode = "RUB" // Russian Ruble RWF CurrencyCode = "RWF" // Rwandan Franc SHP CurrencyCode = "SHP" // Saint Helena Pound WST CurrencyCode = "WST" // Samoan Tala STD CurrencyCode = "STD" // São Tomé and Príncipe Dobra SAR CurrencyCode = "SAR" // Saudi Riyal RSD CurrencyCode = "RSD" // Serbian Dinar SCR CurrencyCode = "SCR" // Seychellois Rupee SLL CurrencyCode = "SLL" // Sierra Leonean Leone SGD CurrencyCode = "SGD" // Singapore Dollar SBD CurrencyCode = "SBD" // Solomon Islands Dollar SOS CurrencyCode = "SOS" // Somali Shilling SSP CurrencyCode = "SSP" // South Sudanese Pound LKR CurrencyCode = "LKR" // Sri Lankan Rupee SDG CurrencyCode = "SDG" // Sudanese Pound SRD CurrencyCode = "SRD" // Surinamese Dollar SZL CurrencyCode = "SZL" // Swazi Lilangeni SEK CurrencyCode = "SEK" // Swedish Krona SYP CurrencyCode = "SYP" // Syrian Pound TWD CurrencyCode = "TWD" // New Taiwan Dollar TJS CurrencyCode = "TJS" // Tajikistani Somoni TZS CurrencyCode = "TZS" // Tanzanian Shilling THB CurrencyCode = "THB" // Thai Baht TOP CurrencyCode = "TOP" // Tongan Paʻanga TTD CurrencyCode = "TTD" // Trinidad and Tobago Dollar TND CurrencyCode = "TND" // Tunisian Dinar TRY CurrencyCode = "TRY" // Turkish Lira TMT CurrencyCode = "TMT" // Turkmenistani Manat UGX CurrencyCode = "UGX" // Ugandan Shilling UAH CurrencyCode = "UAH" // Ukrainian Hryvnia UYU CurrencyCode = "UYU" // Uruguayan Peso UYI CurrencyCode = "UYI" // Uruguayan Peso en Unidades Indexadas UZS CurrencyCode = "UZS" // Uzbekistan Som VUV CurrencyCode = "VUV" // Vanuatu Vatu VEF CurrencyCode = "VEF" // Venezuelan Bolívar VND CurrencyCode = "VND" // Vietnamese Dong YER CurrencyCode = "YER" // Yemeni Rial ZMW CurrencyCode = "ZMW" // Zambian Kwacha ZWL CurrencyCode = "ZWL" // Zimbabwean Dollar )
type DimensionUnit ¶ added in v1.1.0
type DimensionUnit string
const ( Millimeter DimensionUnit = "mm" Centimeter DimensionUnit = "cm" Meter DimensionUnit = "m" Inch DimensionUnit = "in" Foot DimensionUnit = "ft" Yard DimensionUnit = "yd" Mile DimensionUnit = "mi" KiloMeter DimensionUnit = "km" )
type Dimensions ¶
type Dimensions struct {
Length float64 `json:"length" bson:"length"` // The length dimension
Width float64 `json:"width" bson:"width"` // The width dimension
Height float64 `json:"height" bson:"height"` // The height dimension
Unit DimensionUnit `json:"unit" bson:"unit"` // The unit of the dimensions
}
DimensionsModel represents a model for dimensions
func (*Dimensions) ToCentimeter ¶ added in v1.1.0
func (d *Dimensions) ToCentimeter() *Dimensions
ToCentimeter converts the dimensions to centimeters
func (*Dimensions) ToFoot ¶ added in v1.1.0
func (d *Dimensions) ToFoot() *Dimensions
ToFoot converts the dimensions to feet
func (*Dimensions) ToInch ¶ added in v1.1.0
func (d *Dimensions) ToInch() *Dimensions
ToInch converts the dimensions to inches
func (*Dimensions) ToKiloMeter ¶ added in v1.1.0
func (d *Dimensions) ToKiloMeter() *Dimensions
ToKiloMeter converts the dimensions to kilometers
func (*Dimensions) ToMeter ¶ added in v1.1.0
func (d *Dimensions) ToMeter() *Dimensions
ToMeter converts the dimensions to meters
func (*Dimensions) ToMile ¶ added in v1.1.0
func (d *Dimensions) ToMile() *Dimensions
ToMile converts the dimensions to miles
func (*Dimensions) ToMillimeter ¶ added in v1.1.0
func (d *Dimensions) ToMillimeter() *Dimensions
ToMillimeter converts the dimensions to millimeters
func (*Dimensions) ToYard ¶ added in v1.1.0
func (d *Dimensions) ToYard() *Dimensions
ToYard converts the dimensions to yards
type EquipmentType ¶
type EquipmentType string
const ( DryVan EquipmentType = "DryVan" Reefer EquipmentType = "Reefer" Flatbed EquipmentType = "Flatbed" StepDeck EquipmentType = "StepDeck" DoubleDrop EquipmentType = "DoubleDrop" Lowboy EquipmentType = "Lowboy" PowerOnly EquipmentType = "PowerOnly" Container EquipmentType = "Container" Chassis EquipmentType = "Chassis" Tanker EquipmentType = "Tanker" Hopper EquipmentType = "Hopper" Pneumatic EquipmentType = "Pneumatic" Dump EquipmentType = "Dump" Livestock EquipmentType = "Livestock" AutoCarrier EquipmentType = "AutoCarrier" Other EquipmentType = "Other" )
type FreightClass ¶
type FreightClass int
FreightClass represents the freight class of a shipment. see https://kb.freightcms.com/glossery/freight-class/
const ( Class50 FreightClass = iota + 50 Class55 Class60 Class65 Class70 Class77_55 Class85 Class92_5 Class100 Class110 Class125 Class150 Class175 Class200 Class250 Class300 Class400 Class500 )
type HandlingUnit ¶ added in v1.1.0
type HandlingUnit struct {
Id string `json:"id" bson:"id"`
Description string `json:"description" bson:"description"`
Weight *Weight `json:"weight" bson:"weight"`
Dimensions *Dimensions `json:"dimensions" bson:"dimensions"`
Volume *Volume `json:"volume" bson:"volume"`
NFMC string `json:"nfmc" bson:"nfmc"`
HarmonizedCode string `json:"harmonizedCode" bson:"harmonizedCode"`
CountryOfOrigin string `json:"countryOfOrigin" bson:"countryOfOrigin"`
DeclaredValue *Currency `json:"declaredValue" bson:"declaredValue"`
IsHazardous bool `json:"isHazardous" bson:"isHazardous"`
IsStackable bool `json:"isStackable" bson:"isStackable"`
Metadata Metadata `json:"metadata" bson:"metadata"`
MinTemperature *Temperature `json:"minTemperature" bson:"minTemperature"`
MaxTemperature *Temperature `json:"maxTemperature" bson:"maxTemperature"`
References []Reference `json:"references" bson:"references"`
Commodities []Commodity `json:"commodities" bson:"commodities"`
}
HandlingUnitModel represents a handling unit model
type Metadata ¶
type Metadata struct {
OrderNumber string `json:"orderNumber" bson:"orderNumber"`
InvoiceNumber string `json:"invoiceNumber" bson:"invoiceNumber"`
PurchaseOrderNumber string `json:"purchaseOrderNumber" bson:"purchaseOrderNumber"`
CustomerOrderNumber string `json:"customerOrderNumber" bson:"customerOrderNumber"`
BillOfLading string `json:"billOfLading" bson:"billOfLading"`
LineItemNumber string `json:"lineItemNumber" bson:"lineItemNumber"`
ReferenceNumber string `json:"referenceNumber" bson:"referenceNumber"`
ContainerNumber string `json:"containerNumber" bson:"containerNumber"`
ShipmentNumber string `json:"shipmentNumber" bson:"shipmentNumber"`
SealNumber string `json:"sealNumber" bson:"sealNumber"`
BookingNumber string `json:"bookingNumber" bson:"bookingNumber"`
MasterBillOfLading string `json:"masterBillOfLading" bson:"masterBillOfLading"`
HouseBillOfLading string `json:"houseBillOfLading" bson:"houseBillOfLading"`
ProNumber string `json:"proNumber" bson:"proNumber"`
TrackingNumber string `json:"trackingNumber" bson:"trackingNumber"`
PackageNumber string `json:"packageNumber" bson:"packageNumber"`
}
Metadata represents metadata information
type Reference ¶
type Reference struct {
Id string `json:"id" bson:"id"` // Unique identifier for the reference for internal usage only.
NameOrCode string `json:"nameOrCode" bson:"nameOrCode"` // Name or code to relay to the consumer of what the reference may be for.
Description string `json:"description" bson:"description"` // Description of the reference that tells more about the name or code that is implied.
Value string `json:"value" bson:"value"` // Any data that can be used by the end user to find information. JSON, XML, URLs, etc.
}
ReferenceModel represents a reference to a model that can be used to identify a company, organization, or individual.
type Temperature ¶
type Temperature struct {
Value float64 `json:"value" bson:"value"` // The temperature value
Unit TemperatureUnit `json:"unit" bson:"unit"` // The unit of the temperature
}
func (*Temperature) ToCelsius ¶ added in v1.1.0
func (t *Temperature) ToCelsius() *Temperature
Creates a copy of the current temperature in Celsius
func (*Temperature) ToFahrenheit ¶ added in v1.1.0
func (t *Temperature) ToFahrenheit() *Temperature
Creates a copy of the current temperature in Fahrenheit
type TemperatureUnit ¶ added in v1.1.0
type TemperatureUnit string
Temperature is a struct that represents a temperature value and its unit
const ( Celsius TemperatureUnit = "C" Fahrenheit TemperatureUnit = "F" )
type TransportationMode ¶
type TransportationMode string
const ( Air TransportationMode = "Air" Ocean TransportationMode = "Ocean" Rail TransportationMode = "Rail" LTL TransportationMode = "LTL" FTL TransportationMode = "FTL" VLTL TransportationMode = "VLTL" Multimodal TransportationMode = "Multimodal" Intermodal TransportationMode = "Intermodal" Parcel TransportationMode = "Parcel" Drayage TransportationMode = "Drayage" RollOnRollOff TransportationMode = "RoRo" LoadOnLoadOff TransportationMode = "LoLo" BreakBulk TransportationMode = "BreakBulk" )
TransportationMode represents the mode of transportation used to move goods from one location to another. See: https://kb.freightcms.com/modes/
type Volume ¶
type Volume struct {
Value float64 `json:"value" bson:"value"` // The volume value
Unit VolumeUnit `json:"unit" bson:"unit"` // The unit of the volume
}
type VolumeUnit ¶ added in v1.1.0
type VolumeUnit string
Unit of Volume type for measurement see https://en.wikipedia.org/wiki/Unit_of_volume
const ( CubicMetre VolumeUnit = "m³" Barrel VolumeUnit = "bbl" CubicFoot VolumeUnit = "ft³" Litre VolumeUnit = "L" CubicDecimetre VolumeUnit = "dm³" Gallon VolumeUnit = "gal" Pint VolumeUnit = "pt" CubicInch VolumeUnit = "in³" CubicYard VolumeUnit = "yd³" Cord VolumeUnit = "cord" BoardFoot VolumeUnit = "fbm" )
type Weight ¶
type Weight struct {
Value float64 `json:"value" bson:"value"` // The weight value
Unit WeightUnit `json:"unit" bson:"unit"` // The unit of the weight. Possible values are: "kg", "lb"
}
WeightModel represents a model for weight
type WeightUnit ¶ added in v1.1.0
type WeightUnit string
const ( Kilogram WeightUnit = "kg" Gram WeightUnit = "g" Pound WeightUnit = "lb" Ounce WeightUnit = "oz" )