Documentation ¶
Index ¶
- Constants
- func GetDataType() types.DataType
- func GetSensorDataExpiresAfter(timeProvider clock.TimeProvider) int64
- func MachineIDSensorDataPKSK(machineID string) (string, string)
- func SensorDataPK(machineID string) string
- type ConcreteSensorDataFinder
- type SensorData
- type SensorDataFinder
- type SerialNumDataTypeMachineIdGSIItem
- Bugs
Constants ¶
View Source
const ( MachineID_DataType_GSI string = "DataType_MachineID" SerialNum_DataType_MachineID_GSI string = "SerialNum_DataType_MachineID" )
Variables ¶
This section is empty.
Functions ¶
func GetDataType ¶
func GetSensorDataExpiresAfter ¶
func GetSensorDataExpiresAfter(timeProvider clock.TimeProvider) int64
func MachineIDSensorDataPKSK ¶
MachineIDSensorDataPKSK returns the partition and sort keys for a machine id
func SensorDataPK ¶
Types ¶
type ConcreteSensorDataFinder ¶
type ConcreteSensorDataFinder struct {
// contains filtered or unexported fields
}
func (ConcreteSensorDataFinder) GetMachineIDsFromSerialNumber ¶
func (f ConcreteSensorDataFinder) GetMachineIDsFromSerialNumber(serialNumber string, limit int32) (machineIDs []string, err error)
func (ConcreteSensorDataFinder) GetMachineIDsStartingWith ¶
func (f ConcreteSensorDataFinder) GetMachineIDsStartingWith(prefix string, limit int32) (machineIDs []string, err error)
type SensorData ¶
type SensorData struct { dynamodb.PrimaryKey MachineID string `dynamodbav:"MachineID"` SerialNum string `dynamodbav:"SerialNum"` OSVersion string `dynamodbav:"OSVersion"` OSBuild string `dynamodbav:"OSBuild"` SantaVersion string `dynamodbav:"SantaVersion"` ClientMode types.ClientMode `dynamodbav:"ClientMode"` RequestCleanSync bool `dynamodbav:"RequestCleanSync"` PrimaryUser string `dynamodbav:"PrimaryUser"` RuleCount int `dynamodbav:"RuleCount"` CertificateRuleCount int `dynamodbav:"CertificateRuleCount"` BinaryRuleCount int `dynamodbav:"BinaryRuleCount"` CDHashRuleCount int `dynamodbav:"CDHashRuleCount"` TeamIDRuleCount int `dynamodbav:"TeamIDRuleCount"` SigningIDRuleCount int `dynamodbav:"SigningIDRuleCount"` CompilerRuleCount int `dynamodbav:"CompilerRuleCount"` TransitiveRuleCount int `dynamodbav:"TransitiveRuleCount"` Time string `dynamodbav:"Time"` ExpiresAfter int64 `dynamodbav:"ExpiresAfter,omitempty"` DataType types.DataType `dynamodbav:"DataType"` }
SensorData encapsulation for a DDB row encapsulating data that is uploaded in preflight
func GetSensorData ¶
func GetSensorData(client dynamodb.GetItemAPI, machineID string) (sensorData *SensorData, err error)
GetSensorData gets a previously stored sensor data BUG(derek.wang) In a NoSQL database like DynamoDB the whole idea of save-then-get is an antipattern.
It requires this call to be strongly consistent with doubles the cost. We should think about a different way of designing the data model.
func NewSensorData ¶
func NewSensorData( timeProvider clock.TimeProvider, machineID string, serialNumber string, osVersion string, osBuild string, santaVersion string, clientMode rudolphtypes.ClientMode, requestCleanSync bool, primaryUser string, certRuleCount int, binaryRuleCount int, cdHashRuleCount int, teamIDRuleCount int, signingIDRuleCount int, compilerRuleCount int, transitiveRuleCount int, ) SensorData
type SensorDataFinder ¶
type SensorDataFinder interface { GetMachineIDsStartingWith(prefix string, limit int32) ([]string, error) GetMachineIDsFromSerialNumber(serialNumber string, limit int32) ([]string, error) }
SensorDataFinder is a service that allows you to search the SensorData logs for machineIDs or serial numbers of sensors that have recently checked into Rudolph
This service is particularly useful for typeahead and can be re-used for external applications.
func GetSensorDataFinder ¶
func GetSensorDataFinder(api dynamodb.QueryAPI) SensorDataFinder
Notes ¶
Bugs ¶
In a NoSQL database like DynamoDB the whole idea of save-then-get is an antipattern.
It requires this call to be strongly consistent with doubles the cost. We should think about a different way of designing the data model.
Click to show internal directories.
Click to hide internal directories.