Documentation ¶
Overview ¶
Package table manages all of the Dynamo calls (query, scan, get, write, etc).
Index ¶
- Constants
- type API
- type AlertsTable
- func (table *AlertsTable) GetAlert(alertID *string) (*models.AlertItem, error)
- func (table *AlertsTable) GetEvent(eventHash []byte) (*string, error)
- func (table *AlertsTable) ListAll(exclusiveStartKey *string, pageSize *int) (summaries []*models.AlertItem, lastEvaluatedKey *string, err error)
- func (table *AlertsTable) ListByRule(ruleID string, exclusiveStartKey *string, pageSize *int) (summaries []*models.AlertItem, lastEvaluatedKey *string, err error)
- type DynamoItem
Constants ¶
View Source
const ( RuleIDKey = "ruleId" AlertIDKey = "alertId" TimePartitionKey = "timePartition" CreationTimeKey = "creationTime" EventHashKey = "eventHash" EventKey = "event" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type API ¶
type API interface { GetAlert(*string) (*models.AlertItem, error) GetEvent([]byte) (*string, error) ListByRule(string, *string, *int) ([]*models.AlertItem, *string, error) ListAll(*string, *int) ([]*models.AlertItem, *string, error) }
API defines the interface for the alerts table which can be used for mocking.
type AlertsTable ¶
type AlertsTable struct { AlertsTableName string RuleIDCreationTimeIndexName string TimePartitionCreationTimeIndexName string EventsTableName string Client dynamodbiface.DynamoDBAPI }
AlertsTable encapsulates a connection to the Dynamo alerts table.
func (*AlertsTable) GetAlert ¶
func (table *AlertsTable) GetAlert(alertID *string) (*models.AlertItem, error)
GetAlert retrieve a AlertItem from DDB
func (*AlertsTable) GetEvent ¶
func (table *AlertsTable) GetEvent(eventHash []byte) (*string, error)
GetEvent retrieves an event from DDB
func (*AlertsTable) ListByRule ¶ added in v0.1.1
type DynamoItem ¶
type DynamoItem = map[string]*dynamodb.AttributeValue
DynamoItem is a type alias for the item format expected by the Dynamo SDK.
Click to show internal directories.
Click to hide internal directories.