MCPcopy Create free account
hub / github.com/buildbarn/bb-browser / NewBrowserService

Function NewBrowserService

cmd/bb_browser/browser_service.go:108–127  ·  view source on GitHub ↗

NewBrowserService constructs a BrowserService that accesses storage through a set of handles.

(contentAddressableStorage, actionCache, initialSizeClassCache, fileSystemAccessCache blobstore.BlobAccess, maximumMessageSizeBytes int, templates *template.Template, bbClientdInstanceNamePatcher digest.InstanceNamePatcher, router *mux.Router)

Source from the content-addressed store, hash-verified

106// NewBrowserService constructs a BrowserService that accesses storage
107// through a set of handles.
108func NewBrowserService(contentAddressableStorage, actionCache, initialSizeClassCache, fileSystemAccessCache blobstore.BlobAccess, maximumMessageSizeBytes int, templates *template.Template, bbClientdInstanceNamePatcher digest.InstanceNamePatcher, router *mux.Router) *BrowserService {
109 s := &BrowserService{
110 contentAddressableStorage: contentAddressableStorage,
111 actionCache: actionCache,
112 initialSizeClassCache: initialSizeClassCache,
113 fileSystemAccessCache: fileSystemAccessCache,
114 maximumMessageSizeBytes: maximumMessageSizeBytes,
115 templates: templates,
116 bbClientdInstanceNamePatcher: bbClientdInstanceNamePatcher,
117 }
118 router.HandleFunc("/", s.handleWelcome)
119 router.HandleFunc("/{instanceName:(?:.*?/)?}blobs/{digestFunction}/action/{hash}-{sizeBytes}/", s.handleAction)
120 router.HandleFunc("/{instanceName:(?:.*?/)?}blobs/{digestFunction}/command/{hash}-{sizeBytes}/", s.handleCommand)
121 router.HandleFunc("/{instanceName:(?:.*?/)?}blobs/{digestFunction}/directory/{hash}-{sizeBytes}/", s.handleDirectory)
122 router.HandleFunc("/{instanceName:(?:.*?/)?}blobs/{digestFunction}/file/{hash}-{sizeBytes}/{name}", s.handleFile)
123 router.HandleFunc("/{instanceName:(?:.*?/)?}blobs/{digestFunction}/previous_execution_stats/{hash}-{sizeBytes}/", s.handlePreviousExecutionStats)
124 router.HandleFunc("/{instanceName:(?:.*?/)?}blobs/{digestFunction}/tree/{hash}-{sizeBytes}/{subdirectory:(?:.*/)?}", s.handleTree)
125 router.HandleFunc("/{instanceName:(?:.*?/)?}blobs/{digestFunction}/historical_execute_response/{hash}-{sizeBytes}/", s.handleHistoricalExecuteResponse)
126 return s
127}
128
129var (
130 invalidReplacementComponent = path.MustNewComponent("???")

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected