ddb

package
v1.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 22, 2020 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DDB

type DDB struct {
	Client    dynamodbiface.DynamoDBAPI
	TableName string
}

DDB is a struct containing the DynamoDB client, and the table name to retrieve data.

func New

func New(tableName string) *DDB

New instantiates a new client.

func (*DDB) DeleteItem added in v1.3.0

func (ddb *DDB) DeleteItem(integrationID *string) error

DeleteItem deletes an integration from the database based on the integration ID

func (*DDB) GetItem added in v1.3.0

func (ddb *DDB) GetItem(integrationID *string) (*IntegrationItem, error)

GetItem returns an integration by its ID

func (*DDB) PutItem added in v1.3.0

func (ddb *DDB) PutItem(input *IntegrationItem) error

PutItem adds a source integration to the database

func (*DDB) ScanIntegrations

func (ddb *DDB) ScanIntegrations(integrationType *string) ([]*IntegrationItem, error)

ScanIntegrations returns all enabled integrations based on type (if type is specified). It performs a DDB scan of the entire table with a filter expression.

type IntegrationItem added in v1.3.0

type IntegrationItem struct {
	CreatedAtTime    *time.Time `json:"createdAtTime"`
	CreatedBy        *string    `json:"createdBy"`
	IntegrationID    *string    `json:"integrationId"`
	IntegrationLabel *string    `json:"integrationLabel"`
	IntegrationType  *string    `json:"integrationType"`

	AWSAccountID       *string `json:"awsAccountId"`
	RemediationEnabled *bool   `json:"remediationEnabled"`
	CWEEnabled         *bool   `json:"cweEnabled"`

	LastScanEndTime      *time.Time `json:"lastScanEndTime"`
	LastScanErrorMessage *string    `json:"lastScanErrorMessage"`
	LastScanStartTime    *time.Time `json:"lastScanStartTime"`
	ScanStatus           *string    `json:"scanStatus"`
	EventStatus          *string    `json:"eventStatus"`
	ScanIntervalMins     *int       `json:"scanIntervalMins"`

	S3Bucket          *string   `json:"s3Bucket"`
	S3Prefix          *string   `json:"s3Prefix"`
	KmsKey            *string   `json:"kmsKey"`
	LogTypes          []*string `json:"logTypes" dynamodbav:"logTypes,stringset"`
	StackName         *string   `json:"stackName,omitempty"`
	LogProcessingRole *string   `json:"logProcessingRole,omitempty"`
}

IntegrationItem represents an integration item as it is stored in DynamoDB.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL