Documentation ¶
Index ¶
- Variables
- func AddTimeseriesToCollectionGroup(db *sqlx.DB, collectionGroupID *uuid.UUID, timeseriesID *uuid.UUID) error
- func ConstantMeasurement(db *sqlx.DB, tsID *uuid.UUID, constantName string) (*ts.Measurement, error)
- func CreateAlerts(db *sqlx.DB, alertConfigIDS []uuid.UUID) error
- func CreateCalculation(db *sqlx.DB, formula *Calculation) error
- func CreateInstrumentConstants(db *sqlx.DB, tt []ts.Timeseries) ([]ts.Timeseries, error)
- func CreateInstrumentGroupInstruments(db *sqlx.DB, instrumentGroupID uuid.UUID, instrumentID uuid.UUID) error
- func CreateOrUpdateInclinometerMeasurements(db *sqlx.DB, im []ts.InclinometerMeasurementCollection, p *Profile, ...) ([]ts.InclinometerMeasurementCollection, error)
- func CreateOrUpdateInstrumentStatus(db *sqlx.DB, instrumentID *uuid.UUID, ss []InstrumentStatus) error
- func CreateOrUpdateTimeseriesMeasurements(db *sqlx.DB, mc []ts.MeasurementCollection) ([]ts.MeasurementCollection, error)
- func CreateProjectTimeseries(db *sqlx.DB, projectID *uuid.UUID, timeseriesID *uuid.UUID) error
- func CreateTimeseries(db *sqlx.DB, tt []ts.Timeseries) ([]ts.Timeseries, error)
- func CreateTimeseriesConstant(db *sqlx.DB, tsID *uuid.UUID, parameterName string, unitName string, ...) error
- func DeleteCalculation(db *sqlx.DB, formulaID uuid.UUID) error
- func DeleteCollectionGroup(db *sqlx.DB, projectID *uuid.UUID, collectionGroupID *uuid.UUID) error
- func DeleteFlagInstrument(db *sqlx.DB, projectID, instrumentID *uuid.UUID) error
- func DeleteFlagInstrumentGroup(db *sqlx.DB, ID uuid.UUID) error
- func DeleteFlagProject(db *sqlx.DB, id uuid.UUID) error
- func DeleteInclinometerMeasurements(db *sqlx.DB, id *uuid.UUID, time time.Time) error
- func DeleteInstrumentAlertConfig(db *sqlx.DB, alertConfigID *uuid.UUID, instrumentID *uuid.UUID) error
- func DeleteInstrumentConstant(db *sqlx.DB, instrumentID *uuid.UUID, timeseriesID *uuid.UUID) error
- func DeleteInstrumentGroupInstruments(db *sqlx.DB, instrumentGroupID uuid.UUID, instrumentID uuid.UUID) error
- func DeleteInstrumentNote(db *sqlx.DB, id *uuid.UUID) error
- func DeleteInstrumentStatus(db *sqlx.DB, id *uuid.UUID) error
- func DeletePlotConfiguration(db *sqlx.DB, projectID *uuid.UUID, plotConfigID *uuid.UUID) error
- func DeleteProjectTimeseries(db *sqlx.DB, projectID *uuid.UUID, timeseriesID *uuid.UUID) error
- func DeleteTimeserieMeasurements(db *sqlx.DB, id *uuid.UUID, time time.Time) error
- func DeleteTimeseries(db *sqlx.DB, id *uuid.UUID) error
- func DeleteToken(db *sqlx.DB, profileID *uuid.UUID, tokenID *string) error
- func DoCheckAlerts(db *sqlx.DB) error
- func GetInstrumentCount(db *sqlx.DB) (int, error)
- func GetProjectCount(db *sqlx.DB) (int, error)
- func GetTimeseries(db *sqlx.DB, id *uuid.UUID) (*ts.Timeseries, error)
- func GetTimeseriesProjectMap(db *sqlx.DB, timeseriesIDS []uuid.UUID) (map[uuid.UUID]uuid.UUID, error)
- func JSONType(b []byte) string
- func ListCalculationSlugs(db *sqlx.DB) ([]string, error)
- func ListCollectionGroupSlugs(db *sqlx.DB, projectID *uuid.UUID) ([]string, error)
- func ListInclinometerMeasurementValues(db *sqlx.DB, timeseriesID *uuid.UUID, time time.Time, ...) ([]*ts.InclinometerMeasurementValues, error)
- func ListInclinometerMeasurements(db *sqlx.DB, timeseriesID *uuid.UUID, tw *ts.TimeWindow) (*ts.InclinometerMeasurementCollection, error)
- func ListInstrumentConstants(db *sqlx.DB, id *uuid.UUID) ([]ts.Timeseries, error)
- func ListInstrumentGroupSlugs(db *sqlx.DB) ([]string, error)
- func ListInstrumentGroupTimeseries(db *sqlx.DB, instrumentGroupID *uuid.UUID) ([]ts.Timeseries, error)
- func ListInstrumentSlugs(db *sqlx.DB) ([]string, error)
- func ListInstrumentTimeseries(db *sqlx.DB, projectID *uuid.UUID, instrumentID *uuid.UUID) ([]ts.Timeseries, error)
- func ListPlotConfigurationSlugs(db *sqlx.DB) ([]string, error)
- func ListProjectInstrumentNames(db *sqlx.DB, id *uuid.UUID) ([]string, error)
- func ListProjectSlugs(db *sqlx.DB) ([]string, error)
- func ListProjectTimeseries(db *sqlx.DB, projectID *uuid.UUID) ([]ts.Timeseries, error)
- func ListTimeseries(db *sqlx.DB) ([]ts.Timeseries, error)
- func ListTimeseriesMeasurements(db *sqlx.DB, timeseriesID *uuid.UUID, tw *ts.TimeWindow) (*ts.MeasurementCollection, error)
- func ListTimeseriesSlugs(db *sqlx.DB) ([]string, error)
- func ListTimeseriesSlugsForInstrument(db *sqlx.DB, id *uuid.UUID) ([]string, error)
- func RemoveProjectMemberRole(db *sqlx.DB, projectID, profileID, roleID *uuid.UUID) error
- func RemoveTimeseriesFromCollectionGroup(db *sqlx.DB, collectionGroupID *uuid.UUID, timeseriesID *uuid.UUID) error
- func UnsubscribeProfileToAlerts(db *sqlx.DB, alertConfigID *uuid.UUID, profileID *uuid.UUID) error
- func UpdateCalculation(db *sqlx.DB, formula *Calculation) error
- func UpdateTimeseries(db *sqlx.DB, t *ts.Timeseries) (*ts.Timeseries, error)
- type Action
- type Alert
- func DoAlertRead(db *sqlx.DB, profileID *uuid.UUID, alertID *uuid.UUID) (*Alert, error)
- func DoAlertUnread(db *sqlx.DB, profileID *uuid.UUID, alertID *uuid.UUID) (*Alert, error)
- func GetMyAlert(db *sqlx.DB, profileID *uuid.UUID, alertID *uuid.UUID) (*Alert, error)
- func ListAlertsForInstrument(db *sqlx.DB, instrumentID *uuid.UUID) ([]Alert, error)
- func ListMyAlerts(db *sqlx.DB, profileID *uuid.UUID) ([]Alert, error)
- type AlertConfig
- func CreateInstrumentAlertConfigs(db *sqlx.DB, instrumentID *uuid.UUID, alertConfigs []AlertConfig) ([]AlertConfig, error)
- func GetAlertConfig(db *sqlx.DB, alertID *uuid.UUID) (*AlertConfig, error)
- func ListInstrumentAlertConfigs(db *sqlx.DB, instrumentID *uuid.UUID) ([]AlertConfig, error)
- func UpdateInstrumentAlertConfig(db *sqlx.DB, instrumentID *uuid.UUID, alertConfigID *uuid.UUID, ...) (*AlertConfig, error)
- type AlertConfigCollection
- type AlertSubscription
- func GetAlertSubscription(db *sqlx.DB, alertConfigID *uuid.UUID, profileID *uuid.UUID) (*AlertSubscription, error)
- func GetAlertSubscriptionByID(db *sqlx.DB, id *uuid.UUID) (*AlertSubscription, error)
- func ListMyAlertSubscriptions(db *sqlx.DB, profileID *uuid.UUID) ([]AlertSubscription, error)
- func SubscribeProfileToAlerts(db *sqlx.DB, alertConfigID *uuid.UUID, profileID *uuid.UUID) (*AlertSubscription, error)
- func UpdateMyAlertSubscription(db *sqlx.DB, s *AlertSubscription) (*AlertSubscription, error)
- type AlertSubscriptionCollection
- type AlertSubscriptionSettings
- type AuditInfo
- type AwareParameter
- type AwarePlatformParameterConfig
- type Calculation
- type CollectionGroup
- type CollectionGroupDetails
- type CreateInstrumentsValidationResult
- type DBTimeseries
- type Domain
- type EmailAlert
- type EmailAutocompleteResult
- type Heartbeat
- type IDAndSlug
- type IDAndSlugCollection
- type InclinometerMeasurement
- type InclinometerMeasurementCollectionCollection
- type InclinometerTimeseries
- type Instrument
- func GetInstrument(db *sqlx.DB, id *uuid.UUID) (*Instrument, error)
- func InstrumentsFactory(rows *sqlx.Rows) ([]Instrument, error)
- func ListInstrumentGroupInstruments(db *sqlx.DB, ID uuid.UUID) ([]Instrument, error)
- func ListInstruments(db *sqlx.DB) ([]Instrument, error)
- func ListProjectInstruments(db *sqlx.DB, id uuid.UUID) ([]Instrument, error)
- func UpdateInstrument(db *sqlx.DB, i *Instrument) (*Instrument, error)
- func UpdateInstrumentGeometry(db *sqlx.DB, projectID *uuid.UUID, instrumentID *uuid.UUID, ...) (*Instrument, error)
- type InstrumentCollection
- type InstrumentGroup
- func CreateInstrumentGroup(db *sqlx.DB, groups []InstrumentGroup) ([]InstrumentGroup, error)
- func GetInstrumentGroup(db *sqlx.DB, ID uuid.UUID) (*InstrumentGroup, error)
- func ListInstrumentGroups(db *sqlx.DB) ([]InstrumentGroup, error)
- func ListProjectInstrumentGroups(db *sqlx.DB, id uuid.UUID) ([]InstrumentGroup, error)
- func UpdateInstrumentGroup(db *sqlx.DB, g *InstrumentGroup) (*InstrumentGroup, error)
- type InstrumentGroupCollection
- type InstrumentNote
- func CreateInstrumentNote(db *sqlx.DB, notes []InstrumentNote) ([]InstrumentNote, error)
- func GetInstrumentNote(db *sqlx.DB, id *uuid.UUID) (*InstrumentNote, error)
- func ListInstrumentInstrumentNotes(db *sqlx.DB, instrumentID *uuid.UUID) ([]InstrumentNote, error)
- func ListInstrumentNotes(db *sqlx.DB) ([]InstrumentNote, error)
- func UpdateInstrumentNote(db *sqlx.DB, n *InstrumentNote) (*InstrumentNote, error)
- type InstrumentNoteCollection
- type InstrumentStatus
- type InstrumentStatusCollection
- type Measurement
- type Message
- type PlotConfiguration
- func CreatePlotConfiguration(db *sqlx.DB, pc *PlotConfiguration) (*PlotConfiguration, error)
- func GetPlotConfiguration(db *sqlx.DB, projectID *uuid.UUID, plotconfigID *uuid.UUID) (*PlotConfiguration, error)
- func ListPlotConfigurations(db *sqlx.DB, projectID *uuid.UUID) ([]PlotConfiguration, error)
- func PlotConfigFactory(rows *sqlx.Rows) ([]PlotConfiguration, error)
- func UpdatePlotConfiguration(db *sqlx.DB, pc *PlotConfiguration) (*PlotConfiguration, error)
- type PlotConfigurationSettings
- type Profile
- type ProfileInfo
- type Project
- func GetProject(db *sqlx.DB, id uuid.UUID) (*Project, error)
- func ListMyProjects(db *sqlx.DB, profileID *uuid.UUID) ([]Project, error)
- func ListProjects(db *sqlx.DB) ([]Project, error)
- func ProjectFactory(rows *sqlx.Rows) ([]Project, error)
- func UpdateProject(db *sqlx.DB, p *Project) (*Project, error)
- type ProjectCollection
- type ProjectMembership
- type SearchResult
- type Shortener
- type Site
- type SiteName
- type Telemetry
- type TimeWindow
- type Timeseries
- type TimeseriesCollection
- type TimeseriesInfo
- type TimeseriesMeasurementCollectionCollection
- type Token
- type TokenInfo
- type TokenInfoProfile
- type Unit
Constants ¶
This section is empty.
Variables ¶
var DefaultMessageBadRequest = Message{Message: "Bad Request"}
DefaultMessageBadRequest is the a default not found (404) message
var DefaultMessageInternalServerError = Message{Message: "Internal Server Error"}
DefaultMessageInternalServerError is the a default not found (404) message
var DefaultMessageNotFound = Message{Message: "Not Found"}
DefaultMessageNotFound is the a default not found (404) message
DefaultMessageUnauthorized is the a default unauthorized (403) message
var ListPlotConfigurationsSQL = `` /* 219-byte string literal not displayed */
ListPlotConfigurationsSQL is the base SQL statement for above functions
Functions ¶
func AddTimeseriesToCollectionGroup ¶
func AddTimeseriesToCollectionGroup(db *sqlx.DB, collectionGroupID *uuid.UUID, timeseriesID *uuid.UUID) error
AddTimeseriesToCollectionGroup adds a timeseries to a collection group
func ConstantMeasurement ¶
func ConstantMeasurement(db *sqlx.DB, tsID *uuid.UUID, constantName string) (*ts.Measurement, error)
ConstantMeasurement returns a constant timeseries measurement for the same instrument by constant name
func CreateAlerts ¶
CreateAlerts creates one or more new alerts
func CreateCalculation ¶ added in v1.4.0
func CreateCalculation(db *sqlx.DB, formula *Calculation) error
CreateCalculation accepts a single Calculation instance and attempts to create it in the database, returning an error if anything goes wrong.
Generating a UUID for the Calculation is not required. In the case that a Calculation is passed to this function **without** a set UUID field (i.e., `nil`), this function will set the UUID field to the one given to it by the database if the operation completes successfully. In the event that the function returns an error, the UUID field will remain unchanged.
func CreateInstrumentConstants ¶
func CreateInstrumentConstants(db *sqlx.DB, tt []ts.Timeseries) ([]ts.Timeseries, error)
CreateInstrumentConstants creates many instrument constants from an array of instrument constants An InstrumentConstant is structurally the same as a timeseries and saved in the same tables
func CreateInstrumentGroupInstruments ¶
func CreateInstrumentGroupInstruments(db *sqlx.DB, instrumentGroupID uuid.UUID, instrumentID uuid.UUID) error
CreateInstrumentGroupInstruments adds an instrument to an instrument group
func CreateOrUpdateInclinometerMeasurements ¶
func CreateOrUpdateInclinometerMeasurements(db *sqlx.DB, im []ts.InclinometerMeasurementCollection, p *Profile, createDate time.Time) ([]ts.InclinometerMeasurementCollection, error)
CreateInclinometerMeasurements creates many inclinometer from an array of inclinometer If a inclinometer measurement already exists for a given timeseries_id and time, the values is updated
func CreateOrUpdateInstrumentStatus ¶
func CreateOrUpdateInstrumentStatus(db *sqlx.DB, instrumentID *uuid.UUID, ss []InstrumentStatus) error
CreateOrUpdateInstrumentStatus creates a Instrument Status, updates value on conflict
func CreateOrUpdateTimeseriesMeasurements ¶
func CreateOrUpdateTimeseriesMeasurements(db *sqlx.DB, mc []ts.MeasurementCollection) ([]ts.MeasurementCollection, error)
CreateOrUpdateTimeseriesMeasurements creates many timeseries from an array of timeseries If a timeseries measurement already exists for a given timeseries_id and time, the value is updated
func CreateProjectTimeseries ¶
CreateProjectTimeseries promotes a timeseries to the project level
func CreateTimeseries ¶
func CreateTimeseries(db *sqlx.DB, tt []ts.Timeseries) ([]ts.Timeseries, error)
CreateTimeseries creates many timeseries from an array of timeseries
func CreateTimeseriesConstant ¶
func CreateTimeseriesConstant(db *sqlx.DB, tsID *uuid.UUID, parameterName string, unitName string, value float64) error
CreateTimeseriesConstant creates timeseries constant
func DeleteCalculation ¶ added in v1.4.0
DeleteCalculation removes the `Calculation` with ID `formulaID` from the database, effectively dissociating it from the instrument in question.
func DeleteCollectionGroup ¶
DeleteCollectionGroup deletes a collection group and associated timeseries relationships using the id of the collection group
func DeleteFlagInstrument ¶
DeleteFlagInstrument changes delete flag to true
func DeleteFlagInstrumentGroup ¶
DeleteFlagInstrumentGroup sets the deleted field to true
func DeleteFlagProject ¶
DeleteFlagProject sets deleted to true for a project
func DeleteInclinometerMeasurements ¶
DeleteInclinometerMeasurements deletes a inclinometer Measurement
func DeleteInstrumentAlertConfig ¶
func DeleteInstrumentAlertConfig(db *sqlx.DB, alertConfigID *uuid.UUID, instrumentID *uuid.UUID) error
DeleteInstrumentAlertConfig deletes an alert by ID
func DeleteInstrumentConstant ¶
DeleteInstrumentConstant removes a timeseries as an Instrument Constant; Does not delete underlying timeseries
func DeleteInstrumentGroupInstruments ¶
func DeleteInstrumentGroupInstruments(db *sqlx.DB, instrumentGroupID uuid.UUID, instrumentID uuid.UUID) error
DeleteInstrumentGroupInstruments adds an instrument to an instrument group
func DeleteInstrumentNote ¶
DeleteInstrumentNote deletes an instrument note
func DeleteInstrumentStatus ¶
DeleteInstrumentStatus deletes a status for an instrument
func DeletePlotConfiguration ¶
DeletePlotConfiguration delete plot configuration for a project
func DeleteProjectTimeseries ¶
DeleteProjectTimeseries removes a timeseries from the project level; Does not delete underlying timeseries
func DeleteTimeserieMeasurements ¶
DeleteTimeserieMeasurements deletes a timeseries Measurement
func DeleteTimeseries ¶
DeleteTimeseries deletes a timeseries and cascade deletes all measurements
func DeleteToken ¶
DeleteToken deletes a token by token_id
func DoCheckAlerts ¶
DoCheckAlerts checks for alert conditions; Creates alerts as needed
func GetInstrumentCount ¶
GetInstrumentCount returns the number of instruments in the database
func GetProjectCount ¶
GetProjectCount returns the number of projects in the database that are not deleted
func GetTimeseries ¶
GetTimeseries returns a single timeseries without measurements
func GetTimeseriesProjectMap ¶
func GetTimeseriesProjectMap(db *sqlx.DB, timeseriesIDS []uuid.UUID) (map[uuid.UUID]uuid.UUID, error)
GetTimeseriesProjectMap returns a map of { timeseries_id: project_id, }
func JSONType ¶
JSONType is a helper to infer the JSON type from []byte; object or array https://stackoverflow.com/questions/55014001/check-if-json-is-object-or-array
func ListCalculationSlugs ¶ added in v1.4.0
func ListCollectionGroupSlugs ¶
ListCollectionGroupSlugs lists all collection group slugs for a project
func ListInclinometerMeasurements ¶
func ListInclinometerMeasurements(db *sqlx.DB, timeseriesID *uuid.UUID, tw *ts.TimeWindow) (*ts.InclinometerMeasurementCollection, error)
ListInclinometersMeasurements returns a timeseries with slice of inclinometer measurements populated
func ListInstrumentConstants ¶
ListInstrumentConstants lists constants for a given instrument id
func ListInstrumentGroupSlugs ¶
ListInstrumentGroupSlugs lists used instrument group slugs in the database
func ListInstrumentGroupTimeseries ¶
func ListInstrumentGroupTimeseries(db *sqlx.DB, instrumentGroupID *uuid.UUID) ([]ts.Timeseries, error)
ListInstrumentGroupTimeseries returns an array of timeseries for instruments that belong to an instrument_group
func ListInstrumentSlugs ¶
ListInstrumentSlugs lists used instrument slugs in the database
func ListInstrumentTimeseries ¶
func ListInstrumentTimeseries(db *sqlx.DB, projectID *uuid.UUID, instrumentID *uuid.UUID) ([]ts.Timeseries, error)
ListInstrumentTimeseries returns an array of timeseries for an instrument
func ListPlotConfigurationSlugs ¶
ListPlotConfigurationSlugs lists used instrument group slugs in the database
func ListProjectInstrumentNames ¶
ListProjectInstrumentNames returns a slice of instrument names for a project
func ListProjectSlugs ¶
ListProjectSlugs returns a list of used slugs for projects
func ListProjectTimeseries ¶
ListProjectTimeseries lists all timeseries for a given project
func ListTimeseries ¶
func ListTimeseries(db *sqlx.DB) ([]ts.Timeseries, error)
ListTimeseries lists all timeseries
func ListTimeseriesMeasurements ¶
func ListTimeseriesMeasurements(db *sqlx.DB, timeseriesID *uuid.UUID, tw *ts.TimeWindow) (*ts.MeasurementCollection, error)
ListTimeseriesMeasurements returns a timeseries with slice of timeseries measurements populated
func ListTimeseriesSlugs ¶
ListTimeseriesSlugs lists used timeseries slugs in the database
func ListTimeseriesSlugsForInstrument ¶
ListTimeseriesSlugsForInstrument lists used timeseries slugs for a given instrument
func RemoveProjectMemberRole ¶
RemoveProjectMemberRole removes a role from a user for a specific project
func RemoveTimeseriesFromCollectionGroup ¶
func RemoveTimeseriesFromCollectionGroup(db *sqlx.DB, collectionGroupID *uuid.UUID, timeseriesID *uuid.UUID) error
RemoveTimeseriesFromCollectionGroup removes a timeseries from a collection group
func UnsubscribeProfileToAlerts ¶
UnsubscribeProfileToAlerts subscribes a profile to an instrument alert
func UpdateCalculation ¶ added in v1.4.0
func UpdateCalculation(db *sqlx.DB, formula *Calculation) error
func UpdateTimeseries ¶
func UpdateTimeseries(db *sqlx.DB, t *ts.Timeseries) (*ts.Timeseries, error)
UpdateTimeseries updates a timeseries
Types ¶
type Action ¶
type Action struct { Actor int `json:"actor"` Type string `json:"action"` Time time.Time `json:"action_time"` }
Action captures an API action, including user, user's roles, type (GET, POST, etc.), and Time
type Alert ¶
type Alert struct { Read *bool `json:"read,omitempty"` ID uuid.UUID `json:"id"` AlertConfigID uuid.UUID `json:"alert_config_id" db:"alert_config_id"` ProjectID uuid.UUID `json:"project_id" db:"project_id"` InstrumentID uuid.UUID `json:"instrument_id" db:"instrument_id"` ProjectName string `json:"project_name" db:"project_name"` InstrumentName string `json:"instrument_name" db:"instrument_name"` Name string `json:"name"` Body string `json:"body"` CreateDate time.Time `json:"create_date" db:"create_date"` }
Alert is an alert, triggered by an AlertConfig evaluating to true
func DoAlertRead ¶
DoAlertRead marks an alert as read for a profile
func DoAlertUnread ¶
DoAlertUnread marks an alert as unread for a profile
func GetMyAlert ¶
GetMyAlert returns a single alert for which a profile is subscribed
func ListAlertsForInstrument ¶
ListAlertsForInstrument lists all alerts for a given instrument ID
type AlertConfig ¶
type AlertConfig struct { ID uuid.UUID `json:"id"` InstrumentID uuid.UUID `json:"instrument_id" db:"instrument_id"` Name string `json:"name"` Body string `json:"body"` Formula string `json:"formula"` Schedule string `json:"schedule"` AuditInfo }
AlertConfig is an alert configuration for an instrument
func CreateInstrumentAlertConfigs ¶
func CreateInstrumentAlertConfigs(db *sqlx.DB, instrumentID *uuid.UUID, alertConfigs []AlertConfig) ([]AlertConfig, error)
CreateInstrumentAlertConfigs creates one or more new alert configurations
func GetAlertConfig ¶
GetAlertConfig gets a single alert
func ListInstrumentAlertConfigs ¶
ListInstrumentAlertConfigs lists all alerts for a single instrument
func UpdateInstrumentAlertConfig ¶
func UpdateInstrumentAlertConfig(db *sqlx.DB, instrumentID *uuid.UUID, alertConfigID *uuid.UUID, ac *AlertConfig) (*AlertConfig, error)
UpdateInstrumentAlertConfig updates an alert
type AlertConfigCollection ¶
type AlertConfigCollection struct {
Items []AlertConfig `json:"items"`
}
AlertConfigCollection holds one ore more alert items
func (*AlertConfigCollection) UnmarshalJSON ¶
func (c *AlertConfigCollection) UnmarshalJSON(b []byte) error
UnmarshalJSON implements the UnmarshalJSON Interface
type AlertSubscription ¶
type AlertSubscription struct { ID uuid.UUID `json:"id"` AlertConfigID uuid.UUID `json:"alert_config_id" db:"alert_config_id"` ProfileID uuid.UUID `json:"profile_id" db:"profile_id"` AlertSubscriptionSettings }
AlertSubscription is a profile subscription to an alert
func GetAlertSubscription ¶
func GetAlertSubscription(db *sqlx.DB, alertConfigID *uuid.UUID, profileID *uuid.UUID) (*AlertSubscription, error)
GetAlertSubscription returns a AlertSubscription
func GetAlertSubscriptionByID ¶
GetAlertSubscriptionByID returns an alert subscription
func ListMyAlertSubscriptions ¶
ListMyAlertSubscriptions returns all profile_alerts for a given profile ID
func SubscribeProfileToAlerts ¶
func SubscribeProfileToAlerts(db *sqlx.DB, alertConfigID *uuid.UUID, profileID *uuid.UUID) (*AlertSubscription, error)
SubscribeProfileToAlerts subscribes a profile to an instrument alert
func UpdateMyAlertSubscription ¶
func UpdateMyAlertSubscription(db *sqlx.DB, s *AlertSubscription) (*AlertSubscription, error)
UpdateMyAlertSubscription updates properties on a AlertSubscription
type AlertSubscriptionCollection ¶
type AlertSubscriptionCollection struct {
Items []AlertSubscription `json:"items"`
}
AlertSubscriptionCollection is a collection of AlertSubscription items
func (*AlertSubscriptionCollection) UnmarshalJSON ¶
func (c *AlertSubscriptionCollection) UnmarshalJSON(b []byte) error
UnmarshalJSON implements the UnmarshalJSON Interface for AlertSubscription
type AlertSubscriptionSettings ¶
type AlertSubscriptionSettings struct { MuteUI bool `json:"mute_ui" db:"mute_ui"` MuteNotify bool `json:"mute_notify" db:"mute_notify"` }
AlertSubscriptionSettings holds all settings for an AlertSubscription
type AuditInfo ¶
type AuditInfo struct { Creator uuid.UUID `json:"creator"` CreateDate time.Time `json:"create_date" db:"create_date"` Updater *uuid.UUID `json:"updater"` UpdateDate *time.Time `json:"update_date" db:"update_date"` }
AuditInfo holds common information about object creator and updater
type AwareParameter ¶
type AwareParameter struct { ID uuid.UUID `json:"id"` Key string `json:"key"` ParameterID uuid.UUID `json:"parameter_id" db:"parameter_id"` UnitID uuid.UUID `json:"unit_id" db:"unit_id"` }
AwareParameter struct
func ListAwareParameters ¶
func ListAwareParameters(db *sqlx.DB) ([]AwareParameter, error)
ListAwareParameters returns aware parameters
type AwarePlatformParameterConfig ¶
type AwarePlatformParameterConfig struct { ProjectID uuid.UUID `json:"project_id" db:"project_id"` InstrumentID uuid.UUID `json:"instrument_id" db:"instrument_id"` AwareID uuid.UUID `json:"aware_id" db:"aware_id"` AwareParameters map[string]*uuid.UUID `json:"aware_parameters"` }
AwarePlatformParameterConfig holds information about which parameters are "enabled" for given instrument(s) { projectID: <uuid4>, instrument_id: <uuid4>, aware_id: <uuid4>, aware_parameters: { <string>: <uuid4> } } aware_parameters is a map of <aware_parameter_key> : <timeseries_id>
func ListAwarePlatformParameterConfig ¶
func ListAwarePlatformParameterConfig(db *sqlx.DB) ([]AwarePlatformParameterConfig, error)
ListAwarePlatformParameterConfig returns aware platform parameter configs
type Calculation ¶ added in v1.4.0
type Calculation struct { // ID of the Formula, to be used in future requests. ID uuid.UUID `json:"id"` // Associated instrument. InstrumentID uuid.UUID `json:"instrument_id"` // Parameter that this formula should be outputting. ParameterID uuid.UUID `json:"parameter_id"` // Unit that this formula should be outputting. UnitID uuid.UUID `json:"unit_id"` Slug string `json:"slug"` FormulaName string `json:"formula_name"` Formula string `json:"formula"` }
func CalculationsFactory ¶ added in v1.4.0
func CalculationsFactory(rows *sqlx.Rows) ([]Calculation, error)
CalculationsFactory converts database rows to Calculation objects
func GetInstrumentCalculations ¶ added in v1.4.0
func GetInstrumentCalculations(db *sqlx.DB, instrument *Instrument) ([]Calculation, error)
GetInstrumentCalculations returns all formulas associated to a given instrument ID.
type CollectionGroup ¶
type CollectionGroup struct { ID uuid.UUID `json:"id"` ProjectID uuid.UUID `json:"project_id" db:"project_id"` Slug string `json:"slug"` Name string `json:"name"` AuditInfo }
CollectionGroup holds information for entity collection_group
func CreateCollectionGroup ¶
func CreateCollectionGroup(db *sqlx.DB, cg *CollectionGroup) (*CollectionGroup, error)
CreateCollectionGroup creates a new collection group
func ListCollectionGroups ¶
ListCollectionGroups lists all collection groups for a project
func UpdateCollectionGroup ¶
func UpdateCollectionGroup(db *sqlx.DB, cg *CollectionGroup) (*CollectionGroup, error)
UpdateCollectionGroup updates an existing collection group's metadata
type CollectionGroupDetails ¶
type CollectionGroupDetails struct { CollectionGroup Timeseries []cgdTsItem `json:"timeseries"` }
CollectionGroupDetails holds same information as a CollectionGroup In Addition, contains array of structs; Each struct contains all fields for ts.Timeseries AND additional latest_value, latest_time
func GetCollectionGroupDetails ¶
func GetCollectionGroupDetails(db *sqlx.DB, projectID *uuid.UUID, collectionGroupID *uuid.UUID) (*CollectionGroupDetails, error)
GetCollectionGroupDetails returns details for a single CollectionGroup
type CreateInstrumentsValidationResult ¶
type CreateInstrumentsValidationResult struct { IsValid bool `json:"is_valid"` Errors []string `json:"errors"` }
CreateInstrumentsValidationResult holds results of checking InstrumentCollection POST
func ValidateCreateInstruments ¶
func ValidateCreateInstruments(db *sqlx.DB, instruments []Instrument) (CreateInstrumentsValidationResult, error)
ValidateCreateInstruments creates many instruments from an array of instruments
type DBTimeseries ¶
type DBTimeseries struct { TimeseriesInfo Measurements string `json:"measurements" db:"measurements"` NextMeasurementLow *string `json:"next_measurement_low" db:"next_measurement_low"` NextMeasurementHigh *string `json:"next_measurement_high" db:"next_measurement_high"` }
Allows sending JSON Aggregated Data from the Database JSON Aggregated data not handled natively by sqlx
type Domain ¶
type Domain struct { ID uuid.UUID `json:"id"` Group string `json:"group"` Value string `json:"value"` Description *string `json:"description"` }
Domain is a struct for returning all database domain values
type EmailAlert ¶
type EmailAlert struct { ID uuid.UUID `json:"id"` AlertConfigID uuid.UUID `json:"alert_config_id"` EmailID uuid.UUID `json:"profile_id"` MuteNotify bool `json:"mute_notify" db:"mute_notify"` }
EmailAlert is an email subscription to an alert
type EmailAutocompleteResult ¶
type EmailAutocompleteResult struct { ID uuid.UUID `json:"id"` UserType string `json:"user_type" db:"user_type"` Username *string `json:"username"` Email string `json:"email"` }
EmailAutocompleteResult stores search result in profiles and emails
func ListEmailAutocomplete ¶
ListEmailAutocomplete returns search results for email autocomplete
type Heartbeat ¶
Heartbeat is a timestamp
func DoHeartbeat ¶
DoHeartbeat does regular-interval tasks
func GetLatestHeartbeat ¶
GetLatestHeartbeat returns the most recent system heartbeat
type IDAndSlug ¶
IDAndSlug is a UUID4 and Slug representation of something
func CreateInstruments ¶
func CreateInstruments(db *sqlx.DB, instruments []Instrument) ([]IDAndSlug, error)
CreateInstruments creates many instruments from an array of instruments
type IDAndSlugCollection ¶
type IDAndSlugCollection struct {
Items []IDAndSlug `json:"items"`
}
IDAndSlugCollection is a collection of objects with ID and Slug properties
type InclinometerMeasurement ¶
type InclinometerMeasurement struct { Time time.Time `json:"time"` Values types.JSONText `json:"values"` }
func (InclinometerMeasurement) InclinometerLean ¶
func (m InclinometerMeasurement) InclinometerLean() map[time.Time]types.JSONText
type InclinometerMeasurementCollectionCollection ¶
type InclinometerMeasurementCollectionCollection struct {
Items []ts.InclinometerMeasurementCollection
}
InclinometerMeasurementCollectionCollection is a collection of inclinometer measurement collections i.e an array of structs, each containing inclinometer measurements not necessarily from the same time series
func (*InclinometerMeasurementCollectionCollection) InclinometerTimeseriesIDs ¶
func (cc *InclinometerMeasurementCollectionCollection) InclinometerTimeseriesIDs() []uuid.UUID
InclinometerTimeseriesIDs returns a slice of all timeseries IDs contained in the InclinometerMeasurementCollectionCollection
func (*InclinometerMeasurementCollectionCollection) UnmarshalJSON ¶
func (cc *InclinometerMeasurementCollectionCollection) UnmarshalJSON(b []byte) error
UnmarshalJSON implements UnmarshalJSON interface
type InclinometerTimeseries ¶
type InclinometerTimeseries struct { TimeseriesInfo Measurements []InclinometerMeasurement `json:"measurements" db:"measurements"` NextMeasurementLow *Measurement `json:"next_measurement_low" db:"next_measurement_low"` NextMeasurementHigh *Measurement `json:"next_measurement_high" db:"next_measurement_high"` TimeWindow TimeWindow `json:"time_window"` }
func ComputedInclinometerTimeseries ¶
func ComputedInclinometerTimeseries(db *sqlx.DB, instrumentIDs []uuid.UUID, tw *TimeWindow, interval *time.Duration) ([]InclinometerTimeseries, error)
ComputedInclinometerTimeseries returns computed and stored inclinometer timeseries for a specified array of instrument IDs
type Instrument ¶
type Instrument struct { ID uuid.UUID `json:"id"` AwareID *uuid.UUID `json:"aware_id,omitempty"` Groups []uuid.UUID `json:"groups"` Constants []uuid.UUID `json:"constants"` AlertConfigs []uuid.UUID `json:"alert_configs"` StatusID uuid.UUID `json:"status_id" db:"status_id"` Status string `json:"status"` StatusTime time.Time `json:"status_time" db:"status_time"` Deleted bool `json:"-"` Slug string `json:"slug"` Name string `json:"name"` TypeID uuid.UUID `json:"type_id" db:"type_id"` Type string `json:"type"` Geometry geojson.Geometry `json:"geometry,omitempty"` Station *int `json:"station"` StationOffset *int `json:"offset" db:"station_offset"` ProjectID *uuid.UUID `json:"project_id" db:"project_id"` NIDID *string `json:"nid_id" db:"nid_id"` USGSID *string `json:"usgs_id" db:"usgs_id"` AuditInfo }
Instrument is an instrument
func GetInstrument ¶
GetInstrument returns a single instrument
func InstrumentsFactory ¶
func InstrumentsFactory(rows *sqlx.Rows) ([]Instrument, error)
InstrumentsFactory converts database rows to Instrument objects
func ListInstrumentGroupInstruments ¶
ListInstrumentGroupInstruments returns a list of instrument group instruments for a given instrument
func ListInstruments ¶
func ListInstruments(db *sqlx.DB) ([]Instrument, error)
ListInstruments returns an array of instruments from the database
func ListProjectInstruments ¶
ListProjectInstruments returns a slice of instruments for a project
func UpdateInstrument ¶
func UpdateInstrument(db *sqlx.DB, i *Instrument) (*Instrument, error)
UpdateInstrument updates a single instrument
func UpdateInstrumentGeometry ¶
func UpdateInstrumentGeometry(db *sqlx.DB, projectID *uuid.UUID, instrumentID *uuid.UUID, geom *geojson.Geometry, p *Profile) (*Instrument, error)
UpdateInstrumentGeometry updates instrument geometry property
func (*Instrument) AsSite ¶
func (n *Instrument) AsSite() Site
AsSite returns an instrument represented as an OpenDCS Site
type InstrumentCollection ¶
type InstrumentCollection struct {
Items []Instrument
}
InstrumentCollection is a collection of Instrument items
func (InstrumentCollection) Shorten ¶
func (c InstrumentCollection) Shorten() IDAndSlugCollection
Shorten returns an instrument collection with individual objects limited to ID and Struct fields
func (*InstrumentCollection) UnmarshalJSON ¶
func (c *InstrumentCollection) UnmarshalJSON(b []byte) error
UnmarshalJSON implements UnmarshalJSON interface
type InstrumentGroup ¶
type InstrumentGroup struct { ID uuid.UUID `json:"id"` Deleted bool `json:"-"` Slug string `json:"slug"` Name string `json:"name"` Description string `json:"description"` ProjectID *uuid.UUID `json:"project_id" db:"project_id"` InstrumentCount int `json:"instrument_count" db:"instrument_count"` TimeseriesCount int `json:"timeseries_count" db:"timeseries_count"` AuditInfo }
InstrumentGroup holds information for entity instrument_group
func CreateInstrumentGroup ¶
func CreateInstrumentGroup(db *sqlx.DB, groups []InstrumentGroup) ([]InstrumentGroup, error)
CreateInstrumentGroup creates many instruments from an array of instruments
func GetInstrumentGroup ¶
GetInstrumentGroup returns a single instrument group
func ListInstrumentGroups ¶
func ListInstrumentGroups(db *sqlx.DB) ([]InstrumentGroup, error)
ListInstrumentGroups returns a list of instrument groups
func ListProjectInstrumentGroups ¶
ListProjectInstrumentGroups returns a list of instrument groups for a project
func UpdateInstrumentGroup ¶
func UpdateInstrumentGroup(db *sqlx.DB, g *InstrumentGroup) (*InstrumentGroup, error)
UpdateInstrumentGroup updates an instrument group
type InstrumentGroupCollection ¶
type InstrumentGroupCollection struct {
Items []InstrumentGroup
}
InstrumentGroupCollection is a collection of Instrument items
func (InstrumentGroupCollection) Shorten ¶
func (c InstrumentGroupCollection) Shorten() IDAndSlugCollection
Shorten returns an instrument collection with individual objects limited to ID and Struct fields
func (*InstrumentGroupCollection) UnmarshalJSON ¶
func (c *InstrumentGroupCollection) UnmarshalJSON(b []byte) error
UnmarshalJSON implements UnmarshalJSON interface Allows unpacking object or array of objects into array of objects
type InstrumentNote ¶
type InstrumentNote struct { ID uuid.UUID `json:"id"` InstrumentID uuid.UUID `json:"instrument_id" db:"instrument_id"` Title string `json:"title"` Body string `json:"body"` Time time.Time `json:"time"` AuditInfo }
InstrumentNote is a note about an instrument
func CreateInstrumentNote ¶
func CreateInstrumentNote(db *sqlx.DB, notes []InstrumentNote) ([]InstrumentNote, error)
CreateInstrumentNote creates many instrument notes from an array of instrument notes
func GetInstrumentNote ¶
GetInstrumentNote returns a single instrument note
func ListInstrumentInstrumentNotes ¶
ListInstrumentInstrumentNotes returns an array of instrument notes for a given instrument
func ListInstrumentNotes ¶
func ListInstrumentNotes(db *sqlx.DB) ([]InstrumentNote, error)
ListInstrumentNotes returns an array of instruments from the database
func UpdateInstrumentNote ¶
func UpdateInstrumentNote(db *sqlx.DB, n *InstrumentNote) (*InstrumentNote, error)
UpdateInstrumentNote updates a single instrument note
type InstrumentNoteCollection ¶
type InstrumentNoteCollection struct {
Items []InstrumentNote
}
InstrumentNoteCollection is a collection of Instrument Notes
func (*InstrumentNoteCollection) UnmarshalJSON ¶
func (c *InstrumentNoteCollection) UnmarshalJSON(b []byte) error
UnmarshalJSON implements UnmarshalJSON interface Allows unpacking object or array of objects into array of objects
type InstrumentStatus ¶
type InstrumentStatus struct { ID uuid.UUID `json:"id"` Time time.Time `json:"time"` StatusID uuid.UUID `json:"status_id" db:"status_id"` Status string `json:"status"` }
InstrumentStatus is an instrument status
func GetInstrumentStatus ¶
GetInstrumentStatus gets a single status
func ListInstrumentStatus ¶
ListInstrumentStatus returns all status values for an instrument
type InstrumentStatusCollection ¶
type InstrumentStatusCollection struct {
Items []InstrumentStatus
}
InstrumentStatusCollection is a collection of instrument status
func (*InstrumentStatusCollection) UnmarshalJSON ¶
func (c *InstrumentStatusCollection) UnmarshalJSON(b []byte) error
UnmarshalJSON implements the UnmarshalJSONinterface
type Measurement ¶
type Message ¶
type Message struct {
Message string `json:"message"`
}
Message is a response message; typically used for 400/500 level API responses
type PlotConfiguration ¶
type PlotConfiguration struct { ID uuid.UUID `json:"id"` Name string `json:"name"` Slug string `json:"slug"` ProjectID uuid.UUID `json:"project_id" db:"project_id"` TimeseriesID []uuid.UUID `json:"timeseries_id" db:"timeseries_id"` AuditInfo PlotConfigurationSettings }
PlotConfiguration holds information for entity PlotConfiguration
func CreatePlotConfiguration ¶
func CreatePlotConfiguration(db *sqlx.DB, pc *PlotConfiguration) (*PlotConfiguration, error)
CreatePlotConfiguration add plot configuration for a project
func GetPlotConfiguration ¶
func GetPlotConfiguration(db *sqlx.DB, projectID *uuid.UUID, plotconfigID *uuid.UUID) (*PlotConfiguration, error)
GetPlotConfiguration returns a single plot configuration
func ListPlotConfigurations ¶
ListPlotConfigurations returns a list of Plot groups
func PlotConfigFactory ¶
func PlotConfigFactory(rows *sqlx.Rows) ([]PlotConfiguration, error)
PlotConfigFactory converts database rows to PlotConfiguration objects
func UpdatePlotConfiguration ¶
func UpdatePlotConfiguration(db *sqlx.DB, pc *PlotConfiguration) (*PlotConfiguration, error)
UpdatePlotConfiguration update plot configuration for a project
type PlotConfigurationSettings ¶ added in v1.4.0
type PlotConfigurationSettings struct { ShowMasked bool `json:"show_masked" db:"show_masked"` ShowNonValidated bool `json:"show_nonvalidated" db:"show_nonvalidated"` ShowComments bool `json:"show_comments" db:"show_comments"` }
PlotConfigurationSettings describes options for displaying the plot consistently. Specifically, whether to ignore data entries in a timeseries that have been masked, or whether to display user comments.
type Profile ¶
type Profile struct { ID uuid.UUID `json:"id"` ProfileInfo Tokens []TokenInfoProfile `json:"tokens"` IsAdmin bool `json:"is_admin" db:"is_admin"` Roles []string `json:"roles"` }
Profile is a user profile
func CreateProfile ¶
func CreateProfile(db *sqlx.DB, n *ProfileInfo) (*Profile, error)
CreateProfile creates a new profile
func GetProfileFromEDIPI ¶
GetProfileFromEDIPI returns a profile given an edipi
func GetProfileFromTokenID ¶
GetProfileFromTokenID returns a profile given a token ID
type ProfileInfo ¶
type ProfileInfo struct { EDIPI int `json:"-"` Username string `json:"username"` Email string `json:"email"` }
ProfileInfo is information necessary to construct a profile
type Project ¶
type Project struct { ID uuid.UUID `json:"id"` FederalID *string `json:"federal_id" db:"federal_id"` OfficeID *uuid.UUID `json:"office_id" db:"office_id"` Image *string `json:"image" db:"image"` Deleted bool `json:"-"` Slug string `json:"slug"` Name string `json:"name"` Timeseries []uuid.UUID `json:"timeseries" db:"timeseries"` InstrumentCount int `json:"instrument_count" db:"instrument_count"` InstrumentGroupCount int `json:"instrument_group_count" db:"instrument_group_count"` AuditInfo }
Project is a project data structure
func GetProject ¶
GetProject returns a pointer to a project
func ListProjects ¶
ListProjects returns a slice of projects
func ProjectFactory ¶
ProjectFactory converts database rows to Project objects
type ProjectCollection ¶
type ProjectCollection struct {
Projects []Project
}
ProjectCollection helps unpack unspecified JSON into an array of products
func (*ProjectCollection) UnmarshalJSON ¶
func (c *ProjectCollection) UnmarshalJSON(b []byte) error
UnmarshalJSON implements UnmarshalJSON interface
type ProjectMembership ¶
type ProjectMembership struct { ID uuid.UUID `json:"id" db:"id"` ProfileID uuid.UUID `json:"profile_id" db:"profile_id"` Username *string `json:"username"` Email string `json:"email"` RoleID uuid.UUID `json:"role_id" db:"role_id"` Role string `json:"role"` }
ProjectMembership holds
func AddProjectMemberRole ¶
func AddProjectMemberRole(db *sqlx.DB, projectID, profileID, roleID, grantedBy *uuid.UUID) (*ProjectMembership, error)
AddProjectMemberRole adds a role to a user for a specific project
func ListProjectMembers ¶
ListProjectMembers lists users (profiles) who have permissions on a project and their role info
type SearchResult ¶
type SearchResult struct { ID uuid.UUID `json:"id"` Type string `json:"type"` Item interface{} `json:"item,omitempty"` }
EmailAutocompleteResult stores search result in profiles and emails
func ProjectSearch ¶
ProjectSearch returns search result for projects
type Shortener ¶
type Shortener interface {
// contains filtered or unexported methods
}
Shortener allows a shorter representation of an object. Typically, ID and Slug fields only
type Site ¶
type Site struct { Elevation string `xml:"Elevation"` ElevationUnits string `xml:"ElevationUnits"` Description string `xml:"Description"` SiteName SiteName `xml:"SiteName"` }
Site is an instrument, represented as an OpenDCS Site
type TimeWindow ¶
type TimeWindow struct { After time.Time `json:"after" query:"after"` Before time.Time `json:"before" query:"before"` }
TimeWindow is a bounding box for time
type Timeseries ¶
type Timeseries struct { TimeseriesInfo Measurements []Measurement `json:"measurements" db:"measurements"` NextMeasurementLow *Measurement `json:"next_measurement_low" db:"next_measurement_low"` NextMeasurementHigh *Measurement `json:"next_measurement_high" db:"next_measurement_high"` TimeWindow TimeWindow `json:"time_window"` }
func ComputedTimeseries ¶
func ComputedTimeseries(db *sqlx.DB, instrumentIDs []uuid.UUID, tw *TimeWindow, interval *time.Duration) ([]Timeseries, error)
ComputedTimeseries returns computed and stored timeseries for a specified array of instrument IDs
func (*Timeseries) Calculate ¶
func (ts *Timeseries) Calculate(variableMap map[time.Time]map[string]interface{}) error
func (Timeseries) RegularizeCarryForward ¶
func (ts Timeseries) RegularizeCarryForward(w TimeWindow, d time.Duration) (Timeseries, error)
RegularizeCarryForward converts potentially irregular timeseries measurements into a regular interval timeseries over the time window w with measurements spaced at interval d Missing values are filled-in using a carry forward algorithm (use previous known value in time for missing values)
func (Timeseries) RegularizeInterpolate ¶
func (ts Timeseries) RegularizeInterpolate(w TimeWindow, d time.Duration) (Timeseries, error)
type TimeseriesCollection ¶
type TimeseriesCollection struct {
Items []ts.Timeseries
}
TimeseriesCollection is a collection of Timeseries items
func (*TimeseriesCollection) UnmarshalJSON ¶
func (c *TimeseriesCollection) UnmarshalJSON(b []byte) error
UnmarshalJSON implements UnmarshalJSON interface
type TimeseriesInfo ¶
type TimeseriesInfo struct { TimeseriesID uuid.UUID `json:"timeseries_id" db:"timeseries_id"` InstrumentID uuid.UUID `json:"instrument_id" db:"instrument_id"` Variable string `json:"variable" db:"variable"` IsComputed bool `json:"is_computed" db:"is_computed"` Formula *string `json:"formula" db:"formula"` }
type TimeseriesMeasurementCollectionCollection ¶
type TimeseriesMeasurementCollectionCollection struct {
Items []ts.MeasurementCollection
}
TimeseriesMeasurementCollectionCollection is a collection of timeseries measurement collections i.e an array of structs, each containing timeseries measurements not necessarily from the same time series
func (*TimeseriesMeasurementCollectionCollection) TimeseriesIDs ¶
func (cc *TimeseriesMeasurementCollectionCollection) TimeseriesIDs() []uuid.UUID
TimeseriesIDs returns a slice of all timeseries IDs contained in the MeasurementCollectionCollection
func (*TimeseriesMeasurementCollectionCollection) UnmarshalJSON ¶
func (cc *TimeseriesMeasurementCollectionCollection) UnmarshalJSON(b []byte) error
UnmarshalJSON implements UnmarshalJSON interface
type Token ¶
Token includes all TokenInfo and the actual token string generated for a user this is only returned the first time a token is generated
func CreateProfileToken ¶
CreateProfileToken creates a secret token and stores the HASH (not the actual token) to the database. The return payload of this function is the first and last time you'll see the raw token unless the user writes it down or stores it somewhere safe.
type TokenInfo ¶
type TokenInfo struct { ID uuid.UUID `json:"-"` TokenID string `json:"token_id" db:"token_id"` ProfileID uuid.UUID `json:"profile_id" db:"profile_id"` Issued time.Time `json:"issued"` Hash string `json:"-"` }
TokenInfo represents the information held in the database about a token
type TokenInfoProfile ¶
type TokenInfoProfile struct { TokenID string `json:"token_id" db:"token_id"` Issued time.Time `json:"issued"` }
TokenInfoProfile is token information embedded in Profile
type Unit ¶
type Unit struct { ID uuid.UUID `json:"id"` Name string `json:"name"` Abbreviation string `json:"abbreviation"` UnitFamilyID uuid.UUID `json:"unit_family_id" db:"unit_family_id"` UnitFamily string `json:"unit_family" db:"unit_family"` MeasureID uuid.UUID `json:"measure_id" db:"measure_id"` Measure string `json:"measure"` }
Unit is a unit data structure
Source Files ¶
- alert.go
- alert_config.go
- alert_subscription.go
- audit.go
- autocomplete.go
- aware.go
- calculations.go
- collection_group.go
- domains.go
- heartbeat.go
- helpers.go
- inclinometer_measurements.go
- instrument.go
- instrument_constants.go
- instrument_groups.go
- instrument_notes.go
- instrument_status.go
- messages.go
- misc.go
- opendcs.go
- plot_configuration.go
- profile.go
- project_roles.go
- projects.go
- search.go
- telemetry.go
- timeseries.go
- timeseries_measurements.go
- unit.go