rajaongkir

package
v0.0.0-...-41aeae6 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RajaOngkir

type RajaOngkir struct {
	// contains filtered or unexported fields
}

func InitRajaOngkit

func InitRajaOngkit(credentialCode string) *RajaOngkir

func (*RajaOngkir) GetCity

func (r *RajaOngkir) GetCity(idProvince, idCity string) (*RajaOngkirResponseCity, error)

func (*RajaOngkir) GetCost

func (r *RajaOngkir) GetCost(cityOrigin, cityDestination string, weight int) ([]*RajaOngkirResponseCost, error)

func (*RajaOngkir) GetProvince

func (r *RajaOngkir) GetProvince(idProvince string) (*RajaOngkirResponseProvince, error)

type RajaOngkirResponseCity

type RajaOngkirResponseCity struct {
	RajaOngkir struct {
		Query struct {
			ID       string `json:"id"`
			Province string `json:"province"`
		} `json:"query"`
		Status struct {
			Code        int    `json:"code"`
			Description string `json:"description"`
		} `json:"status"`
		Results []struct {
			CityID     string `json:"city_id"`
			ProvinceID string `json:"province_id"`
			Province   string `json:"province"`
			Type       string `json:"type"`
			CityName   string `json:"city_name"`
			PostalCode string `json:"postal_code"`
		} `json:"results"`
	} `json:"rajaongkir"`
}

type RajaOngkirResponseCost

type RajaOngkirResponseCost struct {
	RajaOngkir struct {
		Query struct {
			Origin      string `json:"origin"`
			Destination string `json:"destination"`
			Weight      int    `json:"weight"`
			Courier     string `json:"courier"`
		} `json:"query"`
		Status struct {
			Code        int    `json:"code"`
			Description string `json:"description"`
		} `json:"status"`
		OriginDetails struct {
			CityID     string `json:"city_id"`
			ProvinceID string `json:"province_id"`
			Province   string `json:"province"`
			Type       string `json:"type"`
			CityName   string `json:"city_name"`
			PostalCode string `json:"postal_code"`
		} `json:"origin_details"`
		DestinationDetails struct {
			CityID     string `json:"city_id"`
			ProvinceID string `json:"province_id"`
			Province   string `json:"province"`
			Type       string `json:"type"`
			CityName   string `json:"city_name"`
			PostalCode string `json:"postal_code"`
		} `json:"destination_details"`
		Results []struct {
			Code  string `json:"code"`
			Name  string `json:"name"`
			Costs []struct {
				Service     string `json:"service"`
				Description string `json:"description"`
				Cost        []struct {
					Value int    `json:"value"`
					Etd   string `json:"etd"`
					Note  string `json:"note"`
				} `json:"cost"`
			} `json:"costs"`
		} `json:"results"`
	} `json:"rajaongkir"`
}

type RajaOngkirResponseProvince

type RajaOngkirResponseProvince struct {
	RajaOngkir struct {
		Query struct {
			ID string `json:"id"`
		} `json:"query"`
		Status struct {
			Code        int    `json:"code"`
			Description string `json:"description"`
		} `json:"status"`
		Results []struct {
			ProvinceID string `json:"province_id"`
			Province   string `json:"province"`
		} `json:"results"`
	} `json:"rajaongkir"`
}

Jump to

Keyboard shortcuts

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