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

Function Main

src/blobcachecmd/root.go:30–48  ·  view source on GitHub ↗

Main is the main function for the blobcache CLI. Usage is: func main() { blobcachecmd.Main() }

()

Source from the content-addressed store, hash-verified

28// blobcachecmd.Main()
29// }
30func Main() {
31 ctx := context.Background()
32 lvlStr := os.Getenv(envLogLevel)
33 if lvlStr == "" {
34 lvlStr = "info"
35 }
36 var lvl zapcore.Level
37 if err := lvl.UnmarshalText([]byte(lvlStr)); err != nil {
38 lvl = zapcore.InfoLevel
39 }
40 cfg := zap.NewProductionConfig()
41 cfg.Level = zap.NewAtomicLevelAt(lvl)
42 l, err := cfg.Build()
43 if err != nil {
44 panic(err)
45 }
46 ctx = logctx.NewContext(ctx, l)
47 star.Main(rootCmd, star.MainBackground(ctx))
48}
49
50// Root returns the root command for the blobcache CLI.
51func Root() star.Command {

Callers 1

mainFunction · 0.92

Calls 1

UnmarshalTextMethod · 0.45

Tested by

no test coverage detected