Documentation ¶
Index ¶
- Constants
- func DynamodbStorageTypeProvider(storageType string, storageConfig *grafeasConfig.StorageConfiguration) (*storage.Storage, error)
- type DataItem
- type DynamoDb
- func (db *DynamoDb) BatchCreateNotes(ctx context.Context, projectId string, userID string, ...) ([]*pb.Note, []error)
- func (db *DynamoDb) BatchCreateOccurrences(ctx context.Context, projectId string, userID string, occs []*pb.Occurrence) ([]*pb.Occurrence, []error)
- func (db *DynamoDb) CreateNote(ctx context.Context, projectId, nID string, userID string, n *pb.Note) (*pb.Note, error)
- func (db *DynamoDb) CreateOccurrence(ctx context.Context, projectId, userID string, o *pb.Occurrence) (*pb.Occurrence, error)
- func (db *DynamoDb) CreateProject(ctx context.Context, pID string, p *prpb.Project) (*prpb.Project, error)
- func (db *DynamoDb) DeleteNote(ctx context.Context, projectId, nID string) error
- func (db *DynamoDb) DeleteOccurrence(ctx context.Context, projectId, occId string) error
- func (db *DynamoDb) DeleteProject(ctx context.Context, pID string) error
- func (db *DynamoDb) GetNote(ctx context.Context, projectId, nID string) (*pb.Note, error)
- func (db *DynamoDb) GetOccurrence(ctx context.Context, projectId, occId string) (*pb.Occurrence, error)
- func (db *DynamoDb) GetOccurrenceNote(ctx context.Context, projectId, oID string) (*pb.Note, error)
- func (db *DynamoDb) GetProject(ctx context.Context, pID string) (*prpb.Project, error)
- func (db *DynamoDb) GetVulnerabilityOccurrencesSummary(ctx context.Context, projectId, filter string) (*pb.VulnerabilityOccurrencesSummary, error)
- func (db *DynamoDb) ListNoteOccurrences(ctx context.Context, nPID, nID, filter, pageToken string, pageSize int32) ([]*pb.Occurrence, string, error)
- func (db *DynamoDb) ListNotes(ctx context.Context, projectId, filter, pageToken string, pageSize int32) ([]*pb.Note, string, error)
- func (db *DynamoDb) ListOccurrences(ctx context.Context, projectId, filter, pageToken string, pageSize int32) ([]*pb.Occurrence, string, error)
- func (db *DynamoDb) ListProjects(ctx context.Context, filter string, pageSize int, pageToken string) ([]*prpb.Project, string, error)
- func (db *DynamoDb) UpdateNote(ctx context.Context, projectId, nID string, n *pb.Note, ...) (*pb.Note, error)
- func (db *DynamoDb) UpdateOccurrence(ctx context.Context, projectId, occId string, o *pb.Occurrence, ...) (*pb.Occurrence, error)
Constants ¶
const ( // constants relating to table structure GlobalSecondaryIndex1 = "GSI_1" PartitionKeyName = "PartitionKey" SortKeyName = "SortKey" DataKeyName = "Data" JsonKeyName = "Json" PaginationString = "&" )
Variables ¶
This section is empty.
Functions ¶
func DynamodbStorageTypeProvider ¶
func DynamodbStorageTypeProvider(storageType string, storageConfig *grafeasConfig.StorageConfiguration) (*storage.Storage, error)
Types ¶
type DynamoDb ¶
func NewDynamoDbStore ¶
func NewDynamoDbStore(config *config.DynamoDbConfig) *DynamoDb
func (*DynamoDb) BatchCreateNotes ¶
func (db *DynamoDb) BatchCreateNotes(ctx context.Context, projectId string, userID string, notes map[string]*pb.Note) ([]*pb.Note, []error)
BatchCreateNotes batch creates the specified notes in storage.
func (*DynamoDb) BatchCreateOccurrences ¶
func (db *DynamoDb) BatchCreateOccurrences(ctx context.Context, projectId string, userID string, occs []*pb.Occurrence) ([]*pb.Occurrence, []error)
BatchCreateOccurrences batch creates the specified occurrences in storage.
func (*DynamoDb) CreateNote ¶
func (db *DynamoDb) CreateNote(ctx context.Context, projectId, nID string, userID string, n *pb.Note) (*pb.Note, error)
CreateNote creates the specified note in storage.
func (*DynamoDb) CreateOccurrence ¶
func (db *DynamoDb) CreateOccurrence(ctx context.Context, projectId, userID string, o *pb.Occurrence) (*pb.Occurrence, error)
CreateOccurrence creates the specified occurrence in storage.
func (*DynamoDb) CreateProject ¶
func (db *DynamoDb) CreateProject(ctx context.Context, pID string, p *prpb.Project) (*prpb.Project, error)
CreateProject creates the specified project in the storage.
func (*DynamoDb) DeleteNote ¶
DeleteNote deletes the specified note in storage.
func (*DynamoDb) DeleteOccurrence ¶
DeleteOccurrence deletes the specified occurrence in storage.
func (*DynamoDb) DeleteProject ¶
DeleteProject deletes the specified project from the storage.
func (*DynamoDb) GetOccurrence ¶
func (db *DynamoDb) GetOccurrence(ctx context.Context, projectId, occId string) (*pb.Occurrence, error)
GetOccurrence gets the specified occurrence from storage.
func (*DynamoDb) GetOccurrenceNote ¶
GetOccurrenceNote gets the note for the specified occurrence from storage.
func (*DynamoDb) GetProject ¶
GetProject gets the specified project from the storage.
func (*DynamoDb) GetVulnerabilityOccurrencesSummary ¶
func (db *DynamoDb) GetVulnerabilityOccurrencesSummary(ctx context.Context, projectId, filter string) (*pb.VulnerabilityOccurrencesSummary, error)
GetVulnerabilityOccurrencesSummary gets a summary of vulnerability occurrences from storage.
func (*DynamoDb) ListNoteOccurrences ¶
func (db *DynamoDb) ListNoteOccurrences(ctx context.Context, nPID, nID, filter, pageToken string, pageSize int32) ([]*pb.Occurrence, string, error)
ListNoteOccurrences lists all occurrences across all projects for the specified note from storage.
func (*DynamoDb) ListNotes ¶
func (db *DynamoDb) ListNotes(ctx context.Context, projectId, filter, pageToken string, pageSize int32) ([]*pb.Note, string, error)
ListNotes lists notes for the specified project from storage.
func (*DynamoDb) ListOccurrences ¶
func (db *DynamoDb) ListOccurrences(ctx context.Context, projectId, filter, pageToken string, pageSize int32) ([]*pb.Occurrence, string, error)
ListOccurrences lists occurrences for the specified project from storage.
func (*DynamoDb) ListProjects ¶
func (db *DynamoDb) ListProjects(ctx context.Context, filter string, pageSize int, pageToken string) ([]*prpb.Project, string, error)
ListProjects returns projects in the storage.
func (*DynamoDb) UpdateNote ¶
func (db *DynamoDb) UpdateNote(ctx context.Context, projectId, nID string, n *pb.Note, mask *fieldmaskpb.FieldMask) (*pb.Note, error)
UpdateNote updates the specified note in storage.
func (*DynamoDb) UpdateOccurrence ¶
func (db *DynamoDb) UpdateOccurrence(ctx context.Context, projectId, occId string, o *pb.Occurrence, mask *fieldmaskpb.FieldMask) (*pb.Occurrence, error)
UpdateOccurrence updates the specified occurrence in storage.