traffic

package
v0.0.0-...-bcb8294 Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2023 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 Data

type Data struct {
	DeviceID     string    `json:"deviceid"`
	CountedCars  int       `json:"countedcars"`
	ProcessTime  time.Time `json:"appprocesstime"`
	RoadName     string    `json:"road_name"`
	RoadInfo     string    `json:"road_info"`
	AverageSpeed float64   `json:"average_speed"`
}

Data describes the data returned by the traffic API.

type Endpoint

type Endpoint struct{}

Endpoint is traffic API endpoint.

func (Endpoint) GetName

func (v Endpoint) GetName() string

GetName returns the endpoint name.

func (Endpoint) GetPath

func (v Endpoint) GetPath() string

GetPath returns the endpoint path.

type List

type List []Data

List is a representation of a Data array.

func Get

func Get(client *api.Client, params *api.GetParams) (List, error)

Get returns a list of Attica traffic data found based on the given parameters.

func (List) FilterByRoadName

func (l List) FilterByRoadName(roadName string) List

FilterByRoadName filters a traffic List by the road name and returns a new list that contains only the filtered data.

Jump to

Keyboard shortcuts

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