Documentation
¶
Overview ¶
Package config provides configuration utilities for vimp.
Key functions:
- GetDefaultDBPath: returns default SQLite database path (~/.vimp.db)
- RemoveSchema: strips protocol scheme from image URIs
- GetTempFilePath: creates temporary file paths for scanner output
Database configuration:
path := config.GetDefaultDBPath() // sqlite://~/.vimp.db
Image URI handling:
// Removes docker:// or other scheme prefixes
image, _ := config.RemoveSchema("docker://redis:latest") // "redis:latest"
Index ¶
Constants ¶
View Source
const ( // FileNameDefault is the default file name for the data store. FileNameDefault = ".vimp.db" // LocalStorePrefix is the prefix for local store. LocalStorePrefix = "sqlite://" )
Variables ¶
This section is empty.
Functions ¶
func GetDefaultDBPath ¶
func GetDefaultDBPath() string
GetDefaultDBPath returns the default path for the data store.
func GetDigest ¶ added in v0.5.5
GetDigest returns the digest of the image. Could result in uri that has both a tag and a digest.
func GetTempFilePath ¶ added in v0.5.4
GetTempFilePath returns a temporary file path.
func NormalizeImageName ¶ added in v0.7.6
NormalizeImageName adds docker.io/library/ prefix to simple image names. Examples:
- nginx -> docker.io/library/nginx
- nginx:1.25 -> docker.io/library/nginx:1.25
- myuser/myimage -> docker.io/myuser/myimage
- docker.io/library/nginx -> docker.io/library/nginx (unchanged)
- localhost:5000/myimage -> localhost:5000/myimage (unchanged, registry with port)
func RemoveSchema ¶ added in v0.5.5
RemoveSchema cleans up a URI by removing the scheme (e.g., https://). Container image references like "nginx:1.25" are returned unchanged since the colon is a tag separator, not a scheme delimiter.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.