🎨 Port package to types

This refactors DefaultPackage into types.Package and gets rid of the
interface. This is a preceeding for a follow up where accessors will be
removed from the code.
It also does several cleanup, so we get rid also of some unneeded
dependencies.
This commit is contained in:
Ettore Di Giacinto
2022-01-06 23:57:56 +01:00
parent 9c61210b5b
commit ba0d625b5f
98 changed files with 2694 additions and 6525 deletions

View File

@@ -18,7 +18,6 @@ package installer
import (
"github.com/mudler/luet/pkg/api/core/types"
"github.com/mudler/luet/pkg/compiler"
pkg "github.com/mudler/luet/pkg/package"
)
type RepositoryOption func(cfg *RepositoryConfig) error
@@ -29,7 +28,7 @@ type RepositoryConfig struct {
Priority int
Src string
Tree []string
DB pkg.PackageDatabase
DB types.PackageDatabase
CompilerBackend compiler.CompilerBackend
ImagePrefix string
@@ -58,7 +57,7 @@ func WithContext(c types.Context) func(cfg *RepositoryConfig) error {
}
}
func WithDatabase(b pkg.PackageDatabase) func(cfg *RepositoryConfig) error {
func WithDatabase(b types.PackageDatabase) func(cfg *RepositoryConfig) error {
return func(cfg *RepositoryConfig) error {
cfg.DB = b
return nil