forked from osbuild/osbuild-composer
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathserver.go
More file actions
30 lines (23 loc) · 674 Bytes
/
server.go
File metadata and controls
30 lines (23 loc) · 674 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
package cloudapi
import (
"net/http"
"github.com/osbuild/images/pkg/distrofactory"
"github.com/osbuild/images/pkg/reporegistry"
v2 "github.com/osbuild/osbuild-composer/internal/cloudapi/v2"
"github.com/osbuild/osbuild-composer/internal/worker"
)
type Server struct {
v2 *v2.Server
}
func NewServer(workers *worker.Server, distros *distrofactory.Factory, repos *reporegistry.RepoRegistry, config v2.ServerConfig) *Server {
server := &Server{
v2: v2.NewServer(workers, distros, repos, config),
}
return server
}
func (server *Server) V2(path string) http.Handler {
return server.v2.Handler(path)
}
func (server *Server) Shutdown() {
server.v2.Shutdown()
}