callsforservice

package
v0.0.0-...-268a1c9 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2021 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ScraperName  = "CALLS-FOR-SERVICE"
	CFS2011URL   = "https://data.nola.gov/resource/28ec-c8d6.json"
	CFS2012URL   = "https://data.nola.gov/resource/rv3g-ypg7.json"
	CFS2013URL   = "https://data.nola.gov/resource/5fn8-vtui.json"
	CFS2014URL   = "https://data.nola.gov/resource/jsyu-nz5r.json"
	CFS2015URL   = "https://data.nola.gov/resource/w68y-xmk6.json"
	CFS2016URL   = "https://data.nola.gov/resource/wgrp-d3ma.json"
	CFS2017URL   = "https://data.nola.gov/resource/bqmt-f3jk.json"
	CFS2018URL   = "https://data.nola.gov/resource/9san-ivhk.json"
	CFS2019URL   = "https://data.nola.gov/resource/qf6q-pp4b.json"
	CFS2020URL   = "https://data.nola.gov/resource/hp7u-i9hf.json"
	LimitPerPage = 1000
)

Variables

This section is empty.

Functions

This section is empty.

Types

type CfsScraper

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

func NewScraper

func NewScraper() *CfsScraper

func (*CfsScraper) Configure

func (s *CfsScraper) Configure(pool *pgxpool.Pool) (err error)

func (*CfsScraper) EnqueueJobs

func (s *CfsScraper) EnqueueJobs() ([]infra.Job, error)

func (*CfsScraper) HandleResponse

func (s *CfsScraper) HandleResponse(j infra.Job, resp *http.Response, httpErr error) (*infra.Job, error)

func (*CfsScraper) MakeRequest

func (s *CfsScraper) MakeRequest(j infra.Job) (*http.Request, error)

type JobMetadata

type JobMetadata struct {
	Limit  int
	Offset int
}

type Repo

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

func NewRepo

func NewRepo(conn *pgxpool.Pool) *Repo

func (*Repo) StoreCalls

func (r *Repo) StoreCalls(calls []*ServiceCall) error

type ServiceCall

type ServiceCall struct {
	NopdItem         string      `json:"nopd_item"`
	TypeText         string      `json:"typetext"`
	Priority         string      `json:"priority"`
	InitialType      string      `json:"initialtype"`
	InitialTypeText  string      `json:"initialtypetext"`
	InitialPriority  string      `json:"initialpriority"`
	MapX             string      `json:"mapx"`
	MapY             string      `json:"mapy"`
	TimeCreate       ServiceTime `json:"timecreate"`
	TimeDispatch     ServiceTime `json:"timedispatch"`
	TimeArrive       ServiceTime `json:"timearrive"`
	TimeClosed       ServiceTime `json:"timeclosed"`
	Disposition      string      `json:"disposition"`
	DispositionText  string      `json:"dispositiontext"`
	SelfInitiatedRaw string      `json:"selfinitiated"`
	SelfInitiated    bool
	Beat             string `json:"beat"`
	BlockAddress     string `json:"block_address"`
	Zip              string `json:"zip"`
	PoliceDistrict   string `json:"policedistrict"`
	LngLatPoint      postgis.PointS
	Location         struct {
		Latitude  string `json:"latitude"`
		Longitude string `json:"longitude"`
	} `json:"location"`
}

func (*ServiceCall) AfterParse

func (c *ServiceCall) AfterParse()

type ServiceTime

type ServiceTime struct {
	time.Time
}

func (*ServiceTime) UnmarshalJSON

func (m *ServiceTime) UnmarshalJSON(data []byte) error

Jump to

Keyboard shortcuts

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