rates

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2021 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DomesticRates

type DomesticRates struct {
	Status string `json:"status"`
	Data   struct {
		Title           string `json:"title"`
		Content         string `json:"content"`
		Rule            string `json:"rule"`
		OriginArea      string `json:"originArea"`
		DestinationArea string `json:"destinationArea"`
		Rates           struct {
			Logistic struct {
				Express  []courier `json:"express"`
				Regular  []courier `json:"regular"`
				Trucking []courier `json:"trucking"`
				SameDay  []courier `json:"same day"`
				Instant  []courier `json:"instant"`
			} `json:"logistic"`
		} `json:"rates"`
		StatusCode int `json:"statusCode"`
	} `json:"data"`
}

DomesticRates struct contains response from API GetDomesticRates.

func GetDomesticRates

func GetDomesticRates(params *DomesticRatesParams) (DomesticRates, error)

GetDomesticRates gets available rates based on origin and destination area.

func GetDomesticRatesWithContext

func GetDomesticRatesWithContext(ctx context.Context, params *DomesticRatesParams) (DomesticRates, error)

GetDomesticRatesWithContext gets available rates based on origin and destination area with context.

type DomesticRatesParams

type DomesticRatesParams struct {
	Origin                int     `json:"o" validate:"required"`
	Destination           int     `json:"d" validate:"required"`
	Length                float64 `json:"l" validate:"required"`
	Width                 float64 `json:"w" validate:"required"`
	Height                float64 `json:"h" validate:"required"`
	WeightTotal           float64 `json:"wt" validate:"required"`
	Value                 float64 `json:"v" validate:"required"`
	Type                  int     `json:"type"`
	COD                   int     `json:"cod"`
	Order                 int     `json:"order"`
	OriginCoordinate      string  `json:"originCoord"`
	DestinationCoordinate string  `json:"destinationCoord"`
}

DomesticRatesParams struct contains request parameter for API GetDomesticRates.

type InternationalRates

type InternationalRates struct {
	Status string `json:"status"`
	Data   struct {
		Title           string `json:"title"`
		Content         string `json:"content"`
		Rule            string `json:"rule"`
		OriginArea      string `json:"originArea"`
		DestinationArea string `json:"destinationArea"`
		Rates           struct {
			Logistic struct {
				International []courier `json:"international"`
			} `json:"logistic"`
		} `json:"rates"`
		StatusCode int `json:"statusCode"`
	} `json:"data"`
}

InternationalRates struct contains response from API GetInternationalRates.

func GetInternationalRates

func GetInternationalRates(params *InternationalRatesParams) (InternationalRates, error)

GetInternationalRates gets available rates based on origin and destination country.

func GetInternationalRatesWithContext

func GetInternationalRatesWithContext(ctx context.Context, params *InternationalRatesParams) (InternationalRates, error)

GetInternationalRatesWithContext gets available rates based on origin and destination country with context.

type InternationalRatesParams

type InternationalRatesParams struct {
	Origin      int     `json:"o" validate:"required"`
	Destination int     `json:"d" validate:"required"`
	Length      float64 `json:"l" validate:"required"`
	Width       float64 `json:"w" validate:"required"`
	Height      float64 `json:"h" validate:"required"`
	WeightTotal float64 `json:"wt" validate:"required"`
	Value       float64 `json:"v" validate:"required"`
	Type        int     `json:"type"`
	Order       int     `json:"order"`
}

InternationalRatesParams struct contains request parameter for API GetInternationalRates.

Jump to

Keyboard shortcuts

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