population

package
v2.2.1 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2024 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 Server

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

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

func (*Server) GetForAgeBracket added in v2.2.0

func (s *Server) GetForAgeBracket(arguments bracket.Bracket) int

GetForAgeBracket 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) GetForRegion added in v2.2.0

func (s *Server) GetForRegion(region string) int

GetForRegion returns the number of people in each region

func (*Server) Run

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

Run imports the latest demographics data on a regular basis

type Waiter

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

func (*Waiter) Ready

func (w *Waiter) Ready()

func (*Waiter) WaitTillReady

func (w *Waiter) WaitTillReady(ctx context.Context) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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