apis_pkg

package
v0.0.0-...-bfb5fe6 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2020 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIS

type APIS interface {
	GetRealtimeWeather(string, *string) (*models_pkg.CurrentJsonResponse, error)

	GetForecastWeather(string, int64, *time.Time, *int64, *int64, *string) (*models_pkg.ForecastJsonResponse, error)

	GetHistoryWeather(string, *time.Time, *int64, *time.Time, *int64, *int64, *string) (*models_pkg.HistoryJsonResponse, error)

	SearchAutocompleteWeather(string) ([]*models_pkg.SearchJsonResponse, error)

	GetIpLookup(string) (*models_pkg.IpJsonResponse, error)

	GetTimeZone(string) (*models_pkg.TimezoneJsonResponse, error)

	GetAstronomy(string, *time.Time) (*models_pkg.AstronomyJsonResponse, error)
}

* Interface for the APIS_IMPL

type APIS_IMPL

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

* Client structure as interface implementation

func NewAPIS

func NewAPIS(config configuration_pkg.CONFIGURATION) *APIS_IMPL

* Factory for the APIS interaface returning APIS_IMPL

func (*APIS_IMPL) GetAstronomy

func (me *APIS_IMPL) GetAstronomy(
	q string,
	dt *time.Time) (*models_pkg.AstronomyJsonResponse, error)

*

  • Return Location and Astronomy Object
  • @param string q parameter: Required
  • @param *time.Time dt parameter: Required
  • @return Returns the *models_pkg.AstronomyJsonResponse response from the API call

func (*APIS_IMPL) GetForecastWeather

func (me *APIS_IMPL) GetForecastWeather(
	q string,
	days int64,
	dt *time.Time,
	unixdt *int64,
	hour *int64,
	lang *string) (*models_pkg.ForecastJsonResponse, error)

*

  • Forecast weather API method returns upto next 10 day weather forecast and weather alert as json. The data is returned as a Forecast Object.<br />Forecast object contains astronomy data, day weather forecast and hourly interval weather information for a given city.
  • @param string q parameter: Required
  • @param int64 days parameter: Required
  • @param *time.Time dt parameter: Optional
  • @param *int64 unixdt parameter: Optional
  • @param *int64 hour parameter: Optional
  • @param *string lang parameter: Optional
  • @return Returns the *models_pkg.ForecastJsonResponse response from the API call

func (*APIS_IMPL) GetHistoryWeather

func (me *APIS_IMPL) GetHistoryWeather(
	q string,
	dt *time.Time,
	unixdt *int64,
	endDt *time.Time,
	unixendDt *int64,
	hour *int64,
	lang *string) (*models_pkg.HistoryJsonResponse, error)

*

  • History weather API method returns historical weather for a date on or after 1st Jan, 2015 as json. The data is returned as a Forecast Object.
  • @param string q parameter: Required
  • @param *time.Time dt parameter: Required
  • @param *int64 unixdt parameter: Optional
  • @param *time.Time endDt parameter: Optional
  • @param *int64 unixendDt parameter: Optional
  • @param *int64 hour parameter: Optional
  • @param *string lang parameter: Optional
  • @return Returns the *models_pkg.HistoryJsonResponse response from the API call

func (*APIS_IMPL) GetIpLookup

func (me *APIS_IMPL) GetIpLookup(
	q string) (*models_pkg.IpJsonResponse, error)

*

  • IP Lookup API method allows a user to get up to date information for an IP address.
  • @param string q parameter: Required
  • @return Returns the *models_pkg.IpJsonResponse response from the API call

func (*APIS_IMPL) GetRealtimeWeather

func (me *APIS_IMPL) GetRealtimeWeather(
	q string,
	lang *string) (*models_pkg.CurrentJsonResponse, error)

*

  • Current weather or realtime weather API method allows a user to get up to date current weather information in json and xml. The data is returned as a Current Object.Current object contains current or realtime weather information for a given city.
  • @param string q parameter: Required
  • @param *string lang parameter: Optional
  • @return Returns the *models_pkg.CurrentJsonResponse response from the API call

func (*APIS_IMPL) GetTimeZone

func (me *APIS_IMPL) GetTimeZone(
	q string) (*models_pkg.TimezoneJsonResponse, error)

*

  • Return Location Object
  • @param string q parameter: Required
  • @return Returns the *models_pkg.TimezoneJsonResponse response from the API call

func (*APIS_IMPL) SearchAutocompleteWeather

func (me *APIS_IMPL) SearchAutocompleteWeather(
	q string) ([]*models_pkg.SearchJsonResponse, error)

*

  • WeatherAPI.com Search or Autocomplete API returns matching cities and towns as an array of Location object.
  • @param string q parameter: Required
  • @return Returns the []*models_pkg.SearchJsonResponse response from the API call

Jump to

Keyboard shortcuts

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