Documentation ¶
Index ¶
- Variables
- func GetAppMetricsIDs(appMetrics []AppMetric) []int
- type AppMetric
- type AppMetricEventType
- type AppMetricValidationError
- type Database
- func (db Database) Close() error
- func (db *Database) DeleteOlderThan(date *time.Time) (err error)
- func (db *Database) GetAppMetrics(limit int, offset int) (page Page, err error)
- func (db *Database) GetMessagesOlderThan(date *time.Time) ([]AppMetric, error)
- func (db *Database) GetUnprocessed() ([]AppMetric, error)
- func (db *Database) GetUnprocessedGroupedBySession() (map[string][]AppMetric, error)
- func (db *Database) SaveAppMetrics(appMetrics []AppMetric, sessionID string) (err error)
- func (db *Database) SetToProcessed(appMetrics []AppMetric) (err error)
- func (db *Database) SetToProcessedByIDs(ids []int) (err error)
- func (db *Database) ValidateAppMetrics(appMetrics []AppMetric) (err error)
- type Page
Constants ¶
This section is empty.
Variables ¶
View Source
var EventSchemaMap = map[AppMetricEventType]interface{}{ NavigateTo: NavigateToCofxSchema, ScreensOnWillFocus: NavigateToCofxSchema, }
EventSchemaMap Every event should have a schema attached
View Source
string]interface{}{ "view_id": map[string]interface{}{ "type": "string", "maxLength": 32, }, "params": map[string]interface{}{ "type": "object", "properties": map[string]interface{}{ "screen": map[string]interface{}{ "type": "string", "maxLength": 32, }, }, "additionalProperties": false, "required": []string{"screen"}, }, }, "additionalProperties": false, "required": []string{"view_id", "params"}, }"type": "object", "properties": map[
Functions ¶
func GetAppMetricsIDs ¶ added in v0.86.2
Types ¶
type AppMetric ¶
type AppMetric struct { ID int `json:"-"` MessageID string `json:"message_id"` Event AppMetricEventType `json:"event"` Value json.RawMessage `json:"value"` AppVersion string `json:"app_version"` OS string `json:"os"` SessionID string `json:"session_id"` CreatedAt time.Time `json:"created_at"` Processed bool `json:"processed"` ReceivedAt time.Time `json:"received_at"` }
Value is `json.RawMessage` so we can send any json shape, including strings Validation is handled using JSON schemas defined in validators.go, instead of Golang structs
func GenerateMetrics ¶ added in v0.86.2
type AppMetricEventType ¶
type AppMetricEventType string
const ( // status-mobile navigation events ScreensOnWillFocus AppMetricEventType = "screens/on-will-focus" )
type AppMetricValidationError ¶
type AppMetricValidationError struct { Metric AppMetric Errors []gojsonschema.ResultError }
type Database ¶
type Database struct {
// contains filtered or unexported fields
}
Database sql wrapper for operations with browser objects.
func (*Database) DeleteOlderThan ¶ added in v0.86.2
func (*Database) GetAppMetrics ¶
func (*Database) GetMessagesOlderThan ¶ added in v0.86.2
func (*Database) GetUnprocessed ¶ added in v0.86.2
func (*Database) GetUnprocessedGroupedBySession ¶ added in v0.86.2
func (*Database) SaveAppMetrics ¶
func (*Database) SetToProcessed ¶ added in v0.86.2
func (*Database) SetToProcessedByIDs ¶ added in v0.86.2
func (*Database) ValidateAppMetrics ¶
Click to show internal directories.
Click to hide internal directories.