demographics

package
v1.16.0 Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Fetcher added in v1.9.1

type Fetcher interface {
	// GetByAgeBracket returns the demographics for the specified AgeBracket
	GetByAgeBracket(arguments bracket.Bracket) (count int)
	// GetByRegion returns the demographics grouped by region
	GetByRegion() (figures map[string]int)
	// Run updates demographics and refreshes them on a periodic basis
	Run(ctx context.Context)
}

Fetcher interface for population data

type Server added in v1.4.0

type Server struct {
	Path     string
	Interval time.Duration
	// contains filtered or unexported fields
}

Server imports the demographics data on a regular basis and exposes data APIs to callers

func (*Server) GetByAgeBracket added in v1.9.1

func (s *Server) GetByAgeBracket(arguments bracket.Bracket) (response int)

GetByAgeBracket returns the number of people within a specific age bracket. Set High to math.Inf(+1) to return all people older than a given age

func (*Server) GetByRegion added in v1.4.0

func (s *Server) GetByRegion() (response map[string]int)

GetByRegion returns the number of people in each region

func (*Server) Run added in v1.4.0

func (s *Server) Run(ctx context.Context)

Run imports the latest demographics data on a regular basis

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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