api

package
v0.0.0-...-01a0c8f Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2026 License: Apache-2.0 Imports: 41 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ErrLongPassword = authError("rejected very long password")
)
View Source
const EventSourceChannel = "imsevents"
View Source
const (
	IMSAttachmentFormKey = "imsAttachment"
)

Variables

This section is empty.

Functions

func Adapt

func Adapt(handler http.Handler, adapters ...Adapter) http.Handler

func AddBasicHandlers

func AddBasicHandlers(mux *http.ServeMux) *http.ServeMux

func AddToMux

func AddToMux(
	mux *http.ServeMux,
	es *EventSourcerer,
	cfg *conf.IMSConfig,
	db *store.DBQ,
	userStore *directory.UserStore,
	s3Client *attachment.S3Client,
	actionLogger *actionlog.Logger,
) *http.ServeMux

Types

type AccessForEvent

type AccessForEvent struct {
	EventID           int32 `json:"event_id"`
	ReadIncidents     bool  `json:"readIncidents"`
	WriteIncidents    bool  `json:"writeIncidents"`
	WriteFieldReports bool  `json:"writeFieldReports"`
	ReadStays         bool  `json:"readStays"`
	WriteStays        bool  `json:"writeStays"`
	AttachFiles       bool  `json:"attachFiles"`
}

type Adapter

type Adapter func(http.Handler) http.Handler

func LimitRequestBytes

func LimitRequestBytes(maxRequestBytes int64) Adapter

func LogRequest

func LogRequest(enable bool, actionLogger *actionlog.Logger, userStore *directory.UserStore) Adapter

func OptionalAuthN

func OptionalAuthN(j authz.JWTer) Adapter

func RecoverFromPanic

func RecoverFromPanic() Adapter

func RequireAuthN

func RequireAuthN(j authz.JWTer) Adapter

type AttachRangerToIncident

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

func (AttachRangerToIncident) ServeHTTP

func (action AttachRangerToIncident) ServeHTTP(w http.ResponseWriter, req *http.Request)

type AttachRangerToStay

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

func (AttachRangerToStay) ServeHTTP

func (action AttachRangerToStay) ServeHTTP(w http.ResponseWriter, req *http.Request)

type AttachToFieldReport

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

func (AttachToFieldReport) ServeHTTP

func (action AttachToFieldReport) ServeHTTP(w http.ResponseWriter, req *http.Request)

type AttachToIncident

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

func (AttachToIncident) ServeHTTP

func (action AttachToIncident) ServeHTTP(w http.ResponseWriter, req *http.Request)

type AttachToStay

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

func (AttachToStay) ServeHTTP

func (action AttachToStay) ServeHTTP(w http.ResponseWriter, req *http.Request)

type ContextKey

type ContextKey string
const JWTContextKey ContextKey = "JWTContext"

type DetachRangerFromIncident

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

func (DetachRangerFromIncident) ServeHTTP

func (action DetachRangerFromIncident) ServeHTTP(w http.ResponseWriter, req *http.Request)

type DetachRangerFromStay

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

func (DetachRangerFromStay) ServeHTTP

func (action DetachRangerFromStay) ServeHTTP(w http.ResponseWriter, req *http.Request)

type EditEvent

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

func (EditEvent) ServeHTTP

func (action EditEvent) ServeHTTP(w http.ResponseWriter, req *http.Request)

type EditFieldReport

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

func (EditFieldReport) ServeHTTP

func (action EditFieldReport) ServeHTTP(w http.ResponseWriter, req *http.Request)

type EditFieldReportReportEntry

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

func (EditFieldReportReportEntry) ServeHTTP

func (action EditFieldReportReportEntry) ServeHTTP(w http.ResponseWriter, req *http.Request)

type EditIncident

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

func (EditIncident) ServeHTTP

func (action EditIncident) ServeHTTP(w http.ResponseWriter, req *http.Request)

type EditIncidentReportEntry

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

func (EditIncidentReportEntry) ServeHTTP

func (action EditIncidentReportEntry) ServeHTTP(w http.ResponseWriter, req *http.Request)

type EditIncidentTypes

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

func (EditIncidentTypes) ServeHTTP

func (action EditIncidentTypes) ServeHTTP(w http.ResponseWriter, req *http.Request)

type EditStay

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

func (EditStay) ServeHTTP

func (action EditStay) ServeHTTP(w http.ResponseWriter, req *http.Request)

type EditStayReportEntry

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

func (EditStayReportEntry) ServeHTTP

func (action EditStayReportEntry) ServeHTTP(w http.ResponseWriter, req *http.Request)

type EditStreets

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

func (EditStreets) ServeHTTP

func (action EditStreets) ServeHTTP(w http.ResponseWriter, req *http.Request)

type EventSourcerer

type EventSourcerer struct {
	Server    *eventsource.Server
	IdCounter atomic.Int64
}

func NewEventSourcerer

func NewEventSourcerer() *EventSourcerer

func (*EventSourcerer) Replay

func (es *EventSourcerer) Replay(channel, id string) chan eventsource.Event

type GetActionLogs

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

func (GetActionLogs) ServeHTTP

func (action GetActionLogs) ServeHTTP(w http.ResponseWriter, req *http.Request)

type GetAuth

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

func (GetAuth) ServeHTTP

func (action GetAuth) ServeHTTP(w http.ResponseWriter, req *http.Request)

type GetAuthResponse

type GetAuthResponse struct {
	Authenticated bool                      `json:"authenticated"`
	User          string                    `json:"user,omitzero"`
	Admin         bool                      `json:"admin"`
	EventAccess   map[string]AccessForEvent `json:"event_access"`
}

type GetBuildInfo

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

func (GetBuildInfo) ServeHTTP

func (action GetBuildInfo) ServeHTTP(w http.ResponseWriter, req *http.Request)

type GetDestinations

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

func (GetDestinations) ServeHTTP

func (action GetDestinations) ServeHTTP(w http.ResponseWriter, req *http.Request)

type GetEventAccesses

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

func (GetEventAccesses) ServeHTTP

func (action GetEventAccesses) ServeHTTP(w http.ResponseWriter, req *http.Request)

type GetEvents

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

func (GetEvents) ServeHTTP

func (action GetEvents) ServeHTTP(w http.ResponseWriter, req *http.Request)

type GetFieldReport

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

func (GetFieldReport) ServeHTTP

func (action GetFieldReport) ServeHTTP(w http.ResponseWriter, req *http.Request)

type GetFieldReportAttachment

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

func (GetFieldReportAttachment) ServeHTTP

func (action GetFieldReportAttachment) ServeHTTP(w http.ResponseWriter, req *http.Request)

type GetFieldReports

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

func (GetFieldReports) ServeHTTP

func (action GetFieldReports) ServeHTTP(w http.ResponseWriter, req *http.Request)

type GetIncident

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

func (GetIncident) ServeHTTP

func (action GetIncident) ServeHTTP(w http.ResponseWriter, req *http.Request)

type GetIncidentAttachment

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

func (GetIncidentAttachment) ServeHTTP

func (action GetIncidentAttachment) ServeHTTP(w http.ResponseWriter, req *http.Request)

type GetIncidentTypes

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

func (GetIncidentTypes) ServeHTTP

func (action GetIncidentTypes) ServeHTTP(w http.ResponseWriter, req *http.Request)

type GetIncidents

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

func (GetIncidents) ServeHTTP

func (action GetIncidents) ServeHTTP(w http.ResponseWriter, req *http.Request)

type GetPersonnel

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

func (GetPersonnel) ServeHTTP

func (action GetPersonnel) ServeHTTP(w http.ResponseWriter, req *http.Request)

type GetPersonnelResponse

type GetPersonnelResponse []imsjson.Person

type GetRuntimeMetrics

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

func (GetRuntimeMetrics) ServeHTTP

func (action GetRuntimeMetrics) ServeHTTP(w http.ResponseWriter, req *http.Request)

type GetStay

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

func (GetStay) ServeHTTP

func (action GetStay) ServeHTTP(w http.ResponseWriter, req *http.Request)

type GetStayAttachment

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

func (GetStayAttachment) ServeHTTP

func (action GetStayAttachment) ServeHTTP(w http.ResponseWriter, req *http.Request)

type GetStays

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

func (GetStays) ServeHTTP

func (action GetStays) ServeHTTP(w http.ResponseWriter, req *http.Request)

type GetStreets

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

func (GetStreets) ServeHTTP

func (action GetStreets) ServeHTTP(w http.ResponseWriter, req *http.Request)

type IMSEvent

type IMSEvent struct {
	EventID   int64
	EventData IMSEventData
}

func (IMSEvent) Data

func (e IMSEvent) Data() string

func (IMSEvent) Event

func (e IMSEvent) Event() string

func (IMSEvent) Id

func (e IMSEvent) Id() string

type IMSEventData

type IMSEventData struct {
	EventID int32  `json:"event_id,omitzero"`
	Comment string `json:"comment,omitzero"`

	IncidentNumber    int32 `json:"incident_number,omitzero"`
	FieldReportNumber int32 `json:"field_report_number,omitzero"`
	StayNumber        int32 `json:"stay_number,omitzero"`
	InitialEvent      bool  `json:"initial_event,omitzero"`
}

type JWTContext

type JWTContext struct {
	Claims *authz.IMSClaims
	Error  error
}

type NewFieldReport

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

func (NewFieldReport) ServeHTTP

func (action NewFieldReport) ServeHTTP(w http.ResponseWriter, req *http.Request)

type NewIncident

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

func (NewIncident) ServeHTTP

func (action NewIncident) ServeHTTP(w http.ResponseWriter, req *http.Request)

type NewStay

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

func (NewStay) ServeHTTP

func (action NewStay) ServeHTTP(w http.ResponseWriter, req *http.Request)

type PerformGC

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

func (PerformGC) ServeHTTP

func (action PerformGC) ServeHTTP(w http.ResponseWriter, req *http.Request)

type PostAuth

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

func (PostAuth) ServeHTTP

func (action PostAuth) ServeHTTP(w http.ResponseWriter, req *http.Request)

type PostAuthRequest

type PostAuthRequest struct {
	Identification string `json:"identification"`
	Password       string `json:"password"`
}

type PostAuthResponse

type PostAuthResponse struct {
	Token         string `json:"token"`
	ExpiresUnixMs int64  `json:"expires_unix_ms"`
}

type PostEventAccess

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

func (PostEventAccess) ServeHTTP

func (action PostEventAccess) ServeHTTP(w http.ResponseWriter, req *http.Request)

type RefreshAccessToken

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

func (RefreshAccessToken) ServeHTTP

func (action RefreshAccessToken) ServeHTTP(w http.ResponseWriter, req *http.Request)

type RefreshAccessTokenResponse

type RefreshAccessTokenResponse struct {
	Token         string `json:"token"`
	ExpiresUnixMs int64  `json:"expires_unix_ms"`
}

type UpdateDestinations

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

func (UpdateDestinations) ServeHTTP

func (action UpdateDestinations) ServeHTTP(w http.ResponseWriter, req *http.Request)

Jump to

Keyboard shortcuts

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