api

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2026 License: AGPL-3.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddRoutes

func AddRoutes(r chi.Router)

Types

type Bounds

type Bounds struct {
	East  float64
	North float64
	South float64
	West  float64
}

func NewBounds

func NewBounds() Bounds

type H3Cell

type H3Cell uint64

type NoteAudioBreadcrumbPayload

type NoteAudioBreadcrumbPayload struct {
	Cell             H3Cell    `json:"cell"`
	Created          time.Time `json:"created"`
	ManuallySelected bool      `json:"manuallySelected"`
}

type NoteAudioPayload

type NoteAudioPayload struct {
	UUID                    string                       `json:"uuid"`
	Breadcrumbs             []NoteAudioBreadcrumbPayload `json:"breadcrumbs"`
	Created                 time.Time                    `json:"created"`
	CreatorID               int                          `json:"creator_id"`
	Deleted                 *time.Time                   `json:"deleted"`
	DeletorID               *int32                       `json:"deletor_id"`
	Duration                float32                      `json:"duration"`
	Transcription           *string                      `json:"transcription"`
	TranscriptionUserEdited bool                         `json:"transcriptionUserEdited"`
	Version                 int32                        `json:"version"`
}

type NoteImagePayload

type NoteImagePayload struct {
	UUID      string     `json:"uuid"`
	Cell      H3Cell     `json:"cell"`
	Created   time.Time  `json:"created"`
	CreatorID int        `db:"creator_id"`
	Deleted   *time.Time `json:"deleted"`
	DeletorID *int32     `json:"deletor_id"`
	Version   int32      `json:"version"`
}

type ResponseClientIos

type ResponseClientIos struct {
	Fieldseeker ResponseFieldseeker `json:"fieldseeker"`
	Since       time.Time           `json:"since"`
}

ResponseErr renderer type for handling all sorts of errors.

func (ResponseClientIos) Render

type ResponseErr

type ResponseErr struct {
	Error          error `json:"-"` // low-level runtime error
	HTTPStatusCode int   `json:"-"` // http response status code

	StatusText string `json:"status"`          // user-level status message
	AppCode    int64  `json:"code,omitempty"`  // application-specific error code
	ErrorText  string `json:"error,omitempty"` // application-level error message, for debugging
}

In the best case scenario, the excellent github.com/pkg/errors package helps reveal information on the error, setting it on Err, and in the Render() method, using it to set the application-specific error code in AppCode.

func (*ResponseErr) Render

func (e *ResponseErr) Render(w http.ResponseWriter, r *http.Request) error

type ResponseFieldseeker

type ResponseFieldseeker struct {
	MosquitoSources []ResponseMosquitoSource `json:"sources"`
	ServiceRequests []ResponseServiceRequest `json:"requests"`
	TrapData        []ResponseTrapData       `json:"traps"`
}

type ResponseMosquitoInspection

type ResponseMosquitoInspection struct {
	ActionTaken     string `json:"action_taken"`
	Comments        string `json:"comments"`
	Condition       string `json:"condition"`
	Created         string `json:"created"`
	EndDateTime     string `json:"end_date_time"`
	FieldTechnician string `json:"field_technician"`
	ID              string `json:"id"`
	LocationName    string `json:"location_name"`
	SiteCondition   string `json:"site_condition"`
}

func (ResponseMosquitoInspection) Render

type ResponseMosquitoSource

type ResponseMosquitoSource struct {
	Access                  string                       `json:"access"`
	Active                  *bool                        `json:"active"`
	Comments                string                       `json:"comments"`
	Created                 string                       `json:"created"`
	Description             string                       `json:"description"`
	H3Cell                  int64                        `json:"h3cell"`
	ID                      string                       `json:"id"`
	LastInspectionDate      string                       `json:"last_inspection_date"`
	Habitat                 string                       `json:"habitat"`
	Inspections             []ResponseMosquitoInspection `json:"inspections"`
	Name                    string                       `json:"name"`
	NextActionDateScheduled string                       `json:"next_action_date_scheduled"`
	Treatments              []ResponseMosquitoTreatment  `json:"treatments"`
	UseType                 string                       `json:"use_type"`
	WaterOrigin             string                       `json:"water_origin"`
	Zone                    string                       `json:"zone"`
}

func NewResponseMosquitoSources

func NewResponseMosquitoSources(sources []platform.MosquitoSource) []ResponseMosquitoSource

func (ResponseMosquitoSource) Render

type ResponseMosquitoTreatment

type ResponseMosquitoTreatment struct {
	Comments        string  `json:"comments"`
	Created         string  `json:"created"`
	EndDateTime     string  `json:"end_date_time"`
	FieldTechnician string  `json:"field_technician"`
	Habitat         string  `json:"habitat"`
	ID              string  `json:"id"`
	Product         string  `json:"product"`
	Quantity        float64 `json:"quantity"`
	QuantityUnit    string  `json:"quantity_unit"`
	SiteCondition   string  `json:"site_condition"`
	TreatAcres      float64 `json:"treat_acres"`
	TreatHectares   float64 `json:"treat_hectares"`
}

func NewResponseMosquitoTreatments

func NewResponseMosquitoTreatments(treatments models.FieldseekerTreatmentSlice) []ResponseMosquitoTreatment

func (ResponseMosquitoTreatment) Render

type ResponseNote

type ResponseNote struct {
	CategoryName string `json:"categoryName"`
	Content      string `json:"content"`

	H3Cell    int64  `json:"h3cell"`
	ID        string `json:"id"`
	Timestamp string `json:"timestamp"`
}

func (ResponseNote) Render

func (rtd ResponseNote) Render(w http.ResponseWriter, r *http.Request) error

type ResponseServiceRequest

type ResponseServiceRequest struct {
	Address            string `json:"address"`
	AssignedTechnician string `json:"assigned_technician"`
	City               string `json:"city"`
	Created            string `json:"created"`
	H3Cell             int64  `json:"h3cell"`
	HasDog             *bool  `json:"has_dog"`
	HasSpanishSpeaker  *bool  `json:"has_spanish_speaker"`
	ID                 string `json:"id"`
	Priority           string `json:"priority"`
	RecordedDate       string `json:"recorded_date"`
	Source             string `json:"source"`
	Status             string `json:"status"`
	Target             string `json:"target"`
	Zip                string `json:"zip"`
}

func (ResponseServiceRequest) Render

type ResponseTrapData

type ResponseTrapData struct {
	Created     string `json:"created"`
	Description string `json:"description"`
	H3Cell      int64  `json:"h3cell"`
	ID          string `json:"id"`
	Name        string `json:"name"`
}

func (ResponseTrapData) Render

Jump to

Keyboard shortcuts

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