Documentation
¶
Index ¶
- Constants
- Variables
- func Close(c Store)
- func ConstraintViolation(e error) error
- func CtxWithDB(ctx context.Context, conn Store) context.Context
- func ErrIsConstraintViolation(e error) *string
- func IsConstraintViolation(err error, constraint string) bool
- func IsNoRows(err error) bool
- func IsSystemConstraintViolation(e error) bool
- func IsTGConstraintViolation(e error) bool
- func RegisterDataTypes(ctx context.Context, conn *pgx.Conn) error
- type AddAlertParams
- type AddCallParams
- type AddLearnedTalkgroupParams
- type AddRefJournalParams
- type Alert
- type ApiKey
- type AudioMIME
- type AudioRefJournal
- type Call
- type Constraint
- type CopyFromUUIDIter
- type CopyFromer
- type CreateAPIKeyParams
- type CreateIncidentParams
- type CreateShareParams
- type CreateUserParams
- type CreateWebPushSubscriptionParams
- type DBTX
- type DetailedCountRefJournalRow
- type GetAPIKeyRow
- type GetCallAudioByIDRow
- type GetCallAudioParams
- type GetCallAudioRow
- type GetCallRow
- type GetCallStatsByIntervalRow
- type GetCallStatsByTalkgroupRow
- type GetCallsRow
- type GetIncidentCallsRow
- type GetIncidentRow
- type GetIncidentTalkgroupsRow
- type GetPrunableAudioRefsRow
- type GetPushSubscriptionsRow
- type GetRefJournalParams
- type GetSharesPParams
- type GetSharesPRow
- type GetSweptCallsWithRefRow
- type GetTalkgroupIDsByTagsRow
- type GetTalkgroupRow
- type GetTalkgroupSubscriptionsRow
- type GetTalkgroupsPParams
- type GetTalkgroupsPRow
- type GetTalkgroupsRow
- type GetTalkgroupsWithAllTagsRow
- type GetTalkgroupsWithAnyTagsRow
- type GetTranscriptsContextParams
- type GetTranscriptsContextRow
- type GetWebPushSubscriptionsSubscribedRow
- type Incident
- type IncidentsCall
- type ListCallsCountParams
- type ListCallsPParams
- type ListCallsPRow
- type ListIncidentsPParams
- type ListIncidentsPRow
- type NullAudioMIME
- type PartitionResult
- type Postgres
- type Querier
- type Queries
- func (q *Queries) AddAlert(ctx context.Context, arg AddAlertParams) error
- func (q *Queries) AddCall(ctx context.Context, arg AddCallParams) error
- func (q *Queries) AddLearnedTalkgroup(ctx context.Context, arg AddLearnedTalkgroupParams) (Talkgroup, error)
- func (q *Queries) AddRefJournal(ctx context.Context, arg AddRefJournalParams) (int64, error)
- func (q *Queries) AddToIncident(ctx context.Context, incidentID uuid.UUID, callIds []uuid.UUID, notes [][]byte) error
- func (q *Queries) BulkSetTalkgroupTags(ctx context.Context, tgs TGTuplesU, tags []string) error
- func (q *Queries) CallInIncident(ctx context.Context, incidentID uuid.UUID, callID uuid.UUID) (bool, error)
- func (q *Queries) CleanupSweptCalls(ctx context.Context, rangeStart time.Time, rangeEnd time.Time) (int64, error)
- func (q *Queries) CopyIntoFsckTempTable(ctx context.Context, tableName string, ids iter.Seq[uuid.UUID], ...) (int64, error)
- func (q *Queries) CountRefJournal(ctx context.Context, missing *bool, since *time.Time, until *time.Time) (int64, error)
- func (q *Queries) CreateAPIKey(ctx context.Context, arg CreateAPIKeyParams) error
- func (q *Queries) CreateFsckTempTable(ctx context.Context) (tableName string, err error)
- func (q *Queries) CreateIncident(ctx context.Context, arg CreateIncidentParams) (Incident, error)
- func (q *Queries) CreatePartition(ctx context.Context, parentTable, partitionName string, start, end time.Time) error
- func (q *Queries) CreateShare(ctx context.Context, arg CreateShareParams) error
- func (q *Queries) CreateSystem(ctx context.Context, iD int, name string, learned bool) error
- func (q *Queries) CreateUser(ctx context.Context, arg CreateUserParams) (User, error)
- func (q *Queries) CreateWebPushSubscription(ctx context.Context, arg CreateWebPushSubscriptionParams) error
- func (q *Queries) DBTX() DBTX
- func (q *Queries) DeleteAPIKey(ctx context.Context, apiKey *string) error
- func (q *Queries) DeleteCall(ctx context.Context, id uuid.UUID) error
- func (q *Queries) DeleteExpiredPushSubscriptions(ctx context.Context) (int64, error)
- func (q *Queries) DeleteIncident(ctx context.Context, id uuid.UUID) error
- func (q *Queries) DeletePushSubscriptionByID(ctx context.Context, id int64) error
- func (q *Queries) DeletePushSubscriptionBySub(ctx context.Context, subscription []byte) error
- func (q *Queries) DeleteSetting(ctx context.Context, name string) error
- func (q *Queries) DeleteShare(ctx context.Context, id string) error
- func (q *Queries) DeleteSystem(ctx context.Context, id int) error
- func (q *Queries) DeleteTalkgroup(ctx context.Context, systemID int32, tGID int32) error
- func (q *Queries) DeleteUser(ctx context.Context, username string) error
- func (q *Queries) DetachPartition(ctx context.Context, parentTable, partitionName string) error
- func (q *Queries) DetailedCountRefJournal(ctx context.Context) ([]DetailedCountRefJournalRow, error)
- func (q *Queries) DisableUser(ctx context.Context, username string) error
- func (q *Queries) DropPartition(ctx context.Context, partitionName string) error
- func (q *Queries) DropRefJournal(ctx context.Context, id int64) error
- func (q *Queries) DropTable(ctx context.Context, tableName string) error
- func (q *Queries) FsckRefs(ctx context.Context, tableName, backend string) (callsDangling int64, err error)
- func (q *Queries) GetAPIKey(ctx context.Context, key *string, jwtID pgtype.UUID, kind int) (GetAPIKeyRow, error)
- func (q *Queries) GetAlertByURLTag(ctx context.Context, urlTag *string) (Alert, error)
- func (q *Queries) GetAllTalkgroupTags(ctx context.Context) ([]string, error)
- func (q *Queries) GetAppPrefs(ctx context.Context, appName string, uid int) ([]byte, error)
- func (q *Queries) GetAudioRefJournalCb(ctx context.Context, arg GetRefJournalParams, cb func(AudioRefJournal)) error
- func (q *Queries) GetCall(ctx context.Context, id uuid.UUID) (GetCallRow, error)
- func (q *Queries) GetCallAudio(ctx context.Context, arg GetCallAudioParams) ([]GetCallAudioRow, error)
- func (q *Queries) GetCallAudioByID(ctx context.Context, id uuid.UUID) (GetCallAudioByIDRow, error)
- func (q *Queries) GetCallAudioCb(ctx context.Context, arg GetCallAudioParams, cb func(*GetCallAudioRow) error) error
- func (q *Queries) GetCallAudioCount(ctx context.Context, arg GetCallAudioParams) (int64, error)
- func (q *Queries) GetCallStatsByInterval(ctx context.Context, truncField string, start *time.Time, end *time.Time) ([]GetCallStatsByIntervalRow, error)
- func (q *Queries) GetCallStatsByTalkgroup(ctx context.Context, truncField string, start *time.Time, end *time.Time) ([]GetCallStatsByTalkgroupRow, error)
- func (q *Queries) GetCallSubmitter(ctx context.Context, id uuid.UUID) (*int32, error)
- func (q *Queries) GetCalls(ctx context.Context, ids []uuid.UUID) ([]GetCallsRow, error)
- func (q *Queries) GetDatabaseSize(ctx context.Context) (string, error)
- func (q *Queries) GetIncident(ctx context.Context, id uuid.UUID) (GetIncidentRow, error)
- func (q *Queries) GetIncidentCallCount(ctx context.Context, incidentID uuid.UUID) (int64, error)
- func (q *Queries) GetIncidentCalls(ctx context.Context, iD uuid.UUID, offset int32, perPage *int32) ([]GetIncidentCallsRow, error)
- func (q *Queries) GetIncidentOwner(ctx context.Context, id uuid.UUID) (int, error)
- func (q *Queries) GetIncidentTalkgroups(ctx context.Context, incidentID uuid.UUID) ([]GetIncidentTalkgroupsRow, error)
- func (q *Queries) GetPrunableAudioRefs(ctx context.Context, partitionStart time.Time, partitionEnd time.Time) ([]GetPrunableAudioRefsRow, error)
- func (q *Queries) GetPushSubscriptions(ctx context.Context) ([]GetPushSubscriptionsRow, error)
- func (q *Queries) GetRefJournal(ctx context.Context, arg GetRefJournalParams) ([]AudioRefJournal, error)
- func (q *Queries) GetSetting(ctx context.Context, name string) ([]byte, error)
- func (q *Queries) GetShare(ctx context.Context, id string) (Share, error)
- func (q *Queries) GetSharesP(ctx context.Context, arg GetSharesPParams) ([]GetSharesPRow, error)
- func (q *Queries) GetSharesPCount(ctx context.Context, ownerID *int32) (int64, error)
- func (q *Queries) GetSweptCallsWithRef(ctx context.Context) ([]GetSweptCallsWithRefRow, error)
- func (q *Queries) GetSystemName(ctx context.Context, systemID int) (string, error)
- func (q *Queries) GetSystemSubscriptions(ctx context.Context, userID int) ([]int32, error)
- func (q *Queries) GetTablePartitions(ctx context.Context, schemaName, tableName string) (partitions []PartitionResult, err error)
- func (q *Queries) GetTalkgroup(ctx context.Context, systemID int32, tGID int32) (GetTalkgroupRow, error)
- func (q *Queries) GetTalkgroupIDsByTags(ctx context.Context, allTags []string, anyTags []string, notAnyTags []string) ([]GetTalkgroupIDsByTagsRow, error)
- func (q *Queries) GetTalkgroupSubscriptions(ctx context.Context, userID int) ([]GetTalkgroupSubscriptionsRow, error)
- func (q *Queries) GetTalkgroupTags(ctx context.Context, systemID int32, tGID int32) ([]string, error)
- func (q *Queries) GetTalkgroups(ctx context.Context, system *int32, withIgnored bool, filter *string) ([]GetTalkgroupsRow, error)
- func (q *Queries) GetTalkgroupsBySysTGID(ctx context.Context, ids TGTuplesU) ([]GetTalkgroupsRow, error)
- func (q *Queries) GetTalkgroupsCount(ctx context.Context, system *int32, withIgnored bool, filter *string) (int64, error)
- func (q *Queries) GetTalkgroupsP(ctx context.Context, arg GetTalkgroupsPParams) ([]GetTalkgroupsPRow, error)
- func (q *Queries) GetTalkgroupsWithAllTags(ctx context.Context, tags []string) ([]GetTalkgroupsWithAllTagsRow, error)
- func (q *Queries) GetTalkgroupsWithAnyTags(ctx context.Context, tags []string) ([]GetTalkgroupsWithAnyTagsRow, error)
- func (q *Queries) GetTranscriptsContext(ctx context.Context, arg GetTranscriptsContextParams) ([]GetTranscriptsContextRow, error)
- func (q *Queries) GetUserByID(ctx context.Context, id int) (User, error)
- func (q *Queries) GetUserByUsername(ctx context.Context, username string) (User, error)
- func (q *Queries) GetUsers(ctx context.Context) ([]User, error)
- func (q *Queries) GetWebPushSubscriptionsSubscribed(ctx context.Context, systemID int32, tGID int32) ([]GetWebPushSubscriptionsSubscribedRow, error)
- func (q *Queries) IncrementRefJournal(ctx context.Context, id int64) error
- func (q *Queries) ListCallsCount(ctx context.Context, arg ListCallsCountParams) (int64, error)
- func (q *Queries) ListCallsP(ctx context.Context, arg ListCallsPParams) ([]ListCallsPRow, error)
- func (q *Queries) ListIncidentsCount(ctx context.Context, start *time.Time, end *time.Time, filter *string) (int64, error)
- func (q *Queries) ListIncidentsP(ctx context.Context, arg ListIncidentsPParams) ([]ListIncidentsPRow, error)
- func (q *Queries) PruneAlerts(ctx context.Context, before time.Time) (int64, error)
- func (q *Queries) PruneShares(ctx context.Context) error
- func (q *Queries) RecordUserLogin(ctx context.Context, username string, lastLoginAt *time.Time, ...) error
- func (q *Queries) RemoveFromIncident(ctx context.Context, iD uuid.UUID, callIds []uuid.UUID) error
- func (q *Queries) RestoreTalkgroupVersion(ctx context.Context, versionIds int) (Talkgroup, error)
- func (q *Queries) SetAppPrefs(ctx context.Context, appName string, prefs []byte, uid int) error
- func (q *Queries) SetCallAudio(ctx context.Context, iD uuid.UUID, audioRef []byte, audioBlob []byte) error
- func (q *Queries) SetCallTranscript(ctx context.Context, iD uuid.UUID, transcript *string) (SetCallTranscriptRow, error)
- func (q *Queries) SetRefJournalPrune(ctx context.Context, iD int64, pruneAfter *time.Time) error
- func (q *Queries) SetSetting(ctx context.Context, name string, updatedBy *int32, value []byte) error
- func (q *Queries) SetSweptAudioAndClearRef(ctx context.Context, audioBlob []byte, iD uuid.UUID) error
- func (q *Queries) SetSweptCallAudio(ctx context.Context, iD uuid.UUID, audioRef []byte, audioBlob []byte) error
- func (q *Queries) SetTalkgroupTags(ctx context.Context, tags []string, systemID int32, tGID int32) error
- func (q *Queries) StoreDeletedTGVersion(ctx context.Context, systemID *int32, tGID *int32, submitter *int32) error
- func (q *Queries) StoreTGVersion(ctx context.Context, arg []StoreTGVersionParams) *StoreTGVersionBatchResults
- func (q *Queries) SubscribeSystems(ctx context.Context, userID int, systemIds []int32) error
- func (q *Queries) SubscribeTalkgroups(ctx context.Context, userID int, systemIds []int32, tgids []int32) error
- func (q *Queries) SweepCalls(ctx context.Context, rangeStart time.Time, rangeEnd time.Time) (int64, error)
- func (q *Queries) UnsubscribeAllSystems(ctx context.Context, userID int) (int64, error)
- func (q *Queries) UnsubscribeAllTalkgroups(ctx context.Context, userID int) (int64, error)
- func (q *Queries) UnsubscribeSystems(ctx context.Context, userID int, systemIds []int32) (int64, error)
- func (q *Queries) UnsubscribeTGsInSystems(ctx context.Context, userID int, systemIds []int32) (int64, error)
- func (q *Queries) UnsubscribeTalkgroups(ctx context.Context, userID int, tgs []TGID) (int64, error)
- func (q *Queries) UpdateCallIncidentNotes(ctx context.Context, notes []byte, incidentID uuid.UUID, callID uuid.UUID) error
- func (q *Queries) UpdateIncident(ctx context.Context, arg UpdateIncidentParams) (Incident, error)
- func (q *Queries) UpdatePassword(ctx context.Context, username string, password string) error
- func (q *Queries) UpdatePushSubscription(ctx context.Context, newSubscription []byte, userID int, ...) (int64, error)
- func (q *Queries) UpdateTalkgroup(ctx context.Context, arg UpdateTalkgroupParams) (Talkgroup, error)
- func (q *Queries) UpdateUser(ctx context.Context, arg UpdateUserParams) (User, error)
- func (q *Queries) UpsertTalkgroup(ctx context.Context, arg []UpsertTalkgroupParams) *UpsertTalkgroupBatchResults
- func (q *Queries) WithTx(tx pgx.Tx) *Queries
- type SetCallTranscriptRow
- type Setting
- type Share
- type Store
- type StoreTGVersionBatchResults
- type StoreTGVersionParams
- type SweptCall
- type System
- type SystemNotificationSubscription
- type TGID
- type TGTuples
- type TGTuplesU
- type Talkgroup
- type TalkgroupNotificationSubscription
- type TalkgroupVersion
- type UpdateIncidentParams
- type UpdateTalkgroupParams
- type UpdateUserParams
- type UpsertTalkgroupBatchResults
- type UpsertTalkgroupParams
- type User
- type WebpushSubscription
Constants ¶
View Source
const ( APIKeysOwnerIDNameKey = "api_keys_owner_id_name_key" AudioRefJournalCallIDBackendRefKey = "audio_ref_journal_call_id_backend_ref_key" SweptCallsPK = "swept_calls_pkey" TGConstraintName = "calls_system_talkgroup_fkey" SysConstraintName = "talkgroups_system_id_fkey" UsernameConstraintName = "users_username_key" EmailConstraintName = "users_email_key" )
View Source
const DBCtxKey dBCtxKey = "dbctx"
Variables ¶
View Source
var ( ErrLowerBoundAfterUpperBound = errors.New("lower bound after upper bound") ErrCantDecodePartitionBounds = errors.New("cannot decode partition bounds") )
View Source
var Constraints = map[string]Constraint{ APIKeysOwnerIDNameKey: {"API key with this name already exists"}, AudioRefJournalCallIDBackendRefKey: {"delete entry for call already exists"}, SweptCallsPK: {"call already swept"}, TGConstraintName: {"talkgroup already exists in system"}, SysConstraintName: {"system already exists"}, UsernameConstraintName: {"username already taken"}, EmailConstraintName: {"an account with that email already exists"}, }
View Source
var (
ErrBatchAlreadyClosed = errors.New("batch already closed")
)
Functions ¶
func ConstraintViolation ¶
func IsConstraintViolation ¶
IsConstraintViolation is a convenience function to test whether an error is a PgError indicating constraint violation.
func IsNoRows ¶
IsNoRows is a convenience function that returns whether a returned error is a database no rows error.
func IsTGConstraintViolation ¶
Types ¶
type AddAlertParams ¶
type AddAlertParams struct {
Time time.Time `db:"time" json:"time"`
TGID int `db:"tgid" json:"tgid"`
SystemID int `db:"system_id" json:"systemId"`
Weight *float32 `db:"weight" json:"weight"`
Score *float32 `db:"score" json:"score"`
OrigScore *float32 `db:"orig_score" json:"origScore"`
Notified bool `db:"notified" json:"notified"`
Metadata []byte `db:"metadata" json:"metadata"`
ContextWindow pgtype.Range[pgtype.Timestamptz] `db:"context_window" json:"contextWindow"`
URLTag *string `db:"url_tag" json:"urlTag"`
}
type AddCallParams ¶
type AddCallParams struct {
ID uuid.UUID `db:"id" json:"id"`
Submitter *int32 `db:"submitter" json:"submitter"`
System int `db:"system" json:"system"`
Talkgroup int `db:"talkgroup" json:"talkgroup"`
CallDate time.Time `db:"call_date" json:"callDate"`
AudioName *string `db:"audio_name" json:"audioName"`
AudioBlob []byte `db:"audio_blob" json:"audioBlob"`
AudioType NullAudioMIME `db:"audio_type" json:"audioType"`
AudioRef []byte `db:"audio_ref" json:"audioRef"`
Duration *int32 `db:"duration" json:"duration"`
Frequency int `db:"frequency" json:"frequency"`
Frequencies []int `db:"frequencies" json:"frequencies"`
Patches []int `db:"patches" json:"patches"`
TalkerAlias *string `db:"talker_alias" json:"talkerAlias,omitempty"`
TGLabel *string `db:"tg_label" json:"tgLabel"`
TGAlphaTag *string `db:"tg_alpha_tag" json:"tgAlphaTag"`
TGGroup *string `db:"tg_group" json:"tgGroup"`
Source int `db:"source" json:"source"`
}
type AddRefJournalParams ¶
type Alert ¶
type Alert struct {
ID int `db:"id" json:"id,omitempty" yaml:"id,omitempty"`
Time time.Time `db:"time" json:"time,omitempty" yaml:"time,omitempty"`
TGID int `db:"tgid" json:"tgid,omitempty" yaml:"tgid,omitempty"`
SystemID int `db:"system_id" json:"systemId,omitempty" yaml:"system_id,omitempty"`
Weight *float32 `db:"weight" json:"weight,omitempty" yaml:"weight,omitempty"`
Score *float32 `db:"score" json:"score,omitempty" yaml:"score,omitempty"`
OrigScore *float32 `db:"orig_score" json:"origScore,omitempty" yaml:"orig_score,omitempty"`
Notified bool `db:"notified" json:"notified,omitempty" yaml:"notified,omitempty"`
Metadata []byte `db:"metadata" json:"metadata,omitempty" yaml:"metadata,omitempty"`
ContextWindow pgtype.Range[pgtype.Timestamptz] `db:"context_window" json:"contextWindow,omitempty" yaml:"context_window,omitempty"`
URLTag *string `db:"url_tag" json:"urlTag,omitempty" yaml:"url_tag,omitempty"`
}
type ApiKey ¶
type ApiKey struct {
ID int `db:"id" json:"id,omitempty" yaml:"id,omitempty"`
OwnerID int `db:"owner_id" json:"ownerId,omitempty" yaml:"owner_id,omitempty"`
Name *string `db:"name" json:"name,omitempty" yaml:"name,omitempty"`
CreatedAt time.Time `db:"created_at" json:"createdAt,omitempty" yaml:"created_at,omitempty"`
Expires *time.Time `db:"expires" json:"expires,omitempty" yaml:"expires,omitempty"`
Disabled bool `db:"disabled" json:"disabled,omitempty" yaml:"disabled,omitempty"`
Kind int `db:"kind" json:"kind,omitempty" yaml:"kind,omitempty"`
ApiKey *string `db:"api_key" json:"apiKey,omitempty" yaml:"api_key,omitempty"`
JwtID pgtype.UUID `db:"jwt_id" json:"jwtId,omitempty" yaml:"jwt_id,omitempty"`
Scopes []string `db:"scopes" json:"scopes,omitempty" yaml:"scopes,omitempty"`
}
type AudioRefJournal ¶
type AudioRefJournal struct {
ID int64 `db:"id" json:"id,omitempty" yaml:"id,omitempty"`
CallID pgtype.UUID `db:"call_id" json:"callId,omitempty" yaml:"call_id,omitempty"`
Backend string `db:"backend" json:"backend,omitempty" yaml:"backend,omitempty"`
Ref []byte `db:"ref" json:"ref,omitempty" yaml:"ref,omitempty"`
PruneAfter *time.Time `db:"prune_after" json:"pruneAfter,omitempty" yaml:"prune_after,omitempty"`
LastTry time.Time `db:"last_try" json:"lastTry,omitempty" yaml:"last_try,omitempty"`
Tries int `db:"tries" json:"tries,omitempty" yaml:"tries,omitempty"`
}
type Call ¶
type Call struct {
ID uuid.UUID `db:"id" json:"id,omitempty" yaml:"id,omitempty"`
Submitter *int32 `db:"submitter" json:"submitter,omitempty" yaml:"submitter,omitempty"`
System int `db:"system" json:"system,omitempty" yaml:"system,omitempty"`
Talkgroup int `db:"talkgroup" json:"talkgroup,omitempty" yaml:"talkgroup,omitempty"`
CallDate time.Time `db:"call_date" json:"callDate,omitempty" yaml:"call_date,omitempty"`
AudioName *string `db:"audio_name" json:"audioName,omitempty" yaml:"audio_name,omitempty"`
AudioBlob []byte `db:"audio_blob" json:"audioBlob,omitempty" yaml:"audio_blob,omitempty"`
Duration *int32 `db:"duration" json:"duration,omitempty" yaml:"duration,omitempty"`
AudioType NullAudioMIME `db:"audio_type" json:"audioType,omitempty" yaml:"audio_type,omitempty"`
AudioRef []byte `db:"audio_ref" json:"audioRef,omitempty" yaml:"audio_ref,omitempty"`
Frequency int `db:"frequency" json:"frequency,omitempty" yaml:"frequency,omitempty"`
Frequencies []int `db:"frequencies" json:"frequencies,omitempty" yaml:"frequencies,omitempty"`
Patches []int `db:"patches" json:"patches,omitempty" yaml:"patches,omitempty"`
TalkerAlias *string `db:"talker_alias" json:"talkerAlias,omitempty" yaml:"talker_alias,omitempty"`
TGLabel *string `db:"tg_label" json:"tgLabel,omitempty" yaml:"tg_label,omitempty"`
TGAlphaTag *string `db:"tg_alpha_tag" json:"tgAlphaTag,omitempty" yaml:"tg_alpha_tag,omitempty"`
TGGroup *string `db:"tg_group" json:"tgGroup,omitempty" yaml:"tg_group,omitempty"`
Source int `db:"source" json:"source,omitempty" yaml:"source,omitempty"`
Transcript *string `db:"transcript" json:"transcript,omitempty" yaml:"transcript,omitempty"`
DanglingAt *time.Time `db:"dangling_at" json:"danglingAt,omitempty" yaml:"dangling_at,omitempty"`
}
type Constraint ¶
type Constraint struct {
// contains filtered or unexported fields
}
func (Constraint) Error ¶
func (c Constraint) Error() error
type CopyFromUUIDIter ¶
type CopyFromUUIDIter struct {
// contains filtered or unexported fields
}
func NewCopyFromUUIDIter ¶
func (*CopyFromUUIDIter) Close ¶
func (cfi *CopyFromUUIDIter) Close()
func (*CopyFromUUIDIter) Err ¶
func (cfi *CopyFromUUIDIter) Err() error
func (*CopyFromUUIDIter) Next ¶
func (cfi *CopyFromUUIDIter) Next() bool
func (*CopyFromUUIDIter) Stop ¶
func (cfi *CopyFromUUIDIter) Stop()
func (*CopyFromUUIDIter) Values ¶
func (cfi *CopyFromUUIDIter) Values() ([]any, error)
type CopyFromer ¶
type CopyFromer interface {
CopyFrom(ctx context.Context, tableName pgx.Identifier, columnNames []string, rowSrc pgx.CopyFromSource) (int64, error)
}
type CreateAPIKeyParams ¶
type CreateAPIKeyParams struct {
OwnerID int `db:"owner_id" json:"ownerId"`
Name *string `db:"name" json:"name"`
Kind int `db:"kind" json:"kind"`
CreatedAt time.Time `db:"created_at" json:"createdAt"`
Expires *time.Time `db:"expires" json:"expires"`
JwtID pgtype.UUID `db:"jwt_id" json:"jwtId"`
Scopes []string `db:"scopes" json:"scopes"`
Disabled bool `db:"disabled" json:"disabled"`
HashedKey *string `db:"hashed_key" json:"hashedKey"`
}
type CreateIncidentParams ¶
type CreateIncidentParams struct {
ID uuid.UUID `db:"id" json:"id"`
Name string `db:"name" json:"name"`
OwnerID int `db:"owner_id" json:"ownerId"`
Description *string `db:"description" json:"description"`
StartTime *time.Time `db:"start_time" json:"startTime"`
EndTime *time.Time `db:"end_time" json:"endTime"`
Location []byte `db:"location" json:"location"`
Metadata jsontypes.Metadata `db:"metadata" json:"metadata"`
}
type CreateShareParams ¶
type CreateShareParams struct {
}
type CreateUserParams ¶
type GetAPIKeyRow ¶
type GetAPIKeyRow struct {
ID int `db:"id" json:"id"`
OwnerID int `db:"owner_id" json:"ownerId"`
Name *string `db:"name" json:"name"`
Kind int `db:"kind" json:"kind"`
CreatedAt time.Time `db:"created_at" json:"createdAt"`
Expires *time.Time `db:"expires" json:"expires"`
Disabled bool `db:"disabled" json:"disabled"`
ApiKey *string `db:"api_key" json:"apiKey"`
JwtID pgtype.UUID `db:"jwt_id" json:"jwtId"`
Scopes []string `db:"scopes" json:"scopes"`
Username string `db:"username" json:"username"`
}
type GetCallAudioByIDRow ¶
type GetCallAudioByIDRow struct {
CallDate time.Time `db:"call_date" json:"callDate"`
AudioName *string `db:"audio_name" json:"audioName"`
AudioType NullAudioMIME `db:"audio_type" json:"audioType"`
AudioRef []byte `db:"audio_ref" json:"audioRef"`
AudioBlob []byte `db:"audio_blob" json:"audioBlob"`
}
type GetCallAudioParams ¶
type GetCallAudioParams struct {
Count int32 `db:"count" json:"count"`
Swept *bool `db:"swept" json:"swept"`
Start *time.Time `db:"start" json:"start"`
End *time.Time `db:"end" json:"end"`
TagsAny []string `db:"tags_any" json:"tagsAny"`
TagsNot []string `db:"tags_not" json:"tagsNot"`
LongerThan pgtype.Numeric `db:"longer_than" json:"longerThan"`
HasBackend *string `db:"has_backend" json:"hasBackend"`
NotHasBackend *string `db:"not_has_backend" json:"notHasBackend"`
HasBlob *bool `db:"has_blob" json:"hasBlob"`
}
type GetCallAudioRow ¶
type GetCallAudioRow struct {
ID uuid.UUID `db:"id" json:"id"`
CallDate time.Time `db:"call_date" json:"callDate"`
AudioName *string `db:"audio_name" json:"audioName"`
AudioType NullAudioMIME `db:"audio_type" json:"audioType"`
AudioRef []byte `db:"audio_ref" json:"audioRef"`
AudioBlob []byte `db:"audio_blob" json:"audioBlob"`
Swept bool `db:"swept" json:"swept"`
}
type GetCallRow ¶
type GetCallRow struct {
ID uuid.UUID `db:"id" json:"id"`
Submitter *int32 `db:"submitter" json:"submitter"`
System int `db:"system" json:"system"`
Talkgroup int `db:"talkgroup" json:"talkgroup"`
CallDate time.Time `db:"call_date" json:"callDate"`
AudioName *string `db:"audio_name" json:"audioName"`
AudioType NullAudioMIME `db:"audio_type" json:"audioType"`
AudioRef []byte `db:"audio_ref" json:"audioRef"`
Duration *int32 `db:"duration" json:"duration"`
Frequency int `db:"frequency" json:"frequency"`
Frequencies []int `db:"frequencies" json:"frequencies"`
Patches []int `db:"patches" json:"patches"`
TalkerAlias *string `db:"talker_alias" json:"talkerAlias,omitempty"`
TGLabel *string `db:"tg_label" json:"tgLabel"`
TGAlphaTag *string `db:"tg_alpha_tag" json:"tgAlphaTag"`
TGGroup *string `db:"tg_group" json:"tgGroup"`
Source int `db:"source" json:"source"`
Transcript *string `db:"transcript" json:"transcript"`
DanglingAt *time.Time `db:"dangling_at" json:"danglingAt"`
}
type GetCallsRow ¶
type GetCallsRow struct {
Call Call `db:"call" json:"call"`
}
type GetIncidentCallsRow ¶
type GetIncidentCallsRow struct {
CallID uuid.UUID `db:"call_id" json:"callId"`
CallDate *time.Time `db:"call_date" json:"callDate"`
Duration *int32 `db:"duration" json:"duration"`
SystemID int `db:"system_id" json:"systemId"`
TGID int `db:"tgid" json:"tgid"`
Notes []byte `db:"notes" json:"notes"`
Submitter *int32 `db:"submitter" json:"submitter"`
AudioName *string `db:"audio_name" json:"audioName"`
AudioType NullAudioMIME `db:"audio_type" json:"audioType"`
AudioRef []byte `db:"audio_ref" json:"audioRef"`
Frequency int `db:"frequency" json:"frequency"`
Frequencies []int `db:"frequencies" json:"frequencies"`
TalkerAlias *string `db:"talker_alias" json:"talkerAlias"`
Patches []int `db:"patches" json:"patches"`
Source int `db:"source" json:"source"`
Transcript *string `db:"transcript" json:"transcript"`
}
type GetIncidentRow ¶
type GetPrunableAudioRefsRow ¶
type GetPushSubscriptionsRow ¶
type GetRefJournalParams ¶
type GetSharesPParams ¶
type GetSharesPParams struct {
}
type GetSharesPRow ¶
type GetSharesPRow struct {
}
type GetSweptCallsWithRefRow ¶
type GetTalkgroupRow ¶
type GetTalkgroupRow struct {
Talkgroup Talkgroup `db:"talkgroup" json:"talkgroup"`
System System `db:"system" json:"system"`
}
func (GetTalkgroupRow) GetLearned ¶
func (g GetTalkgroupRow) GetLearned() bool
func (GetTalkgroupRow) GetSystem ¶
func (g GetTalkgroupRow) GetSystem() System
func (GetTalkgroupRow) GetTalkgroup ¶
func (g GetTalkgroupRow) GetTalkgroup() Talkgroup
type GetTalkgroupsPParams ¶
type GetTalkgroupsPParams struct {
System *int32 `db:"system" json:"system"`
WithIgnored bool `db:"with_ignored" json:"withIgnored"`
Filter *string `db:"filter" json:"filter"`
OrderBy string `db:"order_by" json:"orderBy"`
Offset int32 `db:"offset" json:"offset"`
PerPage int32 `db:"per_page" json:"perPage"`
}
type GetTalkgroupsPRow ¶
type GetTalkgroupsPRow struct {
Talkgroup Talkgroup `db:"talkgroup" json:"talkgroup"`
System System `db:"system" json:"system"`
}
func (GetTalkgroupsPRow) GetLearned ¶
func (g GetTalkgroupsPRow) GetLearned() bool
func (GetTalkgroupsPRow) GetSystem ¶
func (g GetTalkgroupsPRow) GetSystem() System
func (GetTalkgroupsPRow) GetTalkgroup ¶
func (g GetTalkgroupsPRow) GetTalkgroup() Talkgroup
type GetTalkgroupsRow ¶
type GetTalkgroupsRow struct {
Talkgroup Talkgroup `db:"talkgroup" json:"talkgroup"`
System System `db:"system" json:"system"`
}
func (GetTalkgroupsRow) GetLearned ¶
func (d GetTalkgroupsRow) GetLearned() bool
func (GetTalkgroupsRow) GetSystem ¶
func (d GetTalkgroupsRow) GetSystem() System
func (GetTalkgroupsRow) GetTalkgroup ¶
func (d GetTalkgroupsRow) GetTalkgroup() Talkgroup
type GetTalkgroupsWithAllTagsRow ¶
type GetTalkgroupsWithAllTagsRow struct {
Talkgroup Talkgroup `db:"talkgroup" json:"talkgroup"`
}
type GetTalkgroupsWithAnyTagsRow ¶
type GetTalkgroupsWithAnyTagsRow struct {
Talkgroup Talkgroup `db:"talkgroup" json:"talkgroup"`
}
type GetTranscriptsContextParams ¶
type GetTranscriptsContextParams struct {
System int `db:"system" json:"system"`
Talkgroup int `db:"talkgroup" json:"talkgroup"`
Lookback pgtype.Interval `db:"lookback" json:"lookback"`
DurationMS *int32 `db:"duration_ms" json:"durationMs"`
NumTranscripts int32 `db:"num_transcripts" json:"numTranscripts"`
}
type Incident ¶
type Incident struct {
ID uuid.UUID `db:"id" json:"id,omitempty" yaml:"id,omitempty"`
Name string `db:"name" json:"name,omitempty" yaml:"name,omitempty"`
OwnerID int `db:"owner_id" json:"ownerId,omitempty" yaml:"owner_id,omitempty"`
Description *string `db:"description" json:"description,omitempty" yaml:"description,omitempty"`
CreatedAt *time.Time `db:"created_at" json:"createdAt,omitempty" yaml:"created_at,omitempty"`
StartTime *time.Time `db:"start_time" json:"startTime,omitempty" yaml:"start_time,omitempty"`
EndTime *time.Time `db:"end_time" json:"endTime,omitempty" yaml:"end_time,omitempty"`
Location []byte `db:"location" json:"location,omitempty" yaml:"location,omitempty"`
Metadata jsontypes.Metadata `db:"metadata" json:"metadata,omitempty" yaml:"metadata,omitempty"`
}
type IncidentsCall ¶
type IncidentsCall struct {
IncidentID uuid.UUID `db:"incident_id" json:"incidentId,omitempty" yaml:"incident_id,omitempty"`
CallID uuid.UUID `db:"call_id" json:"callId,omitempty" yaml:"call_id,omitempty"`
CallsTblID pgtype.UUID `db:"calls_tbl_id" json:"callsTblId,omitempty" yaml:"calls_tbl_id,omitempty"`
SweptCallID pgtype.UUID `db:"swept_call_id" json:"sweptCallId,omitempty" yaml:"swept_call_id,omitempty"`
CallDate *time.Time `db:"call_date" json:"callDate,omitempty" yaml:"call_date,omitempty"`
Notes []byte `db:"notes" json:"notes,omitempty" yaml:"notes,omitempty"`
}
func (*IncidentsCall) UnmarshalYAML ¶
func (c *IncidentsCall) UnmarshalYAML(n *yaml.Node) error
type ListCallsCountParams ¶
type ListCallsCountParams struct {
Start *time.Time `db:"start" json:"start"`
End *time.Time `db:"end" json:"end"`
TagsAny []string `db:"tags_any" json:"tagsAny"`
TagsNot []string `db:"tags_not" json:"tagsNot"`
TGFilter *string `db:"tg_filter" json:"tgFilter"`
SourceFilter *string `db:"source_filter" json:"sourceFilter"`
LongerThan pgtype.Numeric `db:"longer_than" json:"longerThan"`
UnknownTG bool `db:"unknown_tg" json:"unknownTg"`
TranscriptSearch *string `db:"transcript_search" json:"transcriptSearch"`
Dangling bool `db:"dangling" json:"dangling"`
}
type ListCallsPParams ¶
type ListCallsPParams struct {
TranscriptSearch *string `db:"transcript_search" json:"transcriptSearch"`
Start *time.Time `db:"start" json:"start"`
End *time.Time `db:"end" json:"end"`
TagsAny []string `db:"tags_any" json:"tagsAny"`
TagsNot []string `db:"tags_not" json:"tagsNot"`
TGFilter *string `db:"tg_filter" json:"tgFilter"`
SourceFilter *string `db:"source_filter" json:"sourceFilter"`
LongerThan pgtype.Numeric `db:"longer_than" json:"longerThan"`
UnknownTG bool `db:"unknown_tg" json:"unknownTg"`
Dangling bool `db:"dangling" json:"dangling"`
Direction string `db:"direction" json:"direction"`
Offset int32 `db:"offset" json:"offset"`
PerPage int32 `db:"per_page" json:"perPage"`
}
type ListCallsPRow ¶
type ListCallsPRow struct {
ID uuid.UUID `db:"id" json:"id"`
CallDate time.Time `db:"call_date" json:"callDate"`
Duration *int32 `db:"duration" json:"duration"`
SystemID int `db:"system_id" json:"systemId"`
TGID int `db:"tgid" json:"tgid"`
TalkerAlias *string `db:"talker_alias" json:"talkerAlias,omitempty"`
Source int `db:"source" json:"source,omitzero"`
Transcript interface{} `db:"transcript" json:"transcript,omitempty"`
Incidents int64 `db:"incidents" json:"incidents,omitempty,omitzero"`
HasTranscript bool `db:"has_transcript" json:"hasTranscript,omitzero"`
MissingAudio bool `db:"missing_audio" json:"missingAudio,omitzero"`
}
type ListIncidentsPParams ¶
type ListIncidentsPRow ¶
type ListIncidentsPRow struct {
ID uuid.UUID `db:"id" json:"id"`
Name string `db:"name" json:"name"`
OwnerID int `db:"owner_id" json:"ownerId"`
Description *string `db:"description" json:"description"`
CreatedAt *time.Time `db:"created_at" json:"createdAt"`
StartTime *time.Time `db:"start_time" json:"startTime"`
EndTime *time.Time `db:"end_time" json:"endTime"`
Location []byte `db:"location" json:"location"`
Metadata jsontypes.Metadata `db:"metadata" json:"metadata"`
Owner string `db:"owner" json:"owner"`
CallsCount int64 `db:"calls_count" json:"callsCount"`
}
type NullAudioMIME ¶
type NullAudioMIME struct {
AudioMIME AudioMIME `json:"audioMime,omitempty" yaml:"audio_mime,omitempty"`
Valid bool `json:"valid,omitempty" yaml:"valid,omitempty"` // Valid is true if AudioMIME is not NULL
}
func (*NullAudioMIME) Scan ¶
func (ns *NullAudioMIME) Scan(value interface{}) error
Scan implements the Scanner interface.
func (*NullAudioMIME) UnmarshalJSON ¶
func (ns *NullAudioMIME) UnmarshalJSON(b []byte) error
func (*NullAudioMIME) UnmarshalText ¶
func (ns *NullAudioMIME) UnmarshalText(b []byte) error
type PartitionResult ¶
type PartitionResult struct {
ParentTable string
Schema string
Name string
LowerBound string
UpperBound string
}
func (PartitionResult) ParseBounds ¶
type Querier ¶
type Querier interface {
AddAlert(ctx context.Context, arg AddAlertParams) error
AddCall(ctx context.Context, arg AddCallParams) error
AddLearnedTalkgroup(ctx context.Context, arg AddLearnedTalkgroupParams) (Talkgroup, error)
AddRefJournal(ctx context.Context, arg AddRefJournalParams) (int64, error)
AddToIncident(ctx context.Context, incidentID uuid.UUID, callIds []uuid.UUID, notes [][]byte) error
CallInIncident(ctx context.Context, incidentID uuid.UUID, callID uuid.UUID) (bool, error)
CleanupSweptCalls(ctx context.Context, rangeStart time.Time, rangeEnd time.Time) (int64, error)
CountRefJournal(ctx context.Context, missing *bool, since *time.Time, until *time.Time) (int64, error)
CreateAPIKey(ctx context.Context, arg CreateAPIKeyParams) error
CreateIncident(ctx context.Context, arg CreateIncidentParams) (Incident, error)
CreateSystem(ctx context.Context, iD int, name string, learned bool) error
CreateUser(ctx context.Context, arg CreateUserParams) (User, error)
CreateWebPushSubscription(ctx context.Context, arg CreateWebPushSubscriptionParams) error
DeleteAPIKey(ctx context.Context, apiKey *string) error
DeleteCall(ctx context.Context, id uuid.UUID) error
DeleteExpiredPushSubscriptions(ctx context.Context) (int64, error)
DeleteIncident(ctx context.Context, id uuid.UUID) error
DeletePushSubscriptionByID(ctx context.Context, id int64) error
DeletePushSubscriptionBySub(ctx context.Context, subscription []byte) error
DeleteSetting(ctx context.Context, name string) error
DeleteSystem(ctx context.Context, id int) error
DeleteTalkgroup(ctx context.Context, systemID int32, tGID int32) error
DeleteUser(ctx context.Context, username string) error
DetailedCountRefJournal(ctx context.Context) ([]DetailedCountRefJournalRow, error)
DisableUser(ctx context.Context, username string) error
DropRefJournal(ctx context.Context, id int64) error
GetAPIKey(ctx context.Context, key *string, jwtID pgtype.UUID, kind int) (GetAPIKeyRow, error)
GetAlertByURLTag(ctx context.Context, urlTag *string) (Alert, error)
GetAllTalkgroupTags(ctx context.Context) ([]string, error)
GetAppPrefs(ctx context.Context, appName string, uid int) ([]byte, error)
GetCall(ctx context.Context, id uuid.UUID) (GetCallRow, error)
// For now, this must be kept in sync with pkg/database/calls.go GetCallAudioCount and GetCallAudioCb Scan
GetCallAudio(ctx context.Context, arg GetCallAudioParams) ([]GetCallAudioRow, error)
GetCallAudioByID(ctx context.Context, id uuid.UUID) (GetCallAudioByIDRow, error)
GetCallStatsByInterval(ctx context.Context, truncField string, start *time.Time, end *time.Time) ([]GetCallStatsByIntervalRow, error)
GetCallStatsByTalkgroup(ctx context.Context, truncField string, start *time.Time, end *time.Time) ([]GetCallStatsByTalkgroupRow, error)
GetCallSubmitter(ctx context.Context, id uuid.UUID) (*int32, error)
GetCalls(ctx context.Context, ids []uuid.UUID) ([]GetCallsRow, error)
GetDatabaseSize(ctx context.Context) (string, error)
GetIncident(ctx context.Context, id uuid.UUID) (GetIncidentRow, error)
GetIncidentCallCount(ctx context.Context, incidentID uuid.UUID) (int64, error)
GetIncidentCalls(ctx context.Context, iD uuid.UUID, offset int32, perPage *int32) ([]GetIncidentCallsRow, error)
GetIncidentOwner(ctx context.Context, id uuid.UUID) (int, error)
GetIncidentTalkgroups(ctx context.Context, incidentID uuid.UUID) ([]GetIncidentTalkgroupsRow, error)
GetPrunableAudioRefs(ctx context.Context, partitionStart time.Time, partitionEnd time.Time) ([]GetPrunableAudioRefsRow, error)
GetPushSubscriptions(ctx context.Context) ([]GetPushSubscriptionsRow, error)
GetRefJournal(ctx context.Context, arg GetRefJournalParams) ([]AudioRefJournal, error)
GetSetting(ctx context.Context, name string) ([]byte, error)
GetSweptCallsWithRef(ctx context.Context) ([]GetSweptCallsWithRefRow, error)
GetSystemName(ctx context.Context, systemID int) (string, error)
GetSystemSubscriptions(ctx context.Context, userID int) ([]int32, error)
GetTalkgroup(ctx context.Context, systemID int32, tGID int32) (GetTalkgroupRow, error)
GetTalkgroupIDsByTags(ctx context.Context, allTags []string, anyTags []string, notAnyTags []string) ([]GetTalkgroupIDsByTagsRow, error)
GetTalkgroupSubscriptions(ctx context.Context, userID int) ([]GetTalkgroupSubscriptionsRow, error)
GetTalkgroupTags(ctx context.Context, systemID int32, tGID int32) ([]string, error)
GetTalkgroups(ctx context.Context, system *int32, withIgnored bool, filter *string) ([]GetTalkgroupsRow, error)
GetTalkgroupsCount(ctx context.Context, system *int32, withIgnored bool, filter *string) (int64, error)
GetTalkgroupsP(ctx context.Context, arg GetTalkgroupsPParams) ([]GetTalkgroupsPRow, error)
GetTalkgroupsWithAllTags(ctx context.Context, tags []string) ([]GetTalkgroupsWithAllTagsRow, error)
GetTalkgroupsWithAnyTags(ctx context.Context, tags []string) ([]GetTalkgroupsWithAnyTagsRow, error)
GetTranscriptsContext(ctx context.Context, arg GetTranscriptsContextParams) ([]GetTranscriptsContextRow, error)
GetUserByID(ctx context.Context, id int) (User, error)
GetUserByUsername(ctx context.Context, username string) (User, error)
GetUsers(ctx context.Context) ([]User, error)
GetWebPushSubscriptionsSubscribed(ctx context.Context, systemID int32, tGID int32) ([]GetWebPushSubscriptionsSubscribedRow, error)
IncrementRefJournal(ctx context.Context, id int64) error
ListCallsCount(ctx context.Context, arg ListCallsCountParams) (int64, error)
ListCallsP(ctx context.Context, arg ListCallsPParams) ([]ListCallsPRow, error)
ListIncidentsCount(ctx context.Context, start *time.Time, end *time.Time, filter *string) (int64, error)
ListIncidentsP(ctx context.Context, arg ListIncidentsPParams) ([]ListIncidentsPRow, error)
PruneAlerts(ctx context.Context, before time.Time) (int64, error)
RecordUserLogin(ctx context.Context, username string, lastLoginAt *time.Time, lastLoginFrom *netip.Addr) error
RemoveFromIncident(ctx context.Context, iD uuid.UUID, callIds []uuid.UUID) error
RestoreTalkgroupVersion(ctx context.Context, versionIds int) (Talkgroup, error)
SetAppPrefs(ctx context.Context, appName string, prefs []byte, uid int) error
SetCallAudio(ctx context.Context, iD uuid.UUID, audioRef []byte, audioBlob []byte) error
SetCallTranscript(ctx context.Context, iD uuid.UUID, transcript *string) (SetCallTranscriptRow, error)
SetRefJournalPrune(ctx context.Context, iD int64, pruneAfter *time.Time) error
SetSetting(ctx context.Context, name string, updatedBy *int32, value []byte) error
SetSweptAudioAndClearRef(ctx context.Context, audioBlob []byte, iD uuid.UUID) error
SetSweptCallAudio(ctx context.Context, iD uuid.UUID, audioRef []byte, audioBlob []byte) error
SetTalkgroupTags(ctx context.Context, tags []string, systemID int32, tGID int32) error
StoreDeletedTGVersion(ctx context.Context, systemID *int32, tGID *int32, submitter *int32) error
StoreTGVersion(ctx context.Context, arg []StoreTGVersionParams) *StoreTGVersionBatchResults
SubscribeSystems(ctx context.Context, userID int, systemIds []int32) error
SubscribeTalkgroups(ctx context.Context, userID int, systemIds []int32, tgids []int32) error
// This is used to sweep calls that are part of an incident prior to pruning a partition.
SweepCalls(ctx context.Context, rangeStart time.Time, rangeEnd time.Time) (int64, error)
UnsubscribeAllSystems(ctx context.Context, userID int) (int64, error)
UnsubscribeAllTalkgroups(ctx context.Context, userID int) (int64, error)
UnsubscribeSystems(ctx context.Context, userID int, systemIds []int32) (int64, error)
UnsubscribeTGsInSystems(ctx context.Context, userID int, systemIds []int32) (int64, error)
UnsubscribeTalkgroups(ctx context.Context, userID int, tgs []TGID) (int64, error)
UpdateCallIncidentNotes(ctx context.Context, notes []byte, incidentID uuid.UUID, callID uuid.UUID) error
UpdateIncident(ctx context.Context, arg UpdateIncidentParams) (Incident, error)
UpdatePassword(ctx context.Context, username string, password string) error
UpdatePushSubscription(ctx context.Context, newSubscription []byte, userID int, oldSubscription []byte) (int64, error)
UpdateTalkgroup(ctx context.Context, arg UpdateTalkgroupParams) (Talkgroup, error)
UpdateUser(ctx context.Context, arg UpdateUserParams) (User, error)
UpsertTalkgroup(ctx context.Context, arg []UpsertTalkgroupParams) *UpsertTalkgroupBatchResults
}
type Queries ¶
type Queries struct {
// contains filtered or unexported fields
}
func (*Queries) AddAlert ¶
func (q *Queries) AddAlert(ctx context.Context, arg AddAlertParams) error
func (*Queries) AddLearnedTalkgroup ¶
func (*Queries) AddRefJournal ¶
func (*Queries) AddToIncident ¶
func (*Queries) BulkSetTalkgroupTags ¶
func (*Queries) CallInIncident ¶
func (*Queries) CleanupSweptCalls ¶
func (*Queries) CopyIntoFsckTempTable ¶
func (*Queries) CountRefJournal ¶
func (*Queries) CreateAPIKey ¶
func (q *Queries) CreateAPIKey(ctx context.Context, arg CreateAPIKeyParams) error
func (*Queries) CreateFsckTempTable ¶
func (*Queries) CreateIncident ¶
func (*Queries) CreatePartition ¶
func (*Queries) CreateShare ¶
func (q *Queries) CreateShare(ctx context.Context, arg CreateShareParams) error
func (*Queries) CreateSystem ¶
func (*Queries) CreateUser ¶
func (*Queries) CreateWebPushSubscription ¶
func (q *Queries) CreateWebPushSubscription(ctx context.Context, arg CreateWebPushSubscriptionParams) error
func (*Queries) DeleteAPIKey ¶
func (*Queries) DeleteExpiredPushSubscriptions ¶
func (*Queries) DeleteIncident ¶
func (*Queries) DeletePushSubscriptionByID ¶
func (*Queries) DeletePushSubscriptionBySub ¶
func (*Queries) DeleteSetting ¶
func (*Queries) DeleteTalkgroup ¶
func (*Queries) DeleteUser ¶
func (*Queries) DetachPartition ¶
func (*Queries) DetailedCountRefJournal ¶
func (q *Queries) DetailedCountRefJournal(ctx context.Context) ([]DetailedCountRefJournalRow, error)
func (*Queries) DisableUser ¶
func (*Queries) DropPartition ¶
func (*Queries) DropRefJournal ¶
func (*Queries) GetAlertByURLTag ¶
func (*Queries) GetAllTalkgroupTags ¶
func (*Queries) GetAppPrefs ¶
func (*Queries) GetAudioRefJournalCb ¶
func (q *Queries) GetAudioRefJournalCb(ctx context.Context, arg GetRefJournalParams, cb func(AudioRefJournal)) error
func (*Queries) GetCallAudio ¶
func (q *Queries) GetCallAudio(ctx context.Context, arg GetCallAudioParams) ([]GetCallAudioRow, error)
For now, this must be kept in sync with pkg/database/calls.go GetCallAudioCount and GetCallAudioCb Scan
func (*Queries) GetCallAudioByID ¶
func (*Queries) GetCallAudioCb ¶
func (q *Queries) GetCallAudioCb(ctx context.Context, arg GetCallAudioParams, cb func(*GetCallAudioRow) error) error
func (*Queries) GetCallAudioCount ¶
func (*Queries) GetCallStatsByInterval ¶
func (*Queries) GetCallStatsByTalkgroup ¶
func (*Queries) GetCallSubmitter ¶
func (*Queries) GetDatabaseSize ¶
func (*Queries) GetIncident ¶
func (*Queries) GetIncidentCallCount ¶
func (*Queries) GetIncidentCalls ¶
func (*Queries) GetIncidentOwner ¶
func (*Queries) GetIncidentTalkgroups ¶
func (*Queries) GetPrunableAudioRefs ¶
func (*Queries) GetPushSubscriptions ¶
func (q *Queries) GetPushSubscriptions(ctx context.Context) ([]GetPushSubscriptionsRow, error)
func (*Queries) GetRefJournal ¶
func (q *Queries) GetRefJournal(ctx context.Context, arg GetRefJournalParams) ([]AudioRefJournal, error)
func (*Queries) GetSetting ¶
func (*Queries) GetSharesP ¶
func (q *Queries) GetSharesP(ctx context.Context, arg GetSharesPParams) ([]GetSharesPRow, error)
func (*Queries) GetSharesPCount ¶
func (*Queries) GetSweptCallsWithRef ¶
func (q *Queries) GetSweptCallsWithRef(ctx context.Context) ([]GetSweptCallsWithRefRow, error)
func (*Queries) GetSystemName ¶
func (*Queries) GetSystemSubscriptions ¶
func (*Queries) GetTablePartitions ¶
func (*Queries) GetTalkgroup ¶
func (*Queries) GetTalkgroupIDsByTags ¶
func (*Queries) GetTalkgroupSubscriptions ¶
func (*Queries) GetTalkgroupTags ¶
func (*Queries) GetTalkgroups ¶
func (*Queries) GetTalkgroupsBySysTGID ¶
func (*Queries) GetTalkgroupsCount ¶
func (*Queries) GetTalkgroupsP ¶
func (q *Queries) GetTalkgroupsP(ctx context.Context, arg GetTalkgroupsPParams) ([]GetTalkgroupsPRow, error)
func (*Queries) GetTalkgroupsWithAllTags ¶
func (*Queries) GetTalkgroupsWithAnyTags ¶
func (*Queries) GetTranscriptsContext ¶
func (q *Queries) GetTranscriptsContext(ctx context.Context, arg GetTranscriptsContextParams) ([]GetTranscriptsContextRow, error)
func (*Queries) GetUserByID ¶
func (*Queries) GetUserByUsername ¶
func (*Queries) GetWebPushSubscriptionsSubscribed ¶
func (*Queries) IncrementRefJournal ¶
func (*Queries) ListCallsCount ¶
func (*Queries) ListCallsP ¶
func (q *Queries) ListCallsP(ctx context.Context, arg ListCallsPParams) ([]ListCallsPRow, error)
func (*Queries) ListIncidentsCount ¶
func (*Queries) ListIncidentsP ¶
func (q *Queries) ListIncidentsP(ctx context.Context, arg ListIncidentsPParams) ([]ListIncidentsPRow, error)
func (*Queries) PruneAlerts ¶
func (*Queries) RecordUserLogin ¶
func (*Queries) RemoveFromIncident ¶
func (*Queries) RestoreTalkgroupVersion ¶
func (*Queries) SetAppPrefs ¶
func (*Queries) SetCallAudio ¶
func (*Queries) SetCallTranscript ¶
func (*Queries) SetRefJournalPrune ¶
func (*Queries) SetSetting ¶
func (*Queries) SetSweptAudioAndClearRef ¶
func (*Queries) SetSweptCallAudio ¶
func (*Queries) SetTalkgroupTags ¶
func (*Queries) StoreDeletedTGVersion ¶
func (*Queries) StoreTGVersion ¶
func (q *Queries) StoreTGVersion(ctx context.Context, arg []StoreTGVersionParams) *StoreTGVersionBatchResults
func (*Queries) SubscribeSystems ¶
func (*Queries) SubscribeTalkgroups ¶
func (*Queries) SweepCalls ¶
func (q *Queries) SweepCalls(ctx context.Context, rangeStart time.Time, rangeEnd time.Time) (int64, error)
This is used to sweep calls that are part of an incident prior to pruning a partition.
func (*Queries) UnsubscribeAllSystems ¶
func (*Queries) UnsubscribeAllTalkgroups ¶
func (*Queries) UnsubscribeSystems ¶
func (*Queries) UnsubscribeTGsInSystems ¶
func (*Queries) UnsubscribeTalkgroups ¶
func (*Queries) UpdateCallIncidentNotes ¶
func (*Queries) UpdateIncident ¶
func (*Queries) UpdatePassword ¶
func (*Queries) UpdatePushSubscription ¶
func (*Queries) UpdateTalkgroup ¶
func (*Queries) UpdateUser ¶
func (*Queries) UpsertTalkgroup ¶
func (q *Queries) UpsertTalkgroup(ctx context.Context, arg []UpsertTalkgroupParams) *UpsertTalkgroupBatchResults
type SetCallTranscriptRow ¶
type Store ¶
type Store interface {
Querier
DB() *Postgres
DBTX() DBTX
InTx(context.Context, func(Store) error) error
PoolTx(ctx context.Context, opts pgx.TxOptions) (dbtx *Postgres, tx pgx.Tx, err error)
// DropTable drops the specified table.
DropTable(ctx context.Context, tableName string) error
// contains filtered or unexported methods
}
type StoreTGVersionBatchResults ¶
type StoreTGVersionBatchResults struct {
// contains filtered or unexported fields
}
func (*StoreTGVersionBatchResults) Close ¶
func (b *StoreTGVersionBatchResults) Close() error
func (*StoreTGVersionBatchResults) Exec ¶
func (b *StoreTGVersionBatchResults) Exec(f func(int, error))
type StoreTGVersionParams ¶
type SweptCall ¶
type SweptCall struct {
ID uuid.UUID `db:"id" json:"id,omitempty" yaml:"id,omitempty"`
Submitter *int32 `db:"submitter" json:"submitter,omitempty" yaml:"submitter,omitempty"`
System int `db:"system" json:"system,omitempty" yaml:"system,omitempty"`
Talkgroup int `db:"talkgroup" json:"talkgroup,omitempty" yaml:"talkgroup,omitempty"`
CallDate time.Time `db:"call_date" json:"callDate,omitempty" yaml:"call_date,omitempty"`
AudioName *string `db:"audio_name" json:"audioName,omitempty" yaml:"audio_name,omitempty"`
AudioBlob []byte `db:"audio_blob" json:"audioBlob,omitempty" yaml:"audio_blob,omitempty"`
Duration *int32 `db:"duration" json:"duration,omitempty" yaml:"duration,omitempty"`
AudioType NullAudioMIME `db:"audio_type" json:"audioType,omitempty" yaml:"audio_type,omitempty"`
AudioRef []byte `db:"audio_ref" json:"audioRef,omitempty" yaml:"audio_ref,omitempty"`
Frequency int `db:"frequency" json:"frequency,omitempty" yaml:"frequency,omitempty"`
Frequencies []int `db:"frequencies" json:"frequencies,omitempty" yaml:"frequencies,omitempty"`
Patches []int `db:"patches" json:"patches,omitempty" yaml:"patches,omitempty"`
TalkerAlias *string `db:"talker_alias" json:"talkerAlias,omitempty" yaml:"talker_alias,omitempty"`
TGLabel *string `db:"tg_label" json:"tgLabel,omitempty" yaml:"tg_label,omitempty"`
TGAlphaTag *string `db:"tg_alpha_tag" json:"tgAlphaTag,omitempty" yaml:"tg_alpha_tag,omitempty"`
TGGroup *string `db:"tg_group" json:"tgGroup,omitempty" yaml:"tg_group,omitempty"`
Source int `db:"source" json:"source,omitempty" yaml:"source,omitempty"`
Transcript *string `db:"transcript" json:"transcript,omitempty" yaml:"transcript,omitempty"`
DanglingAt *time.Time `db:"dangling_at" json:"danglingAt,omitempty" yaml:"dangling_at,omitempty"`
}
type Talkgroup ¶
type Talkgroup struct {
ID int `db:"id" json:"id,omitempty" yaml:"id,omitempty"`
SystemID int32 `db:"system_id" json:"systemId,omitempty" yaml:"system_id,omitempty"`
TGID int32 `db:"tgid" json:"tgid,omitempty" yaml:"tgid,omitempty"`
Name *string `db:"name" json:"name,omitempty" yaml:"name,omitempty"`
AlphaTag *string `db:"alpha_tag" json:"alphaTag,omitempty" yaml:"alpha_tag,omitempty"`
TGGroup *string `db:"tg_group" json:"tgGroup,omitempty" yaml:"tg_group,omitempty"`
Frequency *int32 `db:"frequency" json:"frequency,omitempty" yaml:"frequency,omitempty"`
Metadata jsontypes.Metadata `db:"metadata" json:"metadata,omitempty" yaml:"metadata,omitempty"`
Tags []string `db:"tags" json:"tags,omitempty" yaml:"tags,omitempty"`
Alert bool `db:"alert" json:"alert,omitempty" yaml:"alert,omitempty"`
AlertRules rules.AlertRules `db:"alert_rules" json:"alertRules,omitempty" yaml:"alert_rules,omitempty"`
Weight float32 `db:"weight" json:"weight,omitempty" yaml:"weight,omitempty"`
Learned bool `db:"learned" json:"learned,omitempty" yaml:"learned,omitempty"`
Ignored bool `db:"ignored" json:"ignored,omitempty" yaml:"ignored,omitempty"`
}
func (Talkgroup) GetLearned ¶
func (Talkgroup) GetTalkgroup ¶
type TalkgroupVersion ¶
type TalkgroupVersion struct {
ID int `db:"id" json:"id,omitempty" yaml:"id,omitempty"`
Time time.Time `db:"time" json:"time,omitempty" yaml:"time,omitempty"`
CreatedBy *int32 `db:"created_by" json:"createdBy,omitempty" yaml:"created_by,omitempty"`
Deleted *bool `db:"deleted" json:"deleted,omitempty" yaml:"deleted,omitempty"`
SystemID *int32 `db:"system_id" json:"systemId,omitempty" yaml:"system_id,omitempty"`
TGID *int32 `db:"tgid" json:"tgid,omitempty" yaml:"tgid,omitempty"`
Name *string `db:"name" json:"name,omitempty" yaml:"name,omitempty"`
AlphaTag *string `db:"alpha_tag" json:"alphaTag,omitempty" yaml:"alpha_tag,omitempty"`
TGGroup *string `db:"tg_group" json:"tgGroup,omitempty" yaml:"tg_group,omitempty"`
Frequency *int32 `db:"frequency" json:"frequency,omitempty" yaml:"frequency,omitempty"`
Metadata []byte `db:"metadata" json:"metadata,omitempty" yaml:"metadata,omitempty"`
Tags []string `db:"tags" json:"tags,omitempty" yaml:"tags,omitempty"`
Alert *bool `db:"alert" json:"alert,omitempty" yaml:"alert,omitempty"`
AlertRules []byte `db:"alert_rules" json:"alertRules,omitempty" yaml:"alert_rules,omitempty"`
Weight *float32 `db:"weight" json:"weight,omitempty" yaml:"weight,omitempty"`
Learned *bool `db:"learned" json:"learned,omitempty" yaml:"learned,omitempty"`
Ignored *bool `db:"ignored" json:"ignored,omitempty" yaml:"ignored,omitempty"`
}
type UpdateIncidentParams ¶
type UpdateIncidentParams struct {
Name *string `db:"name" json:"name"`
Description *string `db:"description" json:"description"`
StartTime *time.Time `db:"start_time" json:"startTime"`
EndTime *time.Time `db:"end_time" json:"endTime"`
Location []byte `db:"location" json:"location"`
Metadata jsontypes.Metadata `db:"metadata" json:"metadata"`
ID uuid.UUID `db:"id" json:"id"`
}
type UpdateTalkgroupParams ¶
type UpdateTalkgroupParams struct {
Name *string `db:"name" json:"name"`
AlphaTag *string `db:"alpha_tag" json:"alphaTag"`
TGGroup *string `db:"tg_group" json:"tgGroup"`
Frequency *int32 `db:"frequency" json:"frequency"`
Metadata jsontypes.Metadata `db:"metadata" json:"metadata"`
Tags []string `db:"tags" json:"tags"`
Alert *bool `db:"alert" json:"alert"`
AlertRules rules.AlertRules `db:"alert_rules" json:"alertRules"`
Weight *float32 `db:"weight" json:"weight"`
Learned *bool `db:"learned" json:"learned"`
ID *int32 `db:"id" json:"id"`
SystemID *int32 `db:"system_id" json:"systemId"`
TGID *int32 `db:"tgid" json:"tgid"`
}
type UpdateUserParams ¶
type UpsertTalkgroupBatchResults ¶
type UpsertTalkgroupBatchResults struct {
// contains filtered or unexported fields
}
func (*UpsertTalkgroupBatchResults) Close ¶
func (b *UpsertTalkgroupBatchResults) Close() error
type UpsertTalkgroupParams ¶
type UpsertTalkgroupParams struct {
SystemID int32 `db:"system_id" json:"systemId"`
TGID int32 `db:"tgid" json:"tgid"`
Name *string `db:"name" json:"name"`
AlphaTag *string `db:"alpha_tag" json:"alphaTag"`
TGGroup *string `db:"tg_group" json:"tgGroup"`
Frequency *int32 `db:"frequency" json:"frequency"`
Metadata jsontypes.Metadata `db:"metadata" json:"metadata"`
Tags []string `db:"tags" json:"tags"`
Alert interface{} `db:"alert" json:"alert"`
AlertRules rules.AlertRules `db:"alert_rules" json:"alertRules"`
Weight pgtype.Numeric `db:"weight" json:"weight"`
Learned *bool `db:"learned" json:"learned"`
}
type User ¶
type User struct {
ID int `db:"id" json:"id,omitempty" yaml:"id,omitempty"`
Username string `db:"username" json:"username,omitempty" yaml:"username,omitempty"`
Password string `db:"password" json:"password,omitempty" yaml:"password,omitempty"`
RealName *string `db:"real_name" json:"realName,omitempty" yaml:"real_name,omitempty"`
Email string `db:"email" json:"email,omitempty" yaml:"email,omitempty"`
Roles []string `db:"roles" json:"roles,omitempty" yaml:"roles,omitempty"`
DisabledAt *time.Time `db:"disabled_at" json:"disabledAt,omitempty" yaml:"disabled_at,omitempty"`
LastLoginAt *time.Time `db:"last_login_at" json:"lastLoginAt,omitempty" yaml:"last_login_at,omitempty"`
LastLoginFrom *netip.Addr `db:"last_login_from" json:"lastLoginFrom,omitempty" yaml:"last_login_from,omitempty"`
PasswordSetAt time.Time `db:"password_set_at" json:"passwordSetAt,omitempty" yaml:"password_set_at,omitempty"`
Prefs []byte `db:"prefs" json:"prefs,omitempty" yaml:"prefs,omitempty"`
}
type WebpushSubscription ¶
type WebpushSubscription struct {
ID int64 `db:"id" json:"id,omitempty" yaml:"id,omitempty"`
UserID int `db:"user_id" json:"userId,omitempty" yaml:"user_id,omitempty"`
CreatedAt time.Time `db:"created_at" json:"createdAt,omitempty" yaml:"created_at,omitempty"`
UpdatedAt time.Time `db:"updated_at" json:"updatedAt,omitempty" yaml:"updated_at,omitempty"`
Expiration *time.Time `db:"expiration" json:"expiration,omitempty" yaml:"expiration,omitempty"`
Subscription []byte `db:"subscription" json:"subscription,omitempty" yaml:"subscription,omitempty"`
Client *string `db:"client" json:"client,omitempty" yaml:"client,omitempty"`
}
func (*WebpushSubscription) UnmarshalYAML ¶
func (c *WebpushSubscription) UnmarshalYAML(n *yaml.Node) error
Source Files
¶
Click to show internal directories.
Click to hide internal directories.