MCPcopy Create free account
hub / github.com/blobcache/blobcache / openService

Function openService

src/blobcachecmd/root.go:134–146  ·  view source on GitHub ↗

openService opens a service

(c star.Context)

Source from the content-addressed store, hash-verified

132
133// openService opens a service
134func openService(c star.Context) (blobcache.Service, error) {
135 apiURL := c.Env[bcclient.EnvBlobcacheAPI]
136 if apiURL == "" {
137 // TODO: star does not properly include Env vars in Main
138 // This should not be required.
139 apiURL = os.Getenv(bcclient.EnvBlobcacheAPI)
140 }
141 if apiURL == "" {
142 logctx.Warnf(c.Context, "%s not set, using default=%s", bcclient.EnvBlobcacheAPI, bcclient.DefaultEndpoint)
143 apiURL = bcclient.DefaultEndpoint
144 }
145 return bcclient.NewClient(apiURL), nil
146}
147
148func RunTest(t testing.TB, env map[string]string, calledAs string, args []string, stdin *bufio.Reader, stdout *bufio.Writer, stderr *bufio.Writer) {
149 if stdin == nil {

Callers 9

fuse.goFile · 0.85
handle.goFile · 0.85
getNSFunction · 0.85
git.goFile · 0.85
glfs.goFile · 0.85
tx.goFile · 0.85
mkvolFunction · 0.85
volume.goFile · 0.85
root.goFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected