Documentation
¶
Overview ¶
Package database - Handles all interaction with ArangoDB
Index ¶
- func FindReleaseByCompositeKey(ctx context.Context, db arangodb.Database, name, version, contentSha string) (string, error)
- func FindSBOMByContentHash(ctx context.Context, db arangodb.Database, contentHash string) (string, error)
- func GetEnvDefault(key, defVal string) string
- func InitLogger() *zap.Logger
- type DBConnection
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FindReleaseByCompositeKey ¶
func FindReleaseByCompositeKey(ctx context.Context, db arangodb.Database, name, version, contentSha string) (string, error)
FindReleaseByCompositeKey checks if a release exists by name, version, and content SHA Returns the document key if found, empty string if not found
func FindSBOMByContentHash ¶
func FindSBOMByContentHash(ctx context.Context, db arangodb.Database, contentHash string) (string, error)
FindSBOMByContentHash checks if an SBOM exists by content hash Returns the document key if found, empty string if not found
func GetEnvDefault ¶
GetEnvDefault is a convenience function for handling env vars
func InitLogger ¶
InitLogger sets up the Zap Logger to log to the console in a human readable format
Types ¶
type DBConnection ¶
type DBConnection struct {
Collections map[string]arangodb.Collection
Database arangodb.Database
}
DBConnection is the structure that defined the database engine and collections
func InitializeDatabase ¶
func InitializeDatabase() DBConnection
InitializeDatabase is the function for connecting to the db engine, creating the database and collections