Skip to content

Commit

Permalink
Added JSON and BSON support
Browse files Browse the repository at this point in the history
  • Loading branch information
liderman committed Nov 26, 2016
1 parent e645df0 commit 010b43f
Show file tree
Hide file tree
Showing 9 changed files with 52 additions and 52 deletions.
14 changes: 7 additions & 7 deletions countries.go
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
package kiwitaxi

type Country struct {
Id int `csv:"id"`
Iata string `csv:"iata"`
Published int `csv:"published"`
NameEn string `csv:"name_en"`
NameRu string `csv:"name_ru"`
CurrencyId int `csv:"currency_id"`
TimeZone string `csv:"time_zone"`
Id int `csv:"id" json:"id" bson:"id"`
Iata string `csv:"iata" json:"iata" bson:"iata"`
Published int `csv:"published" json:"published" bson:"published"`
NameEn string `csv:"name_en" json:"name_en" bson:"name_en"`
NameRu string `csv:"name_ru" json:"name_ru" bson:"name_ru"`
CurrencyId int `csv:"currency_id" json:"currency_id" bson:"currency_id"`
TimeZone string `csv:"time_zone" json:"time_zone" bson:"time_zone"`
}

func (a *KiwitaxiApi) Countries() (countries []*Country, err error) {
Expand Down
6 changes: 3 additions & 3 deletions currencies.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package kiwitaxi

type Currency struct {
Id int `csv:"id"`
Code string `csv:"code"`
Iso int `csv:"iso"`
Id int `csv:"id" json:"id" bson:"id"`
Code string `csv:"code" json:"code" bson:"code"`
Iso int `csv:"iso" json:"iso" bson:"iso"`
}

func (a *KiwitaxiApi) Currencies() (currencies []*Currency, err error) {
Expand Down
6 changes: 3 additions & 3 deletions place-types.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package kiwitaxi

type PlaceType struct {
Id int `csv:"id"`
NameEn string `csv:"name_en"`
NameRu string `csv:"name_ru"`
Id int `csv:"id" json:"id" bson:"id"`
NameEn string `csv:"name_en" json:"name_en" bson:"name_en"`
NameRu string `csv:"name_ru" json:"name_ru" bson:"name_ru"`
}

func (a *KiwitaxiApi) PlaceTypes() (placeTypes []*PlaceType, err error) {
Expand Down
16 changes: 8 additions & 8 deletions places.go
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
package kiwitaxi

type Place struct {
Id int `csv:"id"`
CountryId int `csv:"country_id"`
RegionId int `csv:"region_id"`
TypeId int `csv:"type_id"`
NameEn string `csv:"name_en"`
NameRu string `csv:"name_ru"`
Iata string `csv:"iata"`
PlacePolygon string `csv:"place_polygon"`
Id int `csv:"id" json:"id" bson:"id"`
CountryId int `csv:"country_id" json:"country_id" bson:"country_id"`
RegionId int `csv:"region_id" json:"region_id" bson:"region_id"`
TypeId int `csv:"type_id" json:"type_id" bson:"type_id"`
NameEn string `csv:"name_en" json:"name_en" bson:"name_en"`
NameRu string `csv:"name_ru" json:"name_ru" bson:"name_ru"`
Iata string `csv:"iata" json:"iata" bson:"iata"`
PlacePolygon string `csv:"place_polygon" json:"place_polygon" bson:"place_polygon"`
}

func (a *KiwitaxiApi) Places() (places []*Place, err error) {
Expand Down
8 changes: 4 additions & 4 deletions regions.go
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package kiwitaxi

type Region struct {
Id int `csv:"id"`
CountryId int `csv:"country_id"`
NameEn string `csv:"name_en"`
NameRu string `csv:"name_ru"`
Id int `csv:"id" json:"id" bson:"id"`
CountryId int `csv:"country_id" json:"country_id" bson:"country_id"`
NameEn string `csv:"name_en" json:"name_en" bson:"name_en"`
NameRu string `csv:"name_ru" json:"name_ru" bson:"name_ru"`
}

func (a *KiwitaxiApi) Regions() (regions []*Region, err error) {
Expand Down
16 changes: 8 additions & 8 deletions routes.go
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
package kiwitaxi

type Route struct {
Id int `csv:"id"`
CountryId int `csv:"country_id"`
PlaceFromId int `csv:"place_from_id"`
PlaceToId int `csv:"place_to_id"`
Distance int `csv:"distance"`
Timeinway int `csv:"timeinway"`
Weight float64 `csv:"weight"`
Url string `csv:"url"`
Id int `csv:"id" json:"id" bson:"id"`
CountryId int `csv:"country_id" json:"country_id" bson:"country_id"`
PlaceFromId int `csv:"place_from_id" json:"place_from_id" bson:"place_from_id"`
PlaceToId int `csv:"place_to_id" json:"place_to_id" bson:"place_to_id"`
Distance int `csv:"distance" json:"distance" bson:"distance"`
Timeinway int `csv:"timeinway" json:"timeinway" bson:"timeinway"`
Weight float64 `csv:"weight" json:"weight" bson:"weight"`
Url string `csv:"url" json:"url" bson:"url"`
}

func (a *KiwitaxiApi) Routes() (routes []*Route, err error) {
Expand Down
18 changes: 9 additions & 9 deletions transfer-types.go
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
package kiwitaxi

type TransferType struct {
Id int `csv:"id"`
NameEn string `csv:"name_en"`
NameRu string `csv:"name_ru"`
Pax int `csv:"pax"`
Baggage int `csv:"baggage"`
DescriptionEn string `csv:"description_en"`
DescriptionRu string `csv:"description_ru"`
Photo string `csv:"photo"`
Sortno int `csv:"sortno"`
Id int `csv:"id" json:"id" bson:"id"`
NameEn string `csv:"name_en" json:"name_en" bson:"name_en"`
NameRu string `csv:"name_ru" json:"name_ru" bson:"name_ru"`
Pax int `csv:"pax" json:"pax" bson:"pax"`
Baggage int `csv:"baggage" json:"baggage" bson:"baggage"`
DescriptionEn string `csv:"description_en" json:"description_en" bson:"description_en"`
DescriptionRu string `csv:"description_ru" json:"description_ru" bson:"description_ru"`
Photo string `csv:"photo" json:"photo" bson:"photo"`
Sortno int `csv:"sortno" json:"sortno" bson:"sortno"`
}

func (a *KiwitaxiApi) TransferTypes() (transferTypes []*TransferType, err error) {
Expand Down
14 changes: 7 additions & 7 deletions transfers.go
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
package kiwitaxi

type Transfer struct {
Id int `csv:"id"`
RouteId int `csv:"route_id"`
TypeId int `csv:"type_id"`
PriceRub float64 `csv:"price_rub"`
PriceEur float64 `csv:"price_eur"`
PriceUsd float64 `csv:"price_usd"`
Url string `csv:"url"`
Id int `csv:"id" json:"id" bson:"id"`
RouteId int `csv:"route_id" json:"route_id" bson:"route_id"`
TypeId int `csv:"type_id" json:"type_id" bson:"type_id"`
PriceRub float64 `csv:"price_rub" json:"price_rub" bson:"price_rub"`
PriceEur float64 `csv:"price_eur" json:"price_eur" bson:"price_eur"`
PriceUsd float64 `csv:"price_usd" json:"price_usd" bson:"price_usd"`
Url string `csv:"url" json:"url" bson:"url"`
}

func (a *KiwitaxiApi) Transfers(paymentType string) (transfers []*Transfer, err error) {
Expand Down
6 changes: 3 additions & 3 deletions url-domains.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package kiwitaxi

type UrlDomain struct {
Id int `csv:"id"`
Locale string `csv:"locale"`
Value string `csv:"value"`
Id int `csv:"id" json:"id" bson:"id"`
Locale string `csv:"locale" json:"locale" bson:"locale"`
Value string `csv:"value" json:"value" bson:"value"`
}

func (a *KiwitaxiApi) UrlDomains() (urlDomains []*UrlDomain, err error) {
Expand Down

0 comments on commit 010b43f

Please # to comment.