2
0
mirror of https://github.com/linka-cloud/d2vm.git synced 2024-11-21 23:36:25 +00:00

chore: expose builder interface

Signed-off-by: Adphi <philippe.adrien.nousse@gmail.com>
This commit is contained in:
Adphi 2022-09-11 20:01:37 +02:00
parent 238d9a51af
commit 0208a2a134
Signed by: adphi
GPG Key ID: 46BE4062DB2397FF

View File

@ -105,6 +105,11 @@ func sysconfig(osRelease OSRelease) (string, error) {
}
}
type Builder interface {
Build(ctx context.Context) (err error)
Close() error
}
type builder struct {
osRelease OSRelease
@ -125,7 +130,7 @@ type builder struct {
cmdLineExtra string
}
func NewBuilder(ctx context.Context, workdir, imgTag, disk string, size int64, osRelease OSRelease, format string, cmdLineExtra string) (*builder, error) {
func NewBuilder(ctx context.Context, workdir, imgTag, disk string, size int64, osRelease OSRelease, format string, cmdLineExtra string) (Builder, error) {
if err := checkDependencies(); err != nil {
return nil, err
}