repositories

package
v0.0.0-...-04f5f38 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2020 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type WeatherRepository

type WeatherRepository interface {
	FetchData(context.Context, models.CityData) error
	GetData(context.Context, string) (*models.CityData, error)
}

WeatherRepository implements all methods in WeatherRepository

func NewWeatherRepositoryImpl

func NewWeatherRepositoryImpl(db *gorm.DB) WeatherRepository

NewWeatherRepositoryImpl dependencies of Database

type WeatherRepositoryImpl

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

WeatherRepositoryImpl **

func (WeatherRepositoryImpl) FetchData

func (repositoryImpl WeatherRepositoryImpl) FetchData(ctx context.Context, city models.CityData) (err error)

FetchData Function to fetch & store the Data from the Weather API

func (WeatherRepositoryImpl) GetData

func (repositoryImpl WeatherRepositoryImpl) GetData(ctx context.Context, cityName string) (*models.CityData, error)

GetData Handler Function to get the data for the city from DB

Jump to

Keyboard shortcuts

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