Documentation ¶
Overview ¶
Package table manages all of the Dynamo calls (query, scan, get, write, etc).
Index ¶
- Constants
- type API
- type AlertItem
- type AlertsTable
- func (table *AlertsTable) GetAlert(alertID *string) (*AlertItem, error)
- func (table *AlertsTable) ListAll(exclusiveStartKey *string, pageSize *int) (summaries []*AlertItem, lastEvaluatedKey *string, err error)
- func (table *AlertsTable) ListByRule(ruleID string, exclusiveStartKey *string, pageSize *int) (summaries []*AlertItem, lastEvaluatedKey *string, err error)
- type DynamoItem
Constants ¶
View Source
const ( RuleIDKey = "ruleId" AlertIDKey = "id" TimePartitionKey = "timePartition" TimePartitionValue = "defaultPartition" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type API ¶
type API interface { GetAlert(*string) (*AlertItem, error) ListByRule(string, *string, *int) ([]*AlertItem, *string, error) ListAll(*string, *int) ([]*AlertItem, *string, error) }
API defines the interface for the alerts table which can be used for mocking.
type AlertItem ¶ added in v1.0.0
type AlertItem struct { AlertID string `json:"id"` RuleID string `json:"ruleId"` RuleVersion string `json:"ruleVersion"` RuleDisplayName *string `json:"ruleDisplayName"` Title *string `json:"title"` DedupString string `json:"dedup"` CreationTime time.Time `json:"creationTime"` UpdateTime time.Time `json:"updateTime"` Severity string `json:"severity"` EventCount int `json:"eventCount"` LogTypes []string `json:"logTypes"` }
AlertItem is a DDB representation of an Alert
type AlertsTable ¶
type AlertsTable struct { AlertsTableName string RuleIDCreationTimeIndexName string TimePartitionCreationTimeIndexName string Client dynamodbiface.DynamoDBAPI }
AlertsTable encapsulates a connection to the Dynamo alerts table.
func (*AlertsTable) GetAlert ¶
func (table *AlertsTable) GetAlert(alertID *string) (*AlertItem, error)
GetAlert retrieve a AlertItem 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.