Documentation
¶
Index ¶
- Constants
- Variables
- func AddressFromComplianceReportRequestID(ctx context.Context, public_id string) (*types.Address, error)
- func AddressList(ctx context.Context, ids []int64) (map[int32]types.Address, error)
- func AddressLocation(ctx context.Context, address types.Address) (*types.Location, error)
- func AvatarCreate(ctx context.Context, u User, upload file.Upload) error
- func ClearOauth(ctx context.Context, user *model.User)
- func CommunicationFromID(ctx context.Context, user User, comm_id int64) (*modelpublic.Communication, error)
- func CommunicationMarkInvalid(ctx context.Context, user User, comm_id int32) error
- func CommunicationMarkOpened(ctx context.Context, user User, comm_id int32) error
- func CommunicationMarkPendingResponse(ctx context.Context, user User, comm_id int32) error
- func CommunicationMarkPossibleIssue(ctx context.Context, user User, comm_id int32) error
- func CommunicationMarkPossibleResolved(ctx context.Context, user User, comm_id int32) error
- func CommunicationResponseCreate(ctx context.Context, user User, comm_id int, message string) (message_id int32, err error)
- func CommunicationTransfer(ctx context.Context, user User, commID int32, targetOrgID int32) error
- func CommunicationsCanReplyByID(ctx context.Context, comm_ids []int64) (map[int64]bool, error)
- func CommunicationsContactByID(ctx context.Context, comm_ids []int64) (map[int64]types.Contact, error)
- func CommunicationsForOrganization(ctx context.Context, org_id int64) ([]modelpublic.Communication, error)
- func CommunicationsTransferredFromByID(ctx context.Context, comm_ids []int64) (map[int64]int32, error)
- func ComplianceReportRequestByLeadID(ctx context.Context, lead_ids []int64) (map[int64][]*types.ComplianceReportRequest, error)
- func ComplianceReportRequestFromPublicID(ctx context.Context, public_id string) (*types.ComplianceReportRequest, error)
- func ComplianceRequestMailerCreate(ctx context.Context, user User, site_id int64) (int32, error)
- func ContactEmptyForOrganization(ctx context.Context, txn db.Ex, org_id int32) (*modelcomms.Contact, error)
- func ContactsForOrganization(ctx context.Context, org_id int32) ([]types.Contact, error)
- func ContactsFromIDs(ctx context.Context, ids []int64) (results []types.Contact, err error)
- func DistrictCatchall(ctx context.Context) (*model.Organization, error)
- func DistrictForLocation(ctx context.Context, lng float64, lat float64) (*model.Organization, error)
- func EnsureClient(ctx context.Context, client uuid.UUID, user_agent string) error
- func EnsureConfiguredNumberInDB(ctx context.Context, phone_number string) error
- func EventShutdown()
- func FeatureByID(ctx context.Context, featureID int64) (*types.Feature, error)
- func FeaturesForSite(ctx context.Context, site_id int64) ([]types.Feature, error)
- func GenerateReportID() (string, error)
- func GenerateWorkerSecret() (raw string, hashed string, err error)
- func GetOAuthForOrg(ctx context.Context, org Organization) (*model.OAuthToken, error)
- func GetOAuthForUser(ctx context.Context, user User) (*model.OAuthToken, error)
- func GetTile(ctx context.Context, w http.ResponseWriter, org Organization, ...) error
- func GetTileFlyoverLatLng(ctx context.Context, w http.ResponseWriter, org modelpublic.Organization, ...) error
- func GetTileSatelliteLatLng(ctx context.Context, w http.ResponseWriter, level uint, lat, lng float64) error
- func HandleOauthAccessCode(ctx context.Context, user User, code string) error
- func HasFieldseekerConnection(ctx context.Context, user_id int32) (bool, error)
- func ImpersonationCreate(ctx context.Context, user User, target int) (*model.LogImpersonation, error)
- func ImpersonationEnd(ctx context.Context, user User, impersonator_id int32) error
- func IsSyncOngoing(org_id int32) bool
- func LatLngToTile(level uint, lat, lng float64) (row, column uint)
- func LeadCreate(ctx context.Context, user User, signal_id int32, site_id int32, ...) (*model.Lead, error)
- func MailerByID(ctx context.Context, user User, id int32) (*types.Mailer, error)
- func MailerList(ctx context.Context, user User, limit int) ([]types.Mailer, error)
- func MessagesByContactIDs(ctx context.Context, txn db.Ex, contact_ids []int64) (map[int64][]types.Message, error)
- func MunicipalJobSourceScan(ctx context.Context, sourceID int32) error
- func MunicipalJobSourceSync(ctx context.Context, syncID int32) error
- func MunicipalSourceDelete(ctx context.Context, sourceID int32) error
- func MunicipalSourceUpdate(ctx context.Context, sourceID int32, layerIndex int32, externalIDName string, ...) error
- func MunicipalSyncStart(ctx context.Context, sourceID int32) (*munimodel.SourceSync, error)
- func NewKMLUpload(ctx context.Context, u User, upload fileio.Upload) (*int32, error)
- func NewKMZUpload(ctx context.Context, u User, upload fileio.Upload) (*int32, error)
- func NewUpload(ctx context.Context, u User, upload fileio.Upload, t modelfileupload.Csvtype) (*int32, error)
- func NoteAudioCreate(ctx context.Context, user User, setter model.NoteAudio) error
- func NoteImageCreate(ctx context.Context, user User, setter model.NoteImage) error
- func NotificationCountsForUser(ctx context.Context, u User) (*notificationCounts, error)
- func NotifyOauthInvalid(ctx context.Context, user *model.User)
- func OrganizationIDForComplianceReportRequest(ctx context.Context, public_id string) (int32, error)
- func PasswordResetURL(requestUUID string, email string) string
- func PublicReportByIDCompliance(ctx context.Context, report_id string, is_public bool) (*types.PublicReportCompliance, error)
- func PublicReportByIDNuisance(ctx context.Context, report_id string, is_public bool) (*types.PublicReportNuisance, error)
- func PublicReportByIDWater(ctx context.Context, report_id string, is_public bool) (*types.PublicReportWater, error)
- func PublicReportComplianceCreate(ctx context.Context, setter_report modelpublicreport.Report, ...) (*modelpublicreport.Report, error)
- func PublicReportImageCreate(ctx context.Context, public_id string, images []ImageUpload) error
- func PublicReportInvalid(ctx context.Context, user User, public_id string) error
- func PublicReportNuisanceCreate(ctx context.Context, setter_report modelpublicreport.Report, ...) (*modelpublicreport.Report, error)
- func PublicReportTypeByID(ctx context.Context, public_id string) (string, error)
- func PublicReportUpdateCompliance(ctx context.Context, public_id string, ...) error
- func PublicReportWaterCreate(ctx context.Context, setter_report modelpublicreport.Report, ...) (*modelpublicreport.Report, error)
- func PublicReportsForOrganization(ctx context.Context, org_id int32, is_public bool) ([]types.PublicReport, error)
- func PublicReportsFromIDs(ctx context.Context, report_ids []int64) ([]modelpublicreport.Report, error)
- func PublicreportNotificationCreate(ctx context.Context, pn PublicreportNotification) error
- func ReviewPoolCreate(ctx context.Context, user User, task_id int32, status string, ...) (int32, error)
- func ServePlanetPreview(w http.ResponseWriter, r *http.Request, itemID, assetType, bandsStr string) error
- func ServePlanetTile(w http.ResponseWriter, r *http.Request, itemID, assetType string, z, y, x uint, ...) error
- func ServePlanetTileIndex(w http.ResponseWriter, r *http.Request, itemID, assetType string, z, y, x uint, ...) error
- func ServiceRequestList(ctx context.Context, user User, limit int) ([]types.ServiceRequest, error)
- func SessionCurrent(ctx context.Context, user User) (*session, error)
- func SetEventChannel(chan_events chan<- Envelope)
- func SignalCreateFromPool(ctx context.Context, txn db.Ex, user User, site_id int32, feature_id int32, ...) (*modelpublic.Signal, error)
- func SignalCreateFromPublicreport(ctx context.Context, user User, report_id string) (*int32, error)
- func SignalList(ctx context.Context, user User, limit int) ([]types.Signal, error)
- func SiteByID(ctx context.Context, user User, id int) (types.Site, error)
- func SiteCreate(ctx context.Context, txn db.Ex, user User, address_id int32) (*model.Site, error)
- func SiteFromSignal(ctx context.Context, user User, signal_id int32) (*int32, error)
- func SiteList(ctx context.Context, user User, limit int) ([]types.Site, error)
- func SitesByIDs(ctx context.Context, txn db.Ex, ids []int64) (map[int32]types.Site, error)
- func SitusJobSync(ctx context.Context, syncID int32) error
- func SitusSyncStart(ctx context.Context, sourceID int32) (*munimodel.SourceSync, error)
- func StadiaQueryList(ctx context.Context) ([]model.APIRequest, error)
- func StartAll(ctx context.Context) error
- func StartPlanetAuthCheck(ctx context.Context)
- func SudoEvent(org_id int32, resource, type_, uri_path string)
- func SyncList(ctx context.Context, user User, limit int) ([]*types.Sync, error)
- func TextE164Normalize(e164 string) (string, error)
- func TextJobRespond(ctx context.Context, log_id int32) error
- func TextResetHistory(ctx context.Context, e164 string) error
- func UploadCommit(ctx context.Context, org Organization, file_id int32, committer User) error
- func UploadDiscard(ctx context.Context, org Organization, file_id int64) error
- func UsePasswordResetRequest(ctx context.Context, requestUUID uuid.UUID, email string, newPassword string) error
- func UserByEmail(ctx context.Context, email string) (*publicmodel.User, error)
- func UserByEmailOrUsername(ctx context.Context, emailOrUsername string) (*publicmodel.User, error)
- func UserUpdate(ctx context.Context, user User, user_id int, updates querypublic.UserUpdater) error
- func UsersByOrg(ctx context.Context, org Organization) (map[int32]*User, error)
- func VisionAnalysisRun(ctx context.Context, analysisID int32) error
- func VisionWorkerByID(ctx context.Context, id int32) (*model.VisionWorker, error)
- func VisionWorkerCreate(ctx context.Context, params VisionWorkerCreateParams) (*model.VisionWorker, error)
- func VisionWorkerSignalStatus(ctx context.Context, id int32, token string, params VisionWorkerSignalParams) (*model.VisionWorker, error)
- func WaitForExit()
- func WriteTileRandom(ctx context.Context, w http.ResponseWriter) error
- type Address
- type BreedingSourceDetail
- type BreedingSourceSummary
- type CSVPoolDetail
- type CSVPoolDetailCount
- type ClientSync
- type Envelope
- type ErrorNotFound
- type Event
- type ExifCollection
- type FieldseekerRecordsSync
- type GPS
- type ImageUpload
- type Inspection
- type LatLng
- type LayerInfo
- type LayerSampleField
- type LayerSampleResponse
- type MosquitoSource
- type MunicipalSource
- type MunicipalSourceSync
- type NoOAuthForOrg
- type NoUserError
- type Notification
- type Organization
- func (o Organization) ArcgisAccountID() string
- func (o Organization) HasServiceArea() bool
- func (o Organization) IsCatchall() bool
- func (o Organization) IsSyncOngoing() bool
- func (o Organization) LobAddressID() string
- func (o Organization) MarshalJSON() ([]byte, error)
- func (o Organization) Name() string
- func (o Organization) PhoneOffice() string
- func (o Organization) Slug() string
- func (o Organization) Website() string
- type PasswordResetRequest
- type Point
- type PoolUpdate
- type PublicreportNotification
- type RelatedRecord
- type RelatedRecordType
- type SitusScrapeData
- type SitusSource
- type SitusSourceDetailResponse
- type SourceDetailResponse
- type SyncStats
- type TIFFImage
- type TileRaster
- type Trap
- type TrapCount
- type TrapData
- type TrapNearby
- type TrapSummary
- type Treatment
- type TreatmentModel
- type Upload
- type UploadPoolError
- type UploadPoolRow
- type UploadStatus
- type UploadType
- type User
- func CreateUser(ctx context.Context, username string, name string, email string, ...) (*User, error)
- func UserByID(ctx context.Context, user_id int32) (*User, error)
- func UserByUsername(ctx context.Context, username string) (*User, error)
- func UserList(ctx context.Context, user User) ([]User, error)
- func UserSuggestion(ctx context.Context, user User, query string) ([]*User, error)
- type VisionWorkerCreateParams
- type VisionWorkerDevResult
- type VisionWorkerListResult
- type VisionWorkerShutdownResult
- type VisionWorkerSignalParams
- type VisionWorkerSummary
- type VisionWorkerTotals
Constants ¶
const EventTypeHeartbeat = event.EventTypeHeartbeat
const MAGIC_NIDUS_CONTACT_ID = 1
Variables ¶
var CodeVerifier string = "random_secure_string_min_43_chars_long_should_be_stored_in_session"
var ErrGeocodeRaw = errors.New("geocode-raw")
var ErrInvalidWorkerSecret = errors.New("invalid worker secret")
var ErrNoAddress = errors.New("no-address")
var ErrNotFound = errors.New("not-found")
var (
NotificationPathOauthReset string = "/oauth/refresh"
)
Functions ¶
func AddressList ¶
func AddressLocation ¶
func ClearOauth ¶
Clear all notifications for a given user with the given path
func CommunicationFromID ¶
func CommunicationFromID(ctx context.Context, user User, comm_id int64) (*modelpublic.Communication, error)
func CommunicationMarkOpened ¶
func CommunicationTransfer ¶
func CommunicationsForOrganization ¶
func CommunicationsForOrganization(ctx context.Context, org_id int64) ([]modelpublic.Communication, error)
func ContactsForOrganization ¶
func ContactsFromIDs ¶
func DistrictCatchall ¶
func DistrictCatchall(ctx context.Context) (*model.Organization, error)
func DistrictForLocation ¶
func EnsureClient ¶
func EventShutdown ¶
func EventShutdown()
func FeaturesForSite ¶
func GenerateReportID ¶
GenerateReportID creates a 12-character random string using only unambiguous capital letters and numbers
func GenerateWorkerSecret ¶
func GetOAuthForOrg ¶
func GetOAuthForOrg(ctx context.Context, org Organization) (*model.OAuthToken, error)
func GetOAuthForUser ¶
func GetTile ¶
func GetTile(ctx context.Context, w http.ResponseWriter, org Organization, use_placeholder bool, z, y, x uint) error
func GetTileFlyoverLatLng ¶
func GetTileFlyoverLatLng(ctx context.Context, w http.ResponseWriter, org modelpublic.Organization, use_placeholder bool, level uint, lat, lng float64) error
func GetTileSatelliteLatLng ¶
func HandleOauthAccessCode ¶
func ImpersonationCreate ¶
func ImpersonationEnd ¶
func IsSyncOngoing ¶
func LatLngToTile ¶
LatLngToTile converts GPS coordinates to ArcGIS tile coordinates
func LeadCreate ¶
func LeadCreate(ctx context.Context, user User, signal_id int32, site_id int32, pool_location *types.Location) (*model.Lead, error)
Create a lead from the given signal and site
func MailerList ¶
func MessagesByContactIDs ¶
func MunicipalJobSourceScan ¶
func MunicipalSourceUpdate ¶
func MunicipalSyncStart ¶
func NewKMLUpload ¶
func NewKMZUpload ¶
func NoteAudioCreate ¶
func NoteImageCreate ¶
func PasswordResetURL ¶
PasswordResetURL builds the password reset URL from a request UUID and email
func PublicReportByIDWater ¶
func PublicReportComplianceCreate ¶
func PublicReportComplianceCreate(ctx context.Context, setter_report modelpublicreport.Report, setter_compliance modelpublicreport.Compliance, org_id int32) (*modelpublicreport.Report, error)
func PublicReportImageCreate ¶
func PublicReportImageCreate(ctx context.Context, public_id string, images []ImageUpload) error
func PublicReportInvalid ¶
func PublicReportNuisanceCreate ¶
func PublicReportNuisanceCreate(ctx context.Context, setter_report modelpublicreport.Report, setter_nuisance modelpublicreport.Nuisance, location types.Location, address Address, images []ImageUpload) (*modelpublicreport.Report, error)
func PublicReportTypeByID ¶
func PublicReportUpdateCompliance ¶
func PublicReportUpdateCompliance(ctx context.Context, public_id string, report_updates querypublicreport.ReportUpdater, compliance_updates querypublicreport.ComplianceUpdater, address *types.Address, location *types.Location, reporter *types.ContactSimple) error
func PublicReportWaterCreate ¶
func PublicReportWaterCreate(ctx context.Context, setter_report modelpublicreport.Report, setter_water modelpublicreport.Water, location types.Location, address Address, images []ImageUpload) (*modelpublicreport.Report, error)
func PublicReportsFromIDs ¶
func PublicreportNotificationCreate ¶
func PublicreportNotificationCreate(ctx context.Context, pn PublicreportNotification) error
func ReviewPoolCreate ¶
func ServePlanetPreview ¶
func ServePlanetTile ¶
func ServePlanetTileIndex ¶
func ServePlanetTileIndex(w http.ResponseWriter, r *http.Request, itemID, assetType string, z, y, x uint, index string) error
ServePlanetTileIndex serves a planet tile computed from a spectral index (e.g., "ndwi") instead of RGB bands. The tile URL uses the same path pattern as ServePlanetTile but adds ?index=ndwi instead of ?bands=R,G,B.
func ServiceRequestList ¶
func SetEventChannel ¶
func SetEventChannel(chan_events chan<- Envelope)
func SignalCreateFromPool ¶
func SignalCreateFromPublicreport ¶
Create a lead from the given signal and site
func SignalList ¶
func SiteCreate ¶
func SiteFromSignal ¶
func SitesByIDs ¶
func SitusSyncStart ¶
func StadiaQueryList ¶
func StadiaQueryList(ctx context.Context) ([]model.APIRequest, error)
func StartPlanetAuthCheck ¶
StartPlanetAuthCheck attempts to connect to the Planet satellite imagery service and verify the configured credentials. It runs in a goroutine and logs the result — a successful check confirms the integration is ready, a failure logs a warning without blocking startup.
Both authentication schemes supported by the planet-go library are tried:
- Planet Data API token (PLANET_API_TOKEN)
- Planet Catalog API OAuth2 client credentials (PLANET_CATALOG_CLIENT_ID/SECRET)
If neither credential set is configured, the check is skipped with an info log.
func TextE164Normalize ¶
func UploadCommit ¶
func UploadDiscard ¶
func UploadDiscard(ctx context.Context, org Organization, file_id int64) error
func UsePasswordResetRequest ¶
func UsePasswordResetRequest(ctx context.Context, requestUUID uuid.UUID, email string, newPassword string) error
UsePasswordResetRequest validates and completes a password reset. Returns an error for both validation failures and system errors so the caller can return a generic "invalid or expired" message.
func UserByEmail ¶
UserByEmail looks up a user by their email address
func UserByEmailOrUsername ¶
UserByEmailOrUsername tries to find a user by username first, then by email
func UserUpdate ¶
func UserUpdate(ctx context.Context, user User, user_id int, updates querypublic.UserUpdater) error
func UsersByOrg ¶
func VisionWorkerByID ¶
func VisionWorkerCreate ¶
func VisionWorkerCreate(ctx context.Context, params VisionWorkerCreateParams) (*model.VisionWorker, error)
func VisionWorkerSignalStatus ¶
func VisionWorkerSignalStatus(ctx context.Context, id int32, token string, params VisionWorkerSignalParams) (*model.VisionWorker, error)
func WaitForExit ¶
func WaitForExit()
func WriteTileRandom ¶
func WriteTileRandom(ctx context.Context, w http.ResponseWriter) error
Writes a random tile from the cache. This is a very odd thing to do, it's for testing
Types ¶
type BreedingSourceDetail ¶
type BreedingSourceDetail struct {
// Basic Information
OrganizationID int32 `json:"organizationId"`
Name string `json:"name"`
Description string `json:"description"`
LocationNumber int64 `json:"locationNumber"`
ObjectID int64 `json:"objectId"`
GlobalID uuid.UUID `json:"globalId"`
ExternalID string `json:"externalId"`
// Status Information
Active bool `json:"active"`
DeactivateReason string `json:"deactivateReason"`
SourceStatus string `json:"sourceStatus"`
Priority string `json:"priority"`
ScalarPriority int64 `json:"scalarPriority"`
// Classification
SourceType string `json:"sourceType"`
Habitat string `json:"habitat"`
UseType string `json:"useType"`
WaterOrigin string `json:"waterOrigin"`
Symbology string `json:"symbology"`
// Geographical Data
H3Cell h3.Cell `json:"h3cell"`
Zone string `json:"zone"`
Zone2 string `json:"zone2"`
Jurisdiction string `json:"jurisdiction"`
AccessDescription string `json:"accessDescription"`
// Inspection Data
LarvaeInspectInterval int16 `json:"larvaeInspectInterval"`
LastInspectionDate *time.Time `json:"lastInspectionDate"`
LastInspectionActivity string `json:"lastInspectionActivity"`
LastInspectionActionTaken string `json:"lastInspectionActionTaken"`
LastInspectionAverageLarvae float64 `json:"lastInspectionAverageLarvae"`
LastInspectionAveragePupae float64 `json:"lastInspectionAveragePupae"`
LastInspectionBreeding string `json:"lastInspectionBreeding"`
LastInspectionConditions string `json:"lastInspectionConditions"`
LastInspectionFieldSpecies string `json:"lastInspectionFieldSpecies"`
LastInspectionLifeStages string `json:"lastInspectionLifeStages"`
// Treatment Data
LastTreatmentDate *time.Time `json:"lastTreatmentDate"`
LastTreatmentActivity string `json:"lastTreatmentActivity"`
LastTreatmentProduct string `json:"lastTreatmentProduct"`
LastTreatmentQuantity float64 `json:"lastTreatmentQuantity"`
LastTreatmentQuantityUnit string `json:"lastTreatmentQuantityUnit"`
// Assignment & Schedule
AssignedTechnician string `json:"assignedTechnician"`
NextActionScheduledDate *time.Time `json:"nextActionScheduledDate"`
// Metadata
Created *time.Time `json:"created"`
Creator string `json:"creator"`
EditedAt *time.Time `json:"editedAt"`
Editor string `json:"editor"`
Comments string `json:"comments"`
}
func SourceByGlobalID ¶
func SourceByGlobalID(ctx context.Context, org Organization, id uuid.UUID) (*BreedingSourceDetail, error)
type BreedingSourceSummary ¶
type BreedingSourceSummary struct {
ID uuid.UUID
Type string
LastInspected *time.Time
LastTreated *time.Time
}
func BreedingSourcesByCell ¶
func BreedingSourcesByCell(ctx context.Context, org Organization, c h3.Cell) ([]BreedingSourceSummary, error)
type CSVPoolDetail ¶
type CSVPoolDetail struct {
Count CSVPoolDetailCount `json:"count"`
Errors []UploadPoolError `json:"errors"`
Pools []UploadPoolRow `json:"pools"`
}
type CSVPoolDetailCount ¶
type ClientSync ¶
type ClientSync struct {
Fieldseeker FieldseekerRecordsSync
Since time.Time
}
func ContentClientIos ¶
type ErrorNotFound ¶
type ErrorNotFound struct {
// contains filtered or unexported fields
}
func (ErrorNotFound) Error ¶
func (e ErrorNotFound) Error() string
type ExifCollection ¶
func ImageExtractExif ¶
func ImageExtractExif(content_type string, file_bytes []byte) (result *ExifCollection, err error)
type FieldseekerRecordsSync ¶
type FieldseekerRecordsSync struct {
MosquitoSources []MosquitoSource
ServiceRequests []modelfieldseeker.Servicerequest
TrapData []modelfieldseeker.Traplocation
}
type ImageUpload ¶
type Inspection ¶
type Inspection struct {
Action string
Date *time.Time
Notes string
Location string
LocationID uuid.UUID
}
func InspectionsByCell ¶
func InspectionsByCell(ctx context.Context, org Organization, c h3.Cell) ([]Inspection, error)
func InspectionsBySource ¶
func InspectionsBySource(ctx context.Context, org Organization, sourceID uuid.UUID) ([]Inspection, error)
type LayerSampleField ¶
type LayerSampleResponse ¶
type LayerSampleResponse struct {
TotalCount int `json:"total_count"`
Fields []LayerSampleField `json:"fields"`
}
func MunicipalLayerSample ¶
type MosquitoSource ¶
type MosquitoSource struct {
PointLocation modelfieldseeker.Pointlocation
Inspections []modelfieldseeker.Mosquitoinspection
Treatments []modelfieldseeker.Treatment
}
type MunicipalSource ¶
type MunicipalSource struct {
ID int32 `json:"id"`
URL string `json:"url"`
Region string `json:"region"`
Country string `json:"country"`
}
func MunicipalSourceCreate ¶
type MunicipalSourceSync ¶
type MunicipalSourceSync struct {
ID int32 `json:"id"`
SourceID int32 `json:"source_id"`
Created time.Time `json:"created"`
Processed int32 `json:"processed"`
Total *int32 `json:"total"`
}
func MunicipalSourceSyncGetByID ¶
func MunicipalSourceSyncGetByID(ctx context.Context, id int32) (*MunicipalSourceSync, error)
type NoOAuthForOrg ¶
type NoOAuthForOrg struct{}
When there is no oauth for an organization
func (NoOAuthForOrg) Error ¶
func (e NoOAuthForOrg) Error() string
type NoUserError ¶
type NoUserError struct{}
func (NoUserError) Error ¶
func (e NoUserError) Error() string
func (NoUserError) Is ¶
func (e NoUserError) Is(target error) bool
type Notification ¶
func NotificationsForUser ¶
func NotificationsForUser(ctx context.Context, u User) ([]Notification, error)
type Organization ¶
type Organization struct {
ID int32 `json:"id"`
ServiceArea *types.ServiceArea `json:"service_area"`
// contains filtered or unexported fields
}
func OrganizationByID ¶
func OrganizationByID(ctx context.Context, id int) (*Organization, error)
func OrganizationList ¶
func OrganizationList(ctx context.Context) ([]*Organization, error)
func (Organization) ArcgisAccountID ¶
func (o Organization) ArcgisAccountID() string
func (Organization) HasServiceArea ¶
func (o Organization) HasServiceArea() bool
func (Organization) IsCatchall ¶
func (o Organization) IsCatchall() bool
func (Organization) IsSyncOngoing ¶
func (o Organization) IsSyncOngoing() bool
func (Organization) LobAddressID ¶
func (o Organization) LobAddressID() string
func (Organization) MarshalJSON ¶
func (o Organization) MarshalJSON() ([]byte, error)
func (Organization) Name ¶
func (o Organization) Name() string
func (Organization) PhoneOffice ¶
func (o Organization) PhoneOffice() string
func (Organization) Slug ¶
func (o Organization) Slug() string
func (Organization) Website ¶
func (o Organization) Website() string
type PasswordResetRequest ¶
type PasswordResetRequest struct {
ID int32
Created time.Time
UUID string
Email *string
Username *string
UserID *int32
UsedAt *time.Time
}
PasswordResetRequest represents a password reset request record
func CreatePasswordResetRequest ¶
func CreatePasswordResetRequest(ctx context.Context, emailOrUsername string) (*PasswordResetRequest, error)
CreatePasswordResetRequest creates a new password reset request row and returns it. Returns an error for actual system failures, but returns (nil, nil) when the identifier is not found (caller should handle masking).
func ValidatePasswordResetRequest ¶
func ValidatePasswordResetRequest(ctx context.Context, requestUUID uuid.UUID, email string) (*PasswordResetRequest, error)
ValidatePasswordResetRequest checks if a password reset request is valid. Returns nil, nil if the request is not found (for caller error masking).
type PoolUpdate ¶
type RelatedRecord ¶
type RelatedRecord struct {
Created time.Time
ID string
Type RelatedRecordType
}
func CommunicationRelatedRecords ¶
func CommunicationRelatedRecords(ctx context.Context, user User, comm *modelpublic.Communication) ([]RelatedRecord, error)
type RelatedRecordType ¶
type RelatedRecordType int
const ( RelatedRecordTypeUnknown RelatedRecordType = iota RelatedRecordTypeEmail RelatedRecordTypeReportCompliance RelatedRecordTypeReportNuisance RelatedRecordTypeReportWater RelatedRecordTypeText )
type SitusScrapeData ¶
type SitusSource ¶
type SitusSourceDetailResponse ¶
type SitusSourceDetailResponse struct {
ID int32 `json:"id"`
URL string `json:"url"`
Region string `json:"region"`
Country string `json:"country"`
County string `json:"county"`
LastSyncCreated string `json:"last_sync_created"`
SitusCount *int32 `json:"situs_count"`
ParcelSourceID *int32 `json:"parcel_source_id"`
URLPattern string `json:"url_pattern"`
}
func SitusSourceDetail ¶
func SitusSourceDetail(ctx context.Context, sourceID int32) (*SitusSourceDetailResponse, error)
type SourceDetailResponse ¶
type SourceDetailResponse struct {
ID int32 `json:"id"`
URL string `json:"url"`
Region string `json:"region"`
Country string `json:"country"`
ServiceFeatureItemID string `json:"service_feature_item_id"`
SelectedLayerIndex int32 `json:"selected_layer_index"`
ExternalIDFieldName string `json:"external_id_field_name"`
DescriptionFieldName string `json:"description_field_name"`
GeometryFieldName string `json:"geometry_field_name"`
LastSyncCreated string `json:"last_sync_created"`
ParcelCount *int32 `json:"parcel_count"`
TotalAreaSqKm *float64 `json:"total_area_sqkm"`
Layers []LayerInfo `json:"layers"`
}
func MunicipalSourceDetail ¶
func MunicipalSourceDetail(ctx context.Context, sourceID int32) (*SourceDetailResponse, error)
type TIFFImage ¶
type TileRaster ¶
func ImageAtPoint ¶
func ImageAtPoint(ctx context.Context, org Organization, level uint, lat, lng float64) (*TileRaster, error)
func ImageAtTile ¶
func ImageAtTile(ctx context.Context, org modelpublic.Organization, level, y, x uint) (*TileRaster, error)
func TileRasterPlaceholder ¶
func TileRasterPlaceholder() *TileRaster
type Trap ¶
type Trap struct {
Active bool
Comments string
Collections []TrapData
Description string
GlobalID uuid.UUID
H3Cell h3.Cell
}
func TrapByGlobalId ¶
type TrapData ¶
type TrapData struct {
// Basic Identifiers
OrganizationID int32 `json:"organizationId"`
ObjectID int64 `json:"objectId"`
GlobalID uuid.UUID `json:"globalId"`
LocationName string `json:"locationName"`
LocationID uuid.UUID `json:"locationId"`
SRID uuid.UUID `json:"srid"`
Field int64 `json:"field"`
// Trap Information
TrapType string `json:"trapType"`
TrapCondition string `json:"trapCondition"`
TrapActivityType string `json:"trapActivityType"`
TrapNights int16 `json:"trapNights"`
Lure string `json:"lureType"`
// Personnel
FieldTechnician string `json:"fieldTechnician"`
IdentifiedByTechnician string `json:"identifiedByTechnician"`
SortedByTechnician string `json:"sortedByTechnician"`
// Timing
StartDateTime *time.Time `json:"startDateTime"`
EndDateTime *time.Time `json:"endDateTime"`
// Environmental Conditions
AverageTemperature float64 `json:"averageTemperature"`
Rainfall float64 `json:"rainfall"`
WindDirection string `json:"windDirection"`
WindSpeed float64 `json:"windSpeed"`
SiteCondition string `json:"siteCondition"`
// Status and Processing
Processed bool `json:"processed"`
RecordStatus int16 `json:"recordStatus"`
Reviewed bool `json:"reviewed"`
ReviewedBy string `json:"reviewedBy"`
ReviewedDate *time.Time `json:"reviewedDate"`
GatewaySynced bool `json:"gatewaySynced"`
LR bool `json:"laboratoryReported"`
Voltage float64 `json:"voltage"`
// Location Data
H3Cell h3.Cell `json:"h3cell"`
Zone string `json:"zone"`
Zone2 string `json:"zone2"`
// Vector Survey IDs
VectorSurveyTrapDataID string `json:"vectorSurveyTrapDataId"`
VectorSurveyTrapLocationID string `json:"vectorSurveyTrapLocationId"`
// Metadata
Created *time.Time `json:"created"`
Creator string `json:"creator"`
CreatedByUser string `json:"createdByUser"`
CreatedDateAlt *time.Time `json:"createdDateAlt"`
Edited *time.Time `json:"edited"`
Editor string `json:"editor"`
LastEditedDate *time.Time `json:"lastEditedDate"`
LastEditedUser string `json:"lastEditedUser"`
Comments string `json:"comments"`
// Stuff I actually use
Count TrapCount
}
type TrapNearby ¶
func TrapsBySource ¶
func TrapsBySource(ctx context.Context, org Organization, sourceID uuid.UUID) ([]TrapNearby, error)
type TrapSummary ¶
func TrapsByCell ¶
func TrapsByCell(ctx context.Context, org Organization, c h3.Cell) (results []TrapSummary, err error)
type Treatment ¶
type Treatment struct {
CadenceDelta time.Duration
Date *time.Time
LocationID uuid.UUID
Notes string
Product string
}
func TreatmentsByCell ¶
func TreatmentsBySource ¶
type TreatmentModel ¶
type TreatmentModel struct {
Year int
SeasonStart time.Time
SeasonEnd time.Time
Interval time.Duration
ActualDates []time.Time
PredictedDates []time.Time
Errors []time.Duration
}
TreatmentModel represents the calculated model for a year's treatments
func ModelTreatment ¶
func ModelTreatment(treatments []Treatment) []TreatmentModel
type Upload ¶
type Upload struct {
Created time.Time `db:"created" json:"created"`
Date time.Time `db:"date" json:"date"`
Error string `db:"error" json:"error"`
Filename string `db:"filename" json:"filename"`
ID int32 `db:"id" json:"id"`
RecordCount int `db:"recordcount" json:"recordcount"`
Status string `db:"status" json:"status"`
Type string `db:"type" json:"type"`
CSVPool *CSVPoolDetail `json:"csv_pool"`
}
func GetUploadDetail ¶
func UploadList ¶
func UploadList(ctx context.Context, org Organization) ([]Upload, error)
type UploadPoolError ¶
type UploadPoolRow ¶
type User ¶
type User struct {
Active bool
Avatar *uuid.UUID
DisplayName string
Email *string
ID int
Initials string
IsActive bool
IsDronePilot bool
IsWarrant bool
Organization Organization
PasswordHash string
PasswordHashType string
Role string
Username string
// contains filtered or unexported fields
}
func CreateUser ¶
func UserSuggestion ¶
func (User) IsAccountOwner ¶
type VisionWorkerDevResult ¶ added in v0.0.21
type VisionWorkerDevResult struct {
Worker *model.VisionWorker
Secret string
}
func VisionWorkerCreateDev ¶ added in v0.0.21
func VisionWorkerCreateDev(ctx context.Context, name string) (*VisionWorkerDevResult, error)
type VisionWorkerListResult ¶
type VisionWorkerListResult struct {
Workers []VisionWorkerSummary
Totals VisionWorkerTotals
}
func VisionWorkersList ¶
func VisionWorkersList(ctx context.Context) (*VisionWorkerListResult, error)
type VisionWorkerShutdownResult ¶
type VisionWorkerShutdownResult struct {
Worker model.VisionWorker
TotalCost float64
UptimeHours float64
}
func VisionWorkerShutdown ¶
type VisionWorkerSummary ¶
type VisionWorkerSummary struct {
Worker model.VisionWorker
TotalCost float64
UptimeHours float64
}
Source Files
¶
- address.go
- arcgis.go
- audio.go
- avatar.go
- client.go
- communication.go
- compliance.go
- contact.go
- district.go
- error.go
- event.go
- feature.go
- fieldseeker.go
- image.go
- impersonation.go
- ios.go
- label_studio.go
- latlng.go
- lead.go
- mailer.go
- message.go
- municipal.go
- note.go
- notification.go
- oauth.go
- organization.go
- password.go
- planet.go
- planet_tile.go
- point.go
- pool.go
- publicreport.go
- publicreport_notification.go
- review.go
- service_request.go
- session.go
- signal.go
- site.go
- situs_scrape.go
- stadia.go
- start.go
- sync.go
- text.go
- tiffreader.go
- tile.go
- trap.go
- treatment.go
- upload.go
- user.go
- vision_analysis.go
- vision_worker.go
- water.go
- worker_instance_shutdown.go
- worker_instance_start.go
- worker_software_install.go
Directories
¶
| Path | Synopsis |
|---|---|
|
Package kml parses Keyhole Markup Language (KML) documents and converts them to PostGIS MultiPolygon geometries for database storage.
|
Package kml parses Keyhole Markup Language (KML) documents and converts them to PostGIS MultiPolygon geometries for database storage. |
|
Package kmz parses Keyhole Markup Language Zip (KMZ) documents by extracting the contained KML file(s) and converting them to PostGIS MultiPolygon geometries for database storage.
|
Package kmz parses Keyhole Markup Language Zip (KMZ) documents by extracting the contained KML file(s) and converting them to PostGIS MultiPolygon geometries for database storage. |
|
vision
|
|
|
provider
Package provider defines an abstraction for cloud machine providers (Digital Ocean, AWS, etc.) that can create, manage, and destroy GPU compute instances for Nidus Reveal vision workers.
|
Package provider defines an abstraction for cloud machine providers (Digital Ocean, AWS, etc.) that can create, manage, and destroy GPU compute instances for Nidus Reveal vision workers. |
|
provider/do
Package do implements the cloud provider interface for Digital Ocean.
|
Package do implements the cloud provider interface for Digital Ocean. |
|
provider/lambda
Package lambda implements the cloud provider interface for Lambda Labs.
|
Package lambda implements the cloud provider interface for Lambda Labs. |
|
scaler
Package scaler implements the auto-scaling engine for vision GPU workers.
|
Package scaler implements the auto-scaling engine for vision GPU workers. |