mirror of
https://github.com/linka-cloud/grpc.git
synced 2025-06-22 09:12:28 +00:00
interceptors: migrate to otel and add logging interceptor
Signed-off-by: Adphi <philippe.adrien.nousse@gmail.com>
This commit is contained in:
24
example/main.go
Normal file
24
example/main.go
Normal file
@ -0,0 +1,24 @@
|
||||
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)
|
||||
}
|
Reference in New Issue
Block a user