()
| 9 | "connectrpc.com/connect/v2" |
| 10 | "connectrpc.com/connect/v2/connecthttp" |
| 11 | ) |
| 12 | |
| 13 | func Example() (*reflectv1beta1.GetFileDescriptorSetResponse, error) { |
| 14 | client := reflectv1beta1connect.NewFileDescriptorSetServiceClient(connect.NewClient( |
| 15 | connecthttp.NewTransport(http.DefaultClient, "https://buf.build"), |
| 16 | )) |
| 17 | request := &reflectv1beta1.GetFileDescriptorSetRequest{ |
| 18 | Module: "buf.build/connectrpc/eliza", |
| 19 | } |
| 20 | ctx := context.Background() |
| 21 | // If you're using a private BSR, set your Authorization header to a |
| 22 | // BUF_TOKEN value. |
| 23 | // |
| 24 | // ctx, info := connect.NewClientContext(ctx) |
| 25 | // info.RequestHeader().Set("Authorization", "Bearer <BUF_TOKEN>") |
| 26 | response, err := client.GetFileDescriptorSet(ctx, request) |
| 27 | if err != nil { |
| 28 | return nil, err |
| 29 | } |
| 30 | |
| 31 | return response, nil |
| 32 | } |
no outgoing calls