kaiwsdkv2

package
v0.0.0-...-0c25df4 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2018 License: Apache-2.0 Imports: 9 Imported by: 21

Documentation

Overview

Package kaiwsdkv2 is used to interact with a KAI Train-RailTicket (HTTP/REST) Web Service Server

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DebugHTTP

func DebugHTTP(data []byte, err error)

DebugHTTP is function to debug HTTP Request/Response

func DebugHTTPRequest

func DebugHTTPRequest(data []byte, err error)

DebugHTTPRequest is a function to debug HTTP Request

func DebugHTTPResponse

func DebugHTTPResponse(data []byte, err error)

DebugHTTPResponse is a function to debug HTTP Response

func TrasformStandardKAIResponse

func TrasformStandardKAIResponse(kaiResponse []byte) []byte

TrasformStandardKAIResponse is a function to trasform KAI response to Internal KAI Standard Payload

Types

type AvailSubClass

type AvailSubClass struct {
	SubClass      string  `json:"subClass"`
	SeatAvailable float64 `json:"seatAvailable"`
	SeatClass     string  `json:"seatClass"`
	AdultPrice    float64 `json:"adultPrice"`
	ChildPrice    float64 `json:"childPrice"`
	InfantPrice   float64 `json:"infantPrice"`
}

AvailSubClass type

type AvailSubClassLite

type AvailSubClassLite struct {
	SubClass      string  `json:"subClass"`
	SeatAvailable float64 `json:"seatAvailable"`
	SeatClass     string  `json:"seatClass"`
	AdultPrice    float64 `json:"adultPrice"`
	ChildPrice    float64 `json:"childPrice"`
	InfantPrice   float64 `json:"infantPrice"`
}

AvailSubClassLite type

type AvailSubClassV2

type AvailSubClassV2 struct {
	SubClass      string  `json:"subClass"`
	SeatAvailable float64 `json:"seatAvailable"`
	SeatClass     string  `json:"seatClass"`
	AdultPrice    float64 `json:"adultPrice"`
	ChildPrice    float64 `json:"childPrice"`
	InfantPrice   float64 `json:"infantPrice"`
}

AvailSubClassV2 type

type Booking

type Booking struct {
	Origin        string      `json:"origin"`
	Destination   string      `json:"destination"`
	DepartureDate string      `json:"departureDate"`
	TrainNo       interface{} `json:"trainNo"`
	BookCode      string      `json:"bookCode"`
	NumCode       interface{} `json:"numCode"`
	PaxNums       PaxNum      `json:"paxNums"`
	PaxNames      []PaxName   `json:"paxNames"`
	Seats         []PaxSeat   `json:"seats"`
	NormalSales   float64     `json:"normalSales"`
	ExtraFee      float64     `json:"extraFee"`
	BookBalance   float64     `json:"bookBalance"`
	Discount      float64     `json:"discount"`
}

Booking type

type BookingRS

type BookingRS struct {
	ErrCode       interface{}     `json:"err_code"`
	ErrMsg        interface{}     `json:"err_msg"`
	Origin        string          `json:"org"`
	Destination   string          `json:"des"`
	DepartureDate string          `json:"dep_date"`
	TrainNo       interface{}     `json:"train_no"`
	BookCode      string          `json:"book_code"`
	NumCode       interface{}     `json:"num_code"`
	PaxNums       []int           `json:"pax_num"`
	PaxNames      []string        `json:"pax_name"`
	Seats         [][]interface{} `json:"seat"`
	NormalSales   float64         `json:"normal_sales"`
	ExtraFee      float64         `json:"extra_fee"`
	BookBalance   float64         `json:"book_balance"`
	Discount      float64         `json:"discount"`
}

BookingRS represent "transaction.booking" response

type BookingWithArvInfo

type BookingWithArvInfo struct {
	Origin        string      `json:"origin"`
	Destination   string      `json:"destination"`
	DepartureDate string      `json:"departureDate"`
	ArriveDate    string      `json:"arriveDate"`
	DepartureTime string      `json:"departureTime"`
	ArriveTime    string      `json:"arriveTime"`
	TrainNo       interface{} `json:"trainNo"`
	BookCode      string      `json:"bookCode"`
	NumCode       interface{} `json:"numCode"`
	PaxNums       PaxNum      `json:"paxNums"`
	PaxNames      []PaxName   `json:"paxNames"`
	Seats         []PaxSeat   `json:"seats"`
	NormalSales   float64     `json:"normalSales"`
	ExtraFee      float64     `json:"extraFee"`
	BookBalance   float64     `json:"bookBalance"`
	Discount      float64     `json:"discount"`
}

BookingWithArvInfo type

type BookingWithArvInfoRS

type BookingWithArvInfoRS struct {
	ErrCode       interface{}     `json:"err_code"`
	ErrMsg        interface{}     `json:"err_msg"`
	Origin        string          `json:"org"`
	Destination   string          `json:"des"`
	DepartureDate string          `json:"dep_date"`
	ArriveDate    string          `json:"arv_date"`
	DepartureTime string          `json:"dep_time"`
	ArriveTime    string          `json:"arv_time"`
	TrainNo       interface{}     `json:"train_no"`
	BookCode      string          `json:"book_code"`
	NumCode       interface{}     `json:"num_code"`
	PaxNums       []int           `json:"pax_num"`
	PaxNames      []string        `json:"pax_name"`
	Seats         [][]interface{} `json:"seat"`
	NormalSales   float64         `json:"normal_sales"`
	ExtraFee      float64         `json:"extra_fee"`
	BookBalance   float64         `json:"book_balance"`
	Discount      float64         `json:"discount"`
}

BookingWithArvInfoRS represent "transaction.booking_with_arv_info" response

type CancelBook

type CancelBook struct {
	BookCode     string  `json:"bookCode"`
	Status       string  `json:"status"`
	RefundAmount float64 `json:"refundAmount"`
}

CancelBook type

type CancelBookRS

type CancelBookRS struct {
	ErrCode      interface{} `json:"err_code"`
	ErrMsg       interface{} `json:"err_msg"`
	BookCode     string      `json:"book_code"`
	Status       string      `json:"status"`
	RefundAmount float64     `json:"refund_amount"`
}

CancelBookRS represent "transaction.cancel_book" response

type CancelPayment

type CancelPayment struct {
	BookCode    string  `json:"bookBode"`
	NormalSales float64 `json:"normalSales"`
	ExtraFee    float64 `json:"extraFee"`
	BookBalance float64 `json:"bookBalance"`
}

CancelPayment type

type CancelPaymentRS

type CancelPaymentRS struct {
	ErrCode     interface{} `json:"err_code"`
	ErrMsg      interface{} `json:"err_msg"`
	BookCode    string      `json:"book_code"`
	NormalSales float64     `json:"normal_sales"`
	ExtraFee    float64     `json:"extra_fee"`
	BookBalance float64     `json:"book_balance"`
}

CancelPaymentRS represent "transaction.cancel_payment" response

type Destination

type Destination struct {
	DestCode string `json:"DestCode"`
	DestName string `json:"DestName"`
}

Destination type

type GetAgentBalance

type GetAgentBalance struct {
	AgentCode    string  `json:"agentCode"`
	AgentName    string  `json:"agentName"`
	AgentBalance float64 `json:"agentBalance"`
}

GetAgentBalance type

type GetAgentBalanceRS

type GetAgentBalanceRS struct {
	ErrCode      interface{} `json:"err_code"`
	ErrMsg       interface{} `json:"err_msg"`
	AgentCode    string      `json:"agent_code"`
	AgentName    string      `json:"agent_name"`
	AgentBalance float64     `json:"agent_balance"`
}

GetAgentBalanceRS represent "information.get_agent_balance" response

type GetBalance

type GetBalance struct {
	BookCode    string  `json:"bookCode"`
	NumCode     string  `json:"numCode"`
	NormalSales float64 `json:"normalSales"`
	ExtraFee    float64 `json:"extraFee"`
	BookBalance float64 `json:"bookBalance"`
	Discount    float64 `json:"discount"`
}

GetBalance type

type GetBalanceRS

type GetBalanceRS struct {
	ErrCode     interface{} `json:"err_code"`
	ErrMsg      interface{} `json:"err_msg"`
	BookCode    string      `json:"book_code"`
	NumCode     interface{} `json:"num_code"`
	NormalSales float64     `json:"normal_sales"`
	ExtraFee    float64     `json:"extra_fee"`
	BookBalance float64     `json:"book_balance"`
	Discount    float64     `json:"discount"`
}

GetBalanceRS represent "information.get_balance" response

type GetBookInfo

type GetBookInfo struct {
	BookCode      string    `json:"bookCode"`
	NumCode       string    `json:"numCode"`
	Caller        string    `json:"caller"`
	BookTime      string    `json:"bookTime"`
	TrainNo       string    `json:"trainNo"`
	TrainName     string    `json:"trainName"`
	Origin        string    `json:"origin"`
	Destination   string    `json:"destination"`
	DepartureDate string    `json:"departureDate"`
	DepartureTime string    `json:"departureTime"`
	ArriveDate    string    `json:"arriveDate"`
	ArriveTime    string    `json:"arriveTime"`
	SubClass      string    `json:"subClass"`
	Class         string    `json:"class"`
	NormalSales   float64   `json:"normalSales"`
	ExtraFee      float64   `json:"extraFee"`
	BookBalance   float64   `json:"bookBalance"`
	Discount      float64   `json:"discount"`
	PaxList       []PaxList `json:"paxList"`
}

GetBookInfo type

type GetBookInfoRS

type GetBookInfoRS struct {
	ErrCode       interface{}     `json:"err_code"`
	ErrMsg        interface{}     `json:"err_msg"`
	BookCode      string          `json:"book_code"`
	NumCode       interface{}     `json:"num_code"`
	Caller        string          `json:"caller"`
	BookTime      string          `json:"book_time"`
	TrainNo       string          `json:"train_no"`
	TrainName     string          `json:"train_name"`
	Origin        string          `json:"org"`
	Destination   string          `json:"des"`
	DepartureDate string          `json:"dep_date"`
	DepartureTime string          `json:"dep_time"`
	ArriveDate    string          `json:"arv_date"`
	ArriveTime    string          `json:"arv_time"`
	SubClass      string          `json:"subclass"`
	Class         string          `json:"class"`
	NormalSales   float64         `json:"normal_sales"`
	ExtraFee      float64         `json:"extra_fee"`
	BookBalance   float64         `json:"book_balance"`
	Discount      float64         `json:"discount"`
	PaxList       [][]interface{} `json:"pax_list"`
}

GetBookInfoRS represent "information.get_book_info" response

type GetBookPriceInfo

type GetBookPriceInfo struct {
	BookCode         string  `json:"bookCode"`
	TotalPriceAdult  float64 `json:"totalPriceAdult"`
	TotalPriceChild  float64 `json:"totalPriceChild"`
	TotalPriceInfant float64 `json:"totalPriceInfant"`
	ExtraFee         float64 `json:"extraFee"`
	TotalPrice       float64 `json:"totalPrice"`
}

GetBookPriceInfo type

type GetBookPriceInfoRS

type GetBookPriceInfoRS struct {
	ErrCode          interface{} `json:"err_code"`
	ErrMsg           interface{} `json:"err_msg"`
	BookCode         string      `json:"book_code"`
	TotalPriceAdult  float64     `json:"total_price_adult"`
	TotalPriceChild  float64     `json:"total_price_child"`
	TotalPriceInfant float64     `json:"total_price_infant"`
	ExtraFee         float64     `json:"extra_fee"`
	TotalPrice       float64     `json:"total_price"`
}

GetBookPriceInfoRS represent "information.get_book_price_info" response

type GetDestinationRS

type GetDestinationRS struct {
	ErrCode      interface{}     `json:"err_code"`
	ErrMsg       interface{}     `json:"err_msg"`
	Destinations [][]interface{} `json:"destination"`
}

GetDestinationRS represent "data.get_des" response

type GetOriginationRS

type GetOriginationRS struct {
	ErrCode      interface{}     `json:"err_code"`
	ErrMsg       interface{}     `json:"err_msg"`
	Originations [][]interface{} `json:"origination"`
}

GetOriginationRS represent "data.get_org" response

type GetPayTypeRS

type GetPayTypeRS struct {
	ErrCode  interface{}   `json:"err_code"`
	ErrMsg   interface{}   `json:"err_msg"`
	PayTypes []interface{} `json:"pay_type"`
}

GetPayTypeRS represent "data.get_pay_type" response

type GetSchedule

type GetSchedule struct {
	Origin        string     `json:"origin"`
	Destination   string     `json:"destination"`
	DepartureDate string     `json:"departureDate"`
	Schedules     []Schedule `json:"schedules"`
}

GetSchedule type

type GetScheduleLite

type GetScheduleLite struct {
	Origin        string         `json:"origin"`
	Destination   string         `json:"destination"`
	DepartureDate string         `json:"departureDate"`
	Schedules     []ScheduleLite `json:"schedules"`
}

GetScheduleLite type

type GetScheduleLiteRS

type GetScheduleLiteRS struct {
	ErrCode       interface{}   `json:"err_code"`
	ErrMsg        interface{}   `json:"err_msg"`
	Origin        string        `json:"org"`
	Destination   string        `json:"des"`
	DepartureDate string        `json:"dep_date"`
	Schedules     []interface{} `json:"schedule"`
}

GetScheduleLiteRS represent "information.get_schedule_lite" method

type GetScheduleRS

type GetScheduleRS struct {
	ErrCode       interface{}   `json:"err_code"`
	ErrMsg        interface{}   `json:"err_msg"`
	Origin        string        `json:"org"`
	Destination   string        `json:"des"`
	DepartureDate string        `json:"dep_date"`
	Schedules     []interface{} `json:"schedule"`
}

GetScheduleRS represent "information.get_schedule" response

type GetScheduleV2

type GetScheduleV2 struct {
	Origin        string       `json:"origin"`
	Destination   string       `json:"destination"`
	DepartureDate string       `json:"departureDate"`
	Schedules     []ScheduleV2 `json:"schedules"`
}

GetScheduleV2 type

type GetScheduleV2RS

type GetScheduleV2RS struct {
	ErrCode       interface{}   `json:"err_code"`
	ErrMsg        interface{}   `json:"err_msg"`
	Origin        string        `json:"org"`
	Destination   string        `json:"des"`
	DepartureDate string        `json:"dep_date"`
	Schedules     []interface{} `json:"schedule"`
}

GetScheduleV2RS represent "information.get_schedule_v2" response

type GetSeatMap

type GetSeatMap struct {
	Origin        string    `json:"origin"`
	Destination   string    `json:"destination"`
	TrainNo       string    `json:"trainNo"`
	DepartureDate string    `json:"departureDate"`
	SeatMaps      []SeatMap `json:"seatMaps"`
}

GetSeatMap type

type GetSeatMapPerSubClass

type GetSeatMapPerSubClass struct {
	Origin        string    `json:"origin"`
	Destination   string    `json:"destination"`
	TrainNo       string    `json:"trainNo"`
	DepartureDate string    `json:"departureDate"`
	SeatMaps      []SeatMap `json:"seatMaps"`
}

GetSeatMapPerSubClass type

type GetSeatMapPerSubClassRS

type GetSeatMapPerSubClassRS struct {
	ErrCode       interface{}   `json:"err_code"`
	ErrMsg        interface{}   `json:"err_msg"`
	Origin        string        `json:"org"`
	Destination   string        `json:"des"`
	TrainNo       string        `json:"train_no"`
	DepartureDate string        `json:"dep_date"`
	SeatMaps      []interface{} `json:"seat_map"`
}

GetSeatMapPerSubClassRS represent "information.get_seat_map_per_subclass" response

type GetSeatMapRS

type GetSeatMapRS struct {
	ErrCode       interface{}   `json:"err_code"`
	ErrMsg        interface{}   `json:"err_msg"`
	Origin        string        `json:"org"`
	Destination   string        `json:"des"`
	TrainNo       string        `json:"train_no"`
	DepartureDate string        `json:"dep_date"`
	SeatMaps      []interface{} `json:"seat_map"`
}

GetSeatMapRS represent "information.get_seat_map" response

type GetSeatNull

type GetSeatNull struct {
	Origin        string     `json:"origin"`
	Destination   string     `json:"destination"`
	TrainNo       string     `json:"trainNo"`
	DepartureDate string     `json:"departureDate"`
	SeatNulls     []SeatNull `json:"seatNulls"`
}

GetSeatNull type

type GetSeatNullPerSubClass

type GetSeatNullPerSubClass struct {
	Origin        string     `json:"origin"`
	Destination   string     `json:"destination"`
	TrainNo       string     `json:"trainNo"`
	DepartureDate string     `json:"departureDate"`
	SeatNulls     []SeatNull `json:"seatNulls"`
}

GetSeatNullPerSubClass type

type GetSeatNullPerSubClassRS

type GetSeatNullPerSubClassRS struct {
	ErrCode       interface{}   `json:"err_code"`
	ErrMsg        interface{}   `json:"err_msg"`
	Origin        string        `json:"org"`
	Destination   string        `json:"des"`
	TrainNo       string        `json:"train_no"`
	DepartureDate string        `json:"dep_date"`
	SeatNulls     []interface{} `json:"seat_null"`
}

GetSeatNullPerSubClassRS represent "information.get_seat_null_per_subclass" response

type GetSeatNullRS

type GetSeatNullRS struct {
	ErrCode       interface{}   `json:"err_code"`
	ErrMsg        interface{}   `json:"err_msg"`
	Origin        string        `json:"org"`
	Destination   string        `json:"des"`
	TrainNo       string        `json:"train_no"`
	DepartureDate string        `json:"dep_date"`
	SeatNulls     []interface{} `json:"seat_null"`
}

GetSeatNullRS represent "information.get_seat_null" response

type InternalBookingRS

type InternalBookingRS struct {
	ErrCode interface{} `json:"errCode"`
	ErrMsg  interface{} `json:"errMsg"`
	Return  Booking     `json:"return"`
}

InternalBookingRS represent "transaction.booking" internal response

func MakeInternalBookingRS

func MakeInternalBookingRS(input BookingRS) (result *InternalBookingRS, err error)

MakeInternalBookingRS is a function to mapping from BookingRS to InternalBookingRS ("transaction.booking")

type InternalBookingWithArvInfoRS

type InternalBookingWithArvInfoRS struct {
	ErrCode interface{}        `json:"errCode"`
	ErrMsg  interface{}        `json:"errMsg"`
	Return  BookingWithArvInfo `json:"return"`
}

InternalBookingWithArvInfoRS represent "transaction.booking_with_arv_info" internal response

func MakeInternalBookingWithArvInfoRS

func MakeInternalBookingWithArvInfoRS(input BookingWithArvInfoRS) (result *InternalBookingWithArvInfoRS, err error)

MakeInternalBookingWithArvInfoRS is a function to mapping from BookingWithArvInfoRS to InternalBookingRS ("transaction.booking_with_arv_info")

type InternalCancelBookRS

type InternalCancelBookRS struct {
	ErrCode interface{} `json:"errCode"`
	ErrMsg  interface{} `json:"errMsg"`
	Return  CancelBook  `json:"return"`
}

InternalCancelBookRS represent "transaction.cancel_book" internal response

func MakeInternalCancelBookRS

func MakeInternalCancelBookRS(input CancelBookRS) (result *InternalCancelBookRS, err error)

MakeInternalCancelBookRS is a function to mapping from CancelBookRS to InternalCancelBookRS ("transaction.cancel_book")

type InternalCancelPaymentRS

type InternalCancelPaymentRS struct {
	ErrCode interface{}   `json:"errCode"`
	ErrMsg  interface{}   `json:"errMsg"`
	Return  CancelPayment `json:"return"`
}

InternalCancelPaymentRS represent "transaction.cancel_payment" internal response

func MakeInternalCancelPaymentRS

func MakeInternalCancelPaymentRS(input CancelPaymentRS) (result *InternalCancelPaymentRS, err error)

MakeInternalCancelPaymentRS is a function to mapping from CancelPaymentRS to InternalCancelPaymentRS ("transaction.cancel_payment")

type InternalGetAgentBalanceRS

type InternalGetAgentBalanceRS struct {
	ErrCode interface{}     `json:"errCode"`
	ErrMsg  interface{}     `json:"errMsg"`
	Return  GetAgentBalance `json:"return"`
}

InternalGetAgentBalanceRS represent "information.get_agent_balance" internal response

func MakeInternalGetAgentBalanceRS

func MakeInternalGetAgentBalanceRS(input GetAgentBalanceRS) (result *InternalGetAgentBalanceRS, err error)

MakeInternalGetAgentBalanceRS is a function to mapping from GetAgentBalanceRS to InternalGetAgentBalanceRS ("information.get_agent_balance")

type InternalGetBalanceRS

type InternalGetBalanceRS struct {
	ErrCode interface{} `json:"errCode"`
	ErrMsg  interface{} `json:"errMsg"`
	Return  GetBalance  `json:"return"`
}

InternalGetBalanceRS represent "information.get_balance" internal response

func MakeInternalGetBalanceRS

func MakeInternalGetBalanceRS(input GetBalanceRS) (result *InternalGetBalanceRS, err error)

MakeInternalGetBalanceRS is a function to mapping from GetBalanceRS to InternalGetAgentBalanceRS ("information.get_agent_balance")

type InternalGetBookInfoRS

type InternalGetBookInfoRS struct {
	ErrCode interface{} `json:"errCode"`
	ErrMsg  interface{} `json:"errMsg"`
	Return  GetBookInfo `json:"return"`
}

InternalGetBookInfoRS represent "information.get_book_info" internal response

func MakeInternalGetBookInfoRS

func MakeInternalGetBookInfoRS(input GetBookInfoRS) (result *InternalGetBookInfoRS, err error)

MakeInternalGetBookInfoRS is a function to mapping from GetBookInfoRS to InternalGetBookInfoRS ("information.get_book_info")

type InternalGetBookPriceInfoRS

type InternalGetBookPriceInfoRS struct {
	ErrCode interface{}      `json:"errCode"`
	ErrMsg  interface{}      `json:"errMsg"`
	Return  GetBookPriceInfo `json:"return"`
}

InternalGetBookPriceInfoRS represent "information.get_book_price_info" internal response

func MakeInternalGetBookPriceInfoRS

func MakeInternalGetBookPriceInfoRS(input GetBookPriceInfoRS) (result *InternalGetBookPriceInfoRS, err error)

MakeInternalGetBookPriceInfoRS is a function to mapping from GetBookPriceInfoRS to InternalGetBookPriceInfoRS ("information.get_book_price_info")

type InternalGetDestinationRS

type InternalGetDestinationRS struct {
	ErrCode interface{}   `json:"errCode"`
	ErrMsg  interface{}   `json:"errMsg"`
	Return  []Destination `json:"return"`
}

InternalGetDestinationRS represent "data.get_des" internal response

func MakeInternalGetDestinationRS

func MakeInternalGetDestinationRS(input GetDestinationRS) (result *InternalGetDestinationRS, err error)

MakeInternalGetDestinationRS is a function to mapping from GetDestinationRS to InternalGetDestinationRS ("data.get_des")

type InternalGetOriginationRS

type InternalGetOriginationRS struct {
	ErrCode interface{}   `json:"errCode"`
	ErrMsg  interface{}   `json:"errMsg"`
	Return  []Origination `json:"return"`
}

InternalGetOriginationRS represent "data.get_org" internal response

func MakeInternalGetOriginationRS

func MakeInternalGetOriginationRS(input GetOriginationRS) (result *InternalGetOriginationRS, err error)

MakeInternalGetOriginationRS is a function to mapping from GetOriginationRS to InternalGetOriginationRS ("data.get_org")

type InternalGetPayTypeRS

type InternalGetPayTypeRS struct {
	ErrCode interface{} `json:"errCode"`
	ErrMsg  interface{} `json:"errMsg"`
	Return  []PayType   `json:"return"`
}

InternalGetPayTypeRS represent "data.get_pay_type" internal response

func MakeInternalGetPayTypeRS

func MakeInternalGetPayTypeRS(input GetPayTypeRS) (result *InternalGetPayTypeRS, err error)

MakeInternalGetPayTypeRS is a function to mapping from GetPayTypeRS to InternalGetDestinationRS ("data.get_des")

type InternalGetScheduleLiteRS

type InternalGetScheduleLiteRS struct {
	ErrCode interface{}     `json:"errCode"`
	ErrMsg  interface{}     `json:"errMsg"`
	Return  GetScheduleLite `json:"return"`
}

InternalGetScheduleLiteRS represent "information.get_schedule" internal response

func MakeInternalGetScheduleLiteRS

func MakeInternalGetScheduleLiteRS(input GetScheduleLiteRS) (result *InternalGetScheduleLiteRS, err error)

MakeInternalGetScheduleLiteRS is a function to mapping from GetScheduleLiteRS to InternalGetScheduleLiteRS ("information.get_schedule_lite")

type InternalGetScheduleRS

type InternalGetScheduleRS struct {
	ErrCode interface{} `json:"errCode"`
	ErrMsg  interface{} `json:"errMsg"`
	Return  GetSchedule `json:"return"`
}

InternalGetScheduleRS represent "information.get_schedule" internal response

func MakeInternalGetScheduleRS

func MakeInternalGetScheduleRS(input GetScheduleRS) (result *InternalGetScheduleRS, err error)

MakeInternalGetScheduleRS is a function to mapping from GetScheduleRS to InternalGetScheduleRS ("information.get_schedule")

type InternalGetScheduleV2RS

type InternalGetScheduleV2RS struct {
	ErrCode interface{}   `json:"errCode"`
	ErrMsg  interface{}   `json:"errMsg"`
	Return  GetScheduleV2 `json:"return"`
}

InternalGetScheduleV2RS represent "information.get_schedule_v2" internal response

func MakeInternalGetScheduleV2RS

func MakeInternalGetScheduleV2RS(input GetScheduleV2RS) (result *InternalGetScheduleV2RS, err error)

MakeInternalGetScheduleV2RS is a function to mapping from GetScheduleV2RS to InternalGetScheduleV2RS ("information.get_schedule_v2")

type InternalGetSeatMapPerSubClassRS

type InternalGetSeatMapPerSubClassRS struct {
	ErrCode interface{}           `json:"errCode"`
	ErrMsg  interface{}           `json:"errMsg"`
	Return  GetSeatMapPerSubClass `json:"return"`
}

InternalGetSeatMapPerSubClassRS represent "information.get_seat_map_per_subclass" internal response

func MakeInternalGetSeatMapPerSubClassRS

func MakeInternalGetSeatMapPerSubClassRS(input GetSeatMapPerSubClassRS) (result *InternalGetSeatMapPerSubClassRS, err error)

MakeInternalGetSeatMapPerSubClassRS is a function to mapping from GetSeatMapPerSubClassRS to InternalGetSeatMapPerSubClassRS ("information.get_seat_map_per_subclass")

type InternalGetSeatMapRS

type InternalGetSeatMapRS struct {
	ErrCode interface{} `json:"errCode"`
	ErrMsg  interface{} `json:"errMsg"`
	Return  GetSeatMap  `json:"return"`
}

InternalGetSeatMapRS represent "information.get_seat_map" internal response

func MakeInternalGetSeatMapRS

func MakeInternalGetSeatMapRS(input GetSeatMapRS) (result *InternalGetSeatMapRS, err error)

MakeInternalGetSeatMapRS is a function to mapping from GetSeatMapRS to InternalGetScheduleLiteRS ("information.get_seat_map")

type InternalGetSeatNullPerSubClassRS

type InternalGetSeatNullPerSubClassRS struct {
	ErrCode interface{}            `json:"errCode"`
	ErrMsg  interface{}            `json:"errMsg"`
	Return  GetSeatNullPerSubClass `json:"return"`
}

InternalGetSeatNullPerSubClassRS represent "information.get_set_null_per_subclass" internal response

func MakeInternalGetSeatNullPerSubClassRS

func MakeInternalGetSeatNullPerSubClassRS(input GetSeatNullPerSubClassRS) (result *InternalGetSeatNullPerSubClassRS, err error)

MakeInternalGetSeatNullPerSubClassRS is a function to mapping from GetSeatNullPerSubClassRS to InternalGetSeatNullPerSubClassRS ("information.get_seat_null_per_subclass")

type InternalGetSeatNullRS

type InternalGetSeatNullRS struct {
	ErrCode interface{} `json:"errCode"`
	ErrMsg  interface{} `json:"errMsg"`
	Return  GetSeatNull `json:"return"`
}

InternalGetSeatNullRS represent "information.get_seat_null" internal response

func MakeInternalGetSeatNullRS

func MakeInternalGetSeatNullRS(input GetSeatNullRS) (result *InternalGetSeatNullRS, err error)

MakeInternalGetSeatNullRS is a function to mapping from GetSeatNullRS to InternalGetSeatNullRS ("information.get_seat_null")

type InternalManualSeatRS

type InternalManualSeatRS struct {
	ErrCode interface{} `json:"errCode"`
	ErrMsg  interface{} `json:"errMsg"`
	Return  ManualSeat  `json:"return"`
}

InternalManualSeatRS represent "transaction.manual_seat" internal response

func MakeInternalManualSeatRS

func MakeInternalManualSeatRS(input ManualSeatRS) (result *InternalManualSeatRS, err error)

MakeInternalManualSeatRS is a function to mapping from ManualSeatRS to InternalManualSeatRS ("transaction.manual_seat")

type InternalPaymentRS

type InternalPaymentRS struct {
	ErrCode interface{} `json:"errCode"`
	ErrMsg  interface{} `json:"errMsg"`
	Return  Payment     `json:"return"`
}

InternalPaymentRS represent "transaction.payment" internal response

func MakeInternalPaymentRS

func MakeInternalPaymentRS(input PaymentRS) (result *InternalPaymentRS, err error)

MakeInternalPaymentRS is a function to mapping from PaymentRS to InternalPaymentRS ("transaction.payment")

type InternalUpdatePaxRS

type InternalUpdatePaxRS struct {
	ErrCode interface{} `json:"errCode"`
	ErrMsg  interface{} `json:"errMsg"`
	Return  UpdatePax   `json:"return"`
}

InternalUpdatePaxRS represent "information.update_pax" internal response

func MakeInternalUpdatePaxRS

func MakeInternalUpdatePaxRS(input UpdatePaxRS) (result *InternalUpdatePaxRS, err error)

MakeInternalUpdatePaxRS is a function to mapping from UpdatePaxRS to InternalUpdatePaxRS ("transaction.update_pax")

type KAIHttpClient

type KAIHttpClient struct {
	KAIQueryString      string
	KAIResponseBody     []byte
	KAIRealResponseBody []byte
	// contains filtered or unexported fields
}

KAIHttpClient struct hold all the information about KAI HTTP Client, request and response of the server

func NewKAIHttpClient

func NewKAIHttpClient(httpClient *http.Client, serverURL string, rqid string) (*KAIHttpClient, error)

NewKAIHttpClient return new *KAIHttpClient to handle the requests to KAI HTTP Server

func (*KAIHttpClient) Call

func (c *KAIHttpClient) Call(module string, action string, params map[string]string, debug bool) (err error)

Call call's the module and action with Params

func (*KAIHttpClient) CallBooking

func (c *KAIHttpClient) CallBooking(params map[string]string, debug bool) (*InternalBookingRS, error)

CallBooking is a function to call KAI "transaction.booking" method

func (*KAIHttpClient) CallBookingWithArvInfo

func (c *KAIHttpClient) CallBookingWithArvInfo(params map[string]string, debug bool) (*InternalBookingWithArvInfoRS, error)

CallBookingWithArvInfo is a function to call KAI "transaction.booking_with_arv_info" method

func (*KAIHttpClient) CallCancelBook

func (c *KAIHttpClient) CallCancelBook(params map[string]string, debug bool) (*InternalCancelBookRS, error)

CallCancelBook is a function to call KAI "transaction.cancel_book" method

func (*KAIHttpClient) CallCancelPayment

func (c *KAIHttpClient) CallCancelPayment(params map[string]string, debug bool) (*InternalCancelPaymentRS, error)

CallCancelPayment is a function to call KAI "transaction.cancel_payment" method

func (*KAIHttpClient) CallGetAgentBalance

func (c *KAIHttpClient) CallGetAgentBalance(debug bool) (*InternalGetAgentBalanceRS, error)

CallGetAgentBalance is a function to call KAI "information.get_agent_balance" method

func (*KAIHttpClient) CallGetBalance

func (c *KAIHttpClient) CallGetBalance(params map[string]string, debug bool) (*InternalGetBalanceRS, error)

CallGetBalance is a function to call KAI "information.get_balance" method

func (*KAIHttpClient) CallGetBookInfo

func (c *KAIHttpClient) CallGetBookInfo(params map[string]string, debug bool) (*InternalGetBookInfoRS, error)

CallGetBookInfo is a function to call KAI "information.get_book_info" method

func (*KAIHttpClient) CallGetBookPriceInfo

func (c *KAIHttpClient) CallGetBookPriceInfo(params map[string]string, debug bool) (*InternalGetBookPriceInfoRS, error)

CallGetBookPriceInfo is a function to call KAI "information.get_book_price_info" method

func (*KAIHttpClient) CallGetDestination

func (c *KAIHttpClient) CallGetDestination(debug bool) (*InternalGetDestinationRS, error)

CallGetDestination is a function to call KAI "data.get_des" method

func (*KAIHttpClient) CallGetOrigination

func (c *KAIHttpClient) CallGetOrigination(debug bool) (*InternalGetOriginationRS, error)

CallGetOrigination is a function to call KAI "data.get_org" method

func (*KAIHttpClient) CallGetPayType

func (c *KAIHttpClient) CallGetPayType(debug bool) (*InternalGetPayTypeRS, error)

CallGetPayType is a function to call KAI "data.get_pay_type" method

func (*KAIHttpClient) CallGetSchedule

func (c *KAIHttpClient) CallGetSchedule(params map[string]string, debug bool) (*InternalGetScheduleRS, error)

CallGetSchedule is a function to call KAI "information.get_schedule" method

func (*KAIHttpClient) CallGetScheduleLite

func (c *KAIHttpClient) CallGetScheduleLite(params map[string]string, debug bool) (*InternalGetScheduleLiteRS, error)

CallGetScheduleLite is a function to call KAI "information.get_schedule_lite" method

func (*KAIHttpClient) CallGetScheduleV2

func (c *KAIHttpClient) CallGetScheduleV2(params map[string]string, debug bool) (*InternalGetScheduleV2RS, error)

CallGetScheduleV2 is a function to call KAI "information.get_schedule_v2" method

func (*KAIHttpClient) CallGetSeatMap

func (c *KAIHttpClient) CallGetSeatMap(params map[string]string, debug bool) (*InternalGetSeatMapRS, error)

CallGetSeatMap is a function to call KAI "information.get_seat_map" method

func (*KAIHttpClient) CallGetSeatMapPerSubClass

func (c *KAIHttpClient) CallGetSeatMapPerSubClass(params map[string]string, debug bool) (*InternalGetSeatMapPerSubClassRS, error)

CallGetSeatMapPerSubClass is a function to call KAI "information.get_seat_map_per_subclass" method

func (*KAIHttpClient) CallGetSeatNull

func (c *KAIHttpClient) CallGetSeatNull(params map[string]string, debug bool) (*InternalGetSeatNullRS, error)

CallGetSeatNull is a function to call KAI "information.get_seat_null" method

func (*KAIHttpClient) CallGetSeatNullPerSubClass

func (c *KAIHttpClient) CallGetSeatNullPerSubClass(params map[string]string, debug bool) (*InternalGetSeatNullPerSubClassRS, error)

CallGetSeatNullPerSubClass is a function to call KAI "information.get_seat_null_per_subclass" method

func (*KAIHttpClient) CallManualSeat

func (c *KAIHttpClient) CallManualSeat(params map[string]string, debug bool) (*InternalManualSeatRS, error)

CallManualSeat is a function to call KAI "transaction.manual_seat" method

func (*KAIHttpClient) CallPayment

func (c *KAIHttpClient) CallPayment(params map[string]string, debug bool) (*InternalPaymentRS, error)

CallPayment is a function to call KAI "transaction.payment" method

func (*KAIHttpClient) CallUpdatePax

func (c *KAIHttpClient) CallUpdatePax(params map[string]string, debug bool) (*InternalUpdatePaxRS, error)

CallUpdatePax is a function to call KAI "transaction.update_pax" method

func (*KAIHttpClient) SetUserAgent

func (c *KAIHttpClient) SetUserAgent(value string)

SetUserAgent is a function to set "User-Agent" http header

type ManualSeat

type ManualSeat struct {
	BookCode  string  `json:"bookCode"`
	WagonCode string  `json:"wagonCode"`
	WagonNo   int64   `json:"wagonNo"`
	Seats     []SeatM `json:"seats"`
}

ManualSeat type

type ManualSeatRS

type ManualSeatRS struct {
	ErrCode   interface{}   `json:"err_code"`
	ErrMsg    interface{}   `json:"err_msg"`
	BookCode  string        `json:"book_code"`
	WagonCode string        `json:"wagon_code"`
	WagonNo   int64         `json:"wagon_no"`
	Seats     []interface{} `json:"seat"`
}

ManualSeatRS represent "transaction.manual_seat" response

type Origination

type Origination struct {
	OriginCode string `json:"OriginCode"`
	OriginName string `json:"OriginName"`
}

Origination type

type PaxList

type PaxList struct {
	PaxName                   string      `json:"paxName"`
	IdentityNo                string      `json:"IdentityNo"`
	PaxType                   string      `json:"paxType"`
	TicketUnitNo              string      `json:"ticketUnitNo"`
	TicketUnitPrintingCounter interface{} `json:"ticketUnitPrintingCounter"`
	ETicketNo                 string      `json:"eTicketNo"`
	ETicketPrintingCounter    interface{} `json:"eTicketPrintingCounter"`
	Wagon                     string      `json:"wagon"`
	Seat                      string      `json:"seat"`
}

PaxList type

type PaxName

type PaxName struct {
	Name string `json:"name"`
}

PaxName type

type PaxNum

type PaxNum struct {
	AdultCount  int `json:"adultCount"`
	ChildCount  int `json:"childCount"`
	InfantCount int `json:"infantCount"`
}

PaxNum type

type PaxSeat

type PaxSeat struct {
	WagonCode string `json:"wagonCode"`
	WagonNo   string `json:"wagonNo"`
	SeatRow   string `json:"seatRow"`
	SeatCol   string `json:"seatCol"`
}

PaxSeat type

type PayType

type PayType struct {
	Name string `json:"name"`
}

PayType type

type Payment

type Payment struct {
	BookCode    string  `json:"bookCode"`
	BookBalance float64 `json:"bookBalance"`
}

Payment type

type PaymentRS

type PaymentRS struct {
	ErrCode     interface{} `json:"err_code"`
	ErrMsg      interface{} `json:"err_msg"`
	BookCode    string      `json:"book_code"`
	BookBalance float64     `json:"book_balance"`
}

PaymentRS represent "transaction.payment" response

type Schedule

type Schedule struct {
	TrainNo       string          `json:"trainNo"`
	TrainName     string          `json:"trainName"`
	DepartureTime string          `json:"departureTime"`
	ArriveTime    string          `json:"arriveTime"`
	AvailSubClass []AvailSubClass `json:"availSubClass"`
}

Schedule type

type ScheduleLite

type ScheduleLite struct {
	TrainNo       string              `json:"trainNo"`
	TrainName     string              `json:"trainName"`
	DepartureDate string              `json:"departureDate"`
	ArriveDate    string              `json:"arriveDate"`
	DepartureTime string              `json:"departureTime"`
	ArriveTime    string              `json:"arriveTime"`
	AvailSubClass []AvailSubClassLite `json:"availSubClass"`
}

ScheduleLite type

type ScheduleV2

type ScheduleV2 struct {
	TrainNo       string            `json:"trainNo"`
	TrainName     string            `json:"trainName"`
	DepartureDate string            `json:"departureDate"`
	ArriveDate    string            `json:"arriveDate"`
	DepartureTime string            `json:"departureTime"`
	ArriveTime    string            `json:"arriveTime"`
	AvailSubClass []AvailSubClassV2 `json:"availSubClass"`
}

ScheduleV2 type

type Seat

type Seat struct {
	Row        float64 `json:"row"`
	Column     float64 `json:"column"`
	SeatRow    float64 `json:"seatRow"`
	SeatColumn string  `json:"seatColumn"`
	SubClass   string  `json:"seatClass"`
	Status     float64 `json:"status"`
}

Seat type

type SeatM

type SeatM struct {
	SeatNo string `json:"seatNo"`
}

SeatM type

type SeatMap

type SeatMap struct {
	WagonCode string  `json:"wagonCode"`
	WagonNo   float64 `json:"wagonNo"`
	Seats     []Seat  `json:"seats"`
}

SeatMap type

type SeatN

type SeatN struct {
	SeatRow    float64 `json:"seatRow"`
	SeatColumn string  `json:"seatColumn"`
	SubClass   string  `json:"seatClass"`
	Status     float64 `json:"status"`
}

SeatN type

type SeatNull

type SeatNull struct {
	WagonCode string  `json:"wagonCode"`
	WagonNo   float64 `json:"wagonNo"`
	Seats     []SeatN `json:"seats"`
}

SeatNull type

type StdKAIErrorMessage

type StdKAIErrorMessage struct {
	ErrCode string `json:"err_code"`
	ErrMsg  string `json:"err_msg"`
}

StdKAIErrorMessage type

type UpdatePax

type UpdatePax struct {
	BookCode string    `json:"bookCode"`
	PaxNums  PaxNum    `json:"paxNums"`
	PaxNames []PaxName `json:"paxNames"`
}

UpdatePax type

type UpdatePaxRS

type UpdatePaxRS struct {
	ErrCode  interface{}   `json:"err_code"`
	ErrMsg   interface{}   `json:"err_msg"`
	BookCode string        `json:"book_code"`
	PaxNums  []int         `json:"pax_num"`
	PaxNames []interface{} `json:"pax_name"`
}

UpdatePaxRS represent "transaction.update_pax" response

Jump to

Keyboard shortcuts

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