ddb

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2020 License: AGPL-3.0, Apache-2.0 Imports: 12 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) DeleteIntegrationItem

func (ddb *DDB) DeleteIntegrationItem(input *models.DeleteIntegrationInput) error

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

func (*DDB) GetIntegration

func (ddb *DDB) GetIntegration(integrationID *string) (*models.SourceIntegrationMetadata, error)

GetIntegration returns an integration by its ID

func (*DDB) PutSourceIntegration

func (ddb *DDB) PutSourceIntegration(input *models.SourceIntegrationMetadata) error

PutSourceIntegration adds a batch of new Snapshot Integrations to the database.

func (*DDB) ScanIntegrations

func (ddb *DDB) ScanIntegrations(input *models.ListIntegrationsInput) ([]*models.SourceIntegration, 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.

func (*DDB) UpdateItem

func (ddb *DDB) UpdateItem(input *UpdateIntegrationItem) (*models.SourceIntegration, error)

UpdateItem updates existing attributes in an item in the table.

It inspects the input struct to identify non-nil fields, and then only updates them.

type UpdateIntegrationItem

type UpdateIntegrationItem struct {
	RemediationEnabled   *bool      `json:"remediationEnabled"`
	CWEEnabled           *bool      `json:"cweEnabled"`
	IntegrationID        *string    `json:"integrationId"`
	IntegrationLabel     *string    `json:"integrationLabel"`
	IntegrationType      *string    `json:"integrationType"`
	LastScanEndTime      *time.Time `json:"lastScanEndTime"`
	LastScanErrorMessage *string    `json:"lastScanErrorMessage"`
	LastScanStartTime    *time.Time `json:"lastScanStartTime"`
	ScanStatus           *string    `json:"scanStatus"`
	ScanIntervalMins     *int       `json:"scanIntervalMins"`
	S3Bucket             *string    `json:"s3Bucket"`
	S3Prefix             *string    `json:"s3Prefix"`
	KmsKey               *string    `json:"kmsKey"`
	LogTypes             []*string  `json:"logTypes" dynamodbav:"logTypes,stringset"`
}

UpdateIntegrationItem updates almost every attribute in the table.

It's used for attributes that can change, which is almost all of them except for the creation based ones (CreatedAtTime and CreatedBy).

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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