MCPcopy Create free account
hub / github.com/Azure/peerd / run

Function run

cmd/proxy/main.go:61–74  ·  view source on GitHub ↗
(ctx context.Context, args *Arguments)

Source from the content-addressed store, hash-verified

59}
60
61func run(ctx context.Context, args *Arguments) error {
62 ctx, cancel := signal.NotifyContext(ctx, syscall.SIGTERM)
63 defer cancel()
64
65 switch {
66 case args.Version:
67 zerolog.Ctx(ctx).Info().Msg("version") // version field is already added to the logger
68 return nil
69 case args.Server != nil:
70 return serverCommand(ctx, args.Server)
71 default:
72 return fmt.Errorf("unknown subcommand")
73 }
74}
75
76func serverCommand(ctx context.Context, args *ServerCmd) (err error) {
77 l := zerolog.Ctx(ctx)

Callers 2

TestRunFunction · 0.70
mainFunction · 0.70

Calls 1

serverCommandFunction · 0.85

Tested by 1

TestRunFunction · 0.56