diff --git a/buildpack/build.go b/buildpack/build.go index 2885e0827..5f2306c31 100644 --- a/buildpack/build.go +++ b/buildpack/build.go @@ -56,6 +56,8 @@ type BuildOutputs struct { Slices []layers.Slice } +// BuildExecutor TODO +// //go:generate mockgen -package testmock -destination ../lifecycle/testmock/build_executor.go github.com/buildpacks/lifecycle/buildpack BuildExecutor type BuildExecutor interface { Build(d BpDescriptor, inputs BuildInputs, logger log.Logger) (BuildOutputs, error) diff --git a/buildpack/descriptor.go b/buildpack/descriptor.go index 45aeb7d08..767ef1ea0 100644 --- a/buildpack/descriptor.go +++ b/buildpack/descriptor.go @@ -5,6 +5,8 @@ const ( KindExtension = "Extension" ) +// Descriptor TODO +// //go:generate mockgen -package testmock -destination ../lifecycle/testmock/component_descriptor.go github.com/buildpacks/lifecycle/buildpack Descriptor type Descriptor interface { API() string diff --git a/buildpack/detect.go b/buildpack/detect.go index d975ae969..3f3756d7f 100644 --- a/buildpack/detect.go +++ b/buildpack/detect.go @@ -39,6 +39,8 @@ type DetectOutputs struct { Err error `toml:"-"` } +// DetectExecutor TODO +// //go:generate mockgen -package testmock -destination ../lifecycle/testmock/detect_executor.go github.com/buildpacks/lifecycle/buildpack DetectExecutor type DetectExecutor interface { Detect(d Descriptor, inputs DetectInputs, logger log.Logger) DetectOutputs diff --git a/buildpack/generate.go b/buildpack/generate.go index 0d3c949bb..ad53c8874 100644 --- a/buildpack/generate.go +++ b/buildpack/generate.go @@ -34,6 +34,8 @@ type GenerateOutputs struct { MetRequires []string } +// GenerateExecutor TODO +// //go:generate mockgen -package testmock -destination ../lifecycle/testmock/generate_executor.go github.com/buildpacks/lifecycle/buildpack GenerateExecutor type GenerateExecutor interface { Generate(d ExtDescriptor, inputs GenerateInputs, logger log.Logger) (GenerateOutputs, error) diff --git a/internal/layer/metadata_restorer.go b/internal/layer/metadata_restorer.go index c20aa6c4b..d15083ff4 100644 --- a/internal/layer/metadata_restorer.go +++ b/internal/layer/metadata_restorer.go @@ -14,6 +14,8 @@ import ( "github.com/buildpacks/lifecycle/platform/files" ) +// MetadataRestorer TODO +// //go:generate mockgen -package testmock -destination ../../lifecycle/testmock/metadata_restorer.go github.com/buildpacks/lifecycle/internal/layer MetadataRestorer type MetadataRestorer interface { Restore(buildpacks []buildpack.GroupElement, appMeta files.LayersMetadata, cacheMeta platform.CacheMetadata, layerSHAStore SHAStore) error diff --git a/internal/layer/sbom_restorer.go b/internal/layer/sbom_restorer.go index 43cbb1657..738679827 100644 --- a/internal/layer/sbom_restorer.go +++ b/internal/layer/sbom_restorer.go @@ -20,6 +20,8 @@ import ( "github.com/buildpacks/lifecycle/log" ) +// SBOMRestorer TODO +// //go:generate mockgen -package testmock -destination ../../lifecycle/testmock/sbom_restorer.go github.com/buildpacks/lifecycle/internal/layer SBOMRestorer type SBOMRestorer interface { RestoreFromPrevious(image imgutil.Image, layerDigest string) error diff --git a/lifecycle/builder.go b/lifecycle/builder.go index 83a349297..b2a92dcf1 100644 --- a/lifecycle/builder.go +++ b/lifecycle/builder.go @@ -25,6 +25,8 @@ type Platform interface { API() *api.Version } +// BuildEnv TODO +// //go:generate mockgen -package testmock -destination testmock/build_env.go github.com/buildpacks/lifecycle/lifecycle BuildEnv type BuildEnv interface { AddRootDir(baseDir string) error diff --git a/lifecycle/detector.go b/lifecycle/detector.go index be9c3b953..77257ecef 100644 --- a/lifecycle/detector.go +++ b/lifecycle/detector.go @@ -28,6 +28,8 @@ var ( ErrBuildpack = errors.New("buildpack(s) failed with err") ) +// DetectResolver TODO +// //go:generate mockgen -package testmock -destination testmock/detect_resolver.go github.com/buildpacks/lifecycle/lifecycle DetectResolver type DetectResolver interface { Resolve(done []buildpack.GroupElement, detectRuns *sync.Map) ([]buildpack.GroupElement, []files.BuildPlanEntry, error) diff --git a/lifecycle/exporter.go b/lifecycle/exporter.go index 989722883..705651cff 100644 --- a/lifecycle/exporter.go +++ b/lifecycle/exporter.go @@ -47,6 +47,8 @@ type Exporter struct { PlatformAPI *api.Version } +// LayerFactory TODO +// //go:generate mockgen -package testmock -destination testmock/layer_factory.go github.com/buildpacks/lifecycle/lifecycle LayerFactory type LayerFactory interface { DirLayer(id string, dir string, createdBy string) (layers.Layer, error) diff --git a/lifecycle/extender.go b/lifecycle/extender.go index eecafdd99..a6f786728 100644 --- a/lifecycle/extender.go +++ b/lifecycle/extender.go @@ -39,6 +39,8 @@ type Extender struct { Extensions []buildpack.GroupElement // extensions are ordered from group.toml } +// DockerfileApplier TODO +// //go:generate mockgen -package testmock -destination testmock/dockerfile_applier.go github.com/buildpacks/lifecycle/lifecycle DockerfileApplier type DockerfileApplier interface { ImageFor(reference string) (v1.Image, error) diff --git a/lifecycle/handlers.go b/lifecycle/handlers.go index 716cfbc2d..8188a93ca 100644 --- a/lifecycle/handlers.go +++ b/lifecycle/handlers.go @@ -12,11 +12,15 @@ import ( var Config = &DefaultConfigHandler{} +// CacheHandler TODO +// //go:generate mockgen -package testmock -destination testmock/cache_handler.go github.com/buildpacks/lifecycle/lifecycle CacheHandler type CacheHandler interface { InitCache(imageRef, dir string, deletionEnabled bool) (Cache, error) } +// DirStore TODO +// //go:generate mockgen -package testmock -destination testmock/dir_store.go github.com/buildpacks/lifecycle/lifecycle DirStore type DirStore interface { Lookup(kind, id, version string) (buildpack.Descriptor, error) @@ -24,13 +28,18 @@ type DirStore interface { LookupExt(id, version string) (*buildpack.ExtDescriptor, error) } +// TODO: figure out where this goes //go:generate mockgen -package testmock -destination testmock/image_handler.go github.com/buildpacks/lifecycle/image Handler +// BuildpackAPIVerifier TODO +// //go:generate mockgen -package testmock -destination testmock/buildpack_api_verifier.go github.com/buildpacks/lifecycle/lifecycle BuildpackAPIVerifier type BuildpackAPIVerifier interface { VerifyBuildpackAPI(kind, name, requested string, logger log.Logger) error } +// ConfigHandler TODO +// //go:generate mockgen -package testmock -destination testmock/config_handler.go github.com/buildpacks/lifecycle/lifecycle ConfigHandler type ConfigHandler interface { ReadAnalyzed(path string, logger log.Logger) (files.Analyzed, error)