-
Notifications
You must be signed in to change notification settings - Fork 293
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implemented descriptors and created a test for the open function
Signed-off-by: Domenico Luciani <[email protected]>
- Loading branch information
Domenico Luciani
committed
Sep 29, 2023
1 parent
4591bc8
commit 847948d
Showing
2 changed files
with
81 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,30 @@ | ||
package buildpack | ||
|
||
type Flattener interface { | ||
FlatBuildpacks() | ||
import "io" | ||
|
||
type BuildFlattenModule interface { | ||
Open() (io.ReadCloser, error) | ||
Descriptors() []Descriptor | ||
} | ||
|
||
type buildpacksFlattenerModule struct { | ||
descriptors []Descriptor | ||
} | ||
|
||
type BuildpacksFlattener struct { | ||
func NewBuildpacksFlattenerModule(buildmodules []BuildModule) BuildFlattenModule { | ||
var bpFlattenerModule buildpacksFlattenerModule | ||
|
||
for _, module := range buildmodules { | ||
bpFlattenerModule.descriptors = append(bpFlattenerModule.descriptors, module.Descriptor()) | ||
} | ||
|
||
return bpFlattenerModule | ||
} | ||
|
||
func NewBuildpacksFlattener() BuildpacksFlattener { | ||
return BuildpacksFlattener{} | ||
func (bfm buildpacksFlattenerModule) Descriptors() []Descriptor { | ||
return bfm.descriptors | ||
} | ||
|
||
func (bp BuildpacksFlattener) FlatBuildpacks(bps []BuildModule) []BuildModule { | ||
return bps //TODO: Implementation | ||
func (bfm buildpacksFlattenerModule) Open() (io.ReadCloser, error) { | ||
return nil, nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters