mirror of
https://github.com/mudler/luet.git
synced 2025-09-02 07:45:02 +00:00
Move compiler options to its own struct
Also add Clean attribute, to handle a future build clean method
This commit is contained in:
@@ -16,6 +16,8 @@
|
||||
package compiler
|
||||
|
||||
import (
|
||||
"runtime"
|
||||
|
||||
pkg "github.com/mudler/luet/pkg/package"
|
||||
"github.com/mudler/luet/pkg/solver"
|
||||
)
|
||||
@@ -40,6 +42,24 @@ type CompilerBackendOptions struct {
|
||||
Destination string
|
||||
}
|
||||
|
||||
type CompilerOptions struct {
|
||||
ImageRepository string
|
||||
PullFirst, KeepImg bool
|
||||
Concurrency int
|
||||
CompressionType CompressionImplementation
|
||||
Clean bool
|
||||
}
|
||||
|
||||
func NewDefaultCompilerOptions() CompilerOptions {
|
||||
return CompilerOptions{
|
||||
ImageRepository: "luet/cache",
|
||||
PullFirst: true,
|
||||
CompressionType: None,
|
||||
KeepImg: true,
|
||||
Concurrency: runtime.NumCPU(),
|
||||
}
|
||||
}
|
||||
|
||||
type CompilerBackend interface {
|
||||
BuildImage(CompilerBackendOptions) error
|
||||
ExportImage(CompilerBackendOptions) error
|
||||
|
Reference in New Issue
Block a user