tankerapi

package
v0.2.3 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2022 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrTooMuchRequests = errors.New("too much api requests, retry in 5 minutes")

Functions

This section is empty.

Types

type Client

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

func NewClient

func NewClient(
	logger *zap.SugaredLogger,
	baseURL string,
	apiKey string,
	searchLat string,
	searchLng string,
	searchRadius string,
	backOffTime *time.Duration,
) *Client

func (*Client) GetFuelStationByID added in v0.2.0

func (c *Client) GetFuelStationByID(ctx context.Context, id string) (*entities.Station, error)

func (*Client) GetFuelStations

func (c *Client) GetFuelStations(ctx context.Context) ([]entities.Station, error)

func (*Client) GetFuelStationsDetails added in v0.2.0

func (c *Client) GetFuelStationsDetails(
	ctx context.Context,
	stationsIDs []string,
	outputStations chan<- entities.Station,
) error

type Model

type Model struct {
	ID           uuid.UUID      `json:"id"`
	Name         string         `json:"name"`
	Brand        string         `json:"brand"`
	Street       string         `json:"street"`
	Place        string         `json:"place"`
	Lat          float64        `json:"lat"`
	Lng          float64        `json:"lng"`
	Distance     float64        `json:"distance"`
	Diesel       *float64       `json:"diesel,omitempty"`
	E5           *float64       `json:"e5,omitempty"`
	E10          *float64       `json:"e10,omitempty"`
	IsOpen       bool           `json:"isOpen,omitempty"`
	HouseNumber  *string        `json:"houseNumber,omitempty"`
	PostCode     int            `json:"postCode"`
	OpeningTimes []OpeningTimes `json:"openingTimes"`
}

type OpeningTimes added in v0.2.0

type OpeningTimes struct {
	Text  string `json:"text"`
	Start string `json:"start"`
	End   string `json:"end"`
}

Jump to

Keyboard shortcuts

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