worldota

package module
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2022 License: MIT Imports: 9 Imported by: 0

README

worldota-sdk-go

Golang SDK for ETG APIv3.

Installation

go get github.com/molodsom/worldota-sdk-go

Quickstart

To start using ETG APIv3 you need a key, which you received after registration. A key is a combination of an id and uuid. These are passed into each request as a Basic Auth header after initialization.

Then you can use almost all available methods. Say you want to check an overview of the available methods (which is api/b2b/v3/overview endpoint), you do:

package main

import "github.com/molodsom/worldota-sdk-go"

func main() {
	c := worldota.Client("0000", "b85ae9bc-30d2-4607-8a7f-53c673a001dd")
	c.Overview() // models.Overview
}

Another example is downloading hotels dump with api/b2b/v3/hotel/info/dump endpoint:

package main

import (
	"fmt"
	"github.com/molodsom/worldota-sdk-go"
	"github.com/molodsom/worldota-sdk-go/models"
)

func main() {
	c := worldota.Client("0000", "b85ae9bc-30d2-4607-8a7f-53c673a001dd")
	r := c.HotelInfoDump(models.LanguageRequest{Language: "pt"}) // models.HotelDump
	fmt.Println(*r.Data.URL)
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIClient

type APIClient struct {
	http.Client
}

func Client

func Client(id, token string) (c APIClient)

func (APIClient) HotelInfo added in v0.1.2

func (c APIClient) HotelInfo(req models.HotelInfoRequest) (res models.HotelInfo)

func (APIClient) HotelInfoDump added in v0.1.2

func (c APIClient) HotelInfoDump(req models.LanguageRequest) (res models.HotelDump)

func (APIClient) HotelInfoIncrementalDump added in v0.1.2

func (c APIClient) HotelInfoIncrementalDump(req models.LanguageRequest) (res models.HotelDump)

func (APIClient) HotelRegionDump added in v0.1.2

func (c APIClient) HotelRegionDump(req models.LanguageRequest) (res models.HotelDump)

func (APIClient) HotelReviewsDump added in v0.1.2

func (c APIClient) HotelReviewsDump(req models.LanguageRequest) (res models.HotelDump)

func (APIClient) Overview added in v0.1.2

func (c APIClient) Overview() (res models.Overview)

func (APIClient) SearchHotelPage added in v0.1.2

func (c APIClient) SearchHotelPage(req models.SearchHotelPage) (res models.SearchResult)

func (APIClient) SearchMulticomplete added in v0.1.2

func (c APIClient) SearchMulticomplete(req models.SearchMulticompleteRequest) (res models.SearchMulticomplete)

func (APIClient) SearchSERPGeo added in v0.1.2

func (c APIClient) SearchSERPGeo(req models.SearchGeoRequest) (res models.SearchResult)

func (APIClient) SearchSERPHotels added in v0.1.2

func (c APIClient) SearchSERPHotels(req models.SearchHotelsRequest) (res models.SearchResult)

func (APIClient) SearchSERPRegion added in v0.1.2

func (c APIClient) SearchSERPRegion(req models.SearchRegionRequest) (res models.SearchResult)

type APIRoundTripper

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

func (APIRoundTripper) RoundTrip

func (rt APIRoundTripper) RoundTrip(r *http.Request) (*http.Response, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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