grpc/example/main.go
Adphi 3a3d77169c
interceptors: migrate to otel and add logging interceptor
Signed-off-by: Adphi <philippe.adrien.nousse@gmail.com>
2024-10-17 17:15:05 +02:00

25 lines
406 B
Go

package main
import (
"context"
"github.com/spf13/cobra"
"go.linka.cloud/grpc-toolkit/service"
)
func main() {
ctx, cancel := context.WithCancel(context.Background())
defer cancel()
f, opts := service.NewFlagSet()
cmd := &cobra.Command{
Use: "example",
Run: func(cmd *cobra.Command, args []string) {
run(cmd.Context(), opts)
},
}
cmd.Flags().AddFlagSet(f)
cmd.ExecuteContext(ctx)
}