debian-forge-composer/internal/cloudapi/server.go
Achilleas Koutsou 0e4a9e586f split: replace internal packages with images library
Remove all the internal package that are now in the
github.com/osbuild/images package and vendor it.

A new function in internal/blueprint/ converts from an osbuild-composer
blueprint to an images blueprint.  This is necessary for keeping the
blueprint implementation in both packages.  In the future, the images
package will change the blueprint (and most likely rename it) and it
will only be part of the osbuild-composer internals and interface.  The
Convert() function will be responsible for converting the blueprint into
the new configuration object.
2023-07-10 21:11:19 +02:00

29 lines
590 B
Go

package cloudapi
import (
"net/http"
"github.com/osbuild/images/pkg/distroregistry"
"github.com/osbuild/osbuild-composer/internal/worker"
v2 "github.com/osbuild/osbuild-composer/internal/cloudapi/v2"
)
type Server struct {
v2 *v2.Server
}
func NewServer(workers *worker.Server, distros *distroregistry.Registry, config v2.ServerConfig) *Server {
server := &Server{
v2: v2.NewServer(workers, distros, config),
}
return server
}
func (server *Server) V2(path string) http.Handler {
return server.v2.Handler(path)
}
func (server *Server) Shutdown() {
server.v2.Shutdown()
}