forked from vmware-archive/atc
-
Notifications
You must be signed in to change notification settings - Fork 1
/
server.go
53 lines (43 loc) · 1.16 KB
/
server.go
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
package buildserver
import (
"net/http"
"code.cloudfoundry.org/lager"
"github.com/concourse/atc/auth"
"github.com/concourse/atc/dbng"
"github.com/concourse/atc/engine"
"github.com/concourse/atc/worker"
)
type EventHandlerFactory func(lager.Logger, dbng.Build) http.Handler
type Server struct {
logger lager.Logger
externalURL string
engine engine.Engine
workerClient worker.Client
teamFactory dbng.TeamFactory
buildFactory dbng.BuildFactory
eventHandlerFactory EventHandlerFactory
drain <-chan struct{}
rejector auth.Rejector
}
func NewServer(
logger lager.Logger,
externalURL string,
engine engine.Engine,
workerClient worker.Client,
teamFactory dbng.TeamFactory,
buildFactory dbng.BuildFactory,
eventHandlerFactory EventHandlerFactory,
drain <-chan struct{},
) *Server {
return &Server{
logger: logger,
externalURL: externalURL,
engine: engine,
workerClient: workerClient,
teamFactory: teamFactory,
buildFactory: buildFactory,
eventHandlerFactory: eventHandlerFactory,
drain: drain,
rejector: auth.UnauthorizedRejector{},
}
}