debian-forge-composer/internal/distro/test/distro.go
Lars Karlitski b911d0b928 weldr: get repositories from distro
Make distros export repository information and use those in the weldr
API. This means that repos are only specified once and that the API
returns the right packages when we allow different distros.
2019-11-18 12:22:10 +01:00

36 lines
907 B
Go

package test
import (
"github.com/osbuild/osbuild-composer/internal/blueprint"
"github.com/osbuild/osbuild-composer/internal/distro"
"github.com/osbuild/osbuild-composer/internal/pipeline"
"github.com/osbuild/osbuild-composer/internal/rpmmd"
)
type TestDistro struct{}
func init() {
distro.Register("test", &TestDistro{})
}
func (d *TestDistro) Repositories() []rpmmd.RepoConfig {
return []rpmmd.RepoConfig{
{
Id: "test",
Name: "Test",
BaseURL: "http://example.com/test/os",
},
}
}
func (d *TestDistro) ListOutputFormats() []string {
return []string{}
}
func (d *TestDistro) FilenameFromType(outputFormat string) (string, string, error) {
return "", "", &distro.InvalidOutputFormatError{outputFormat}
}
func (d *TestDistro) Pipeline(b *blueprint.Blueprint, outputFormat string) (*pipeline.Pipeline, error) {
return nil, &distro.InvalidOutputFormatError{outputFormat}
}