MCPcopy Create free account
hub / github.com/conforma/cli / CreateStorageBackend

Function CreateStorageBackend

internal/validate/vsa/storage.go:132–141  ·  view source on GitHub ↗

CreateStorageBackend creates the appropriate storage backend based on config

(config *StorageConfig)

Source from the content-addressed store, hash-verified

130
131// CreateStorageBackend creates the appropriate storage backend based on config
132func CreateStorageBackend(config *StorageConfig) (StorageBackend, error) {
133 switch strings.ToLower(config.Backend) {
134 case "rekor":
135 return NewRekorBackend(config)
136 case "local":
137 return NewLocalBackend(config)
138 default:
139 return nil, fmt.Errorf("unsupported storage backend: %s. Supported backends: rekor, local", config.Backend)
140 }
141}
142
143// UploadVSAEnvelope uploads a VSA envelope to the configured storage backends
144func UploadVSAEnvelope(ctx context.Context, envelopePath string, storageConfigs []string, signer *Signer) error {

Callers 2

UploadVSAEnvelopeFunction · 0.85
TestCreateStorageBackendFunction · 0.85

Calls 3

NewRekorBackendFunction · 0.85
NewLocalBackendFunction · 0.85
ErrorfMethod · 0.65

Tested by 1

TestCreateStorageBackendFunction · 0.68