Skip to content

senzing-garage/go-grpcing

go-grpcing

If you are beginning your journey with Senzing, please start with Senzing Quick Start guides.

You are in the Senzing Garage where projects are "tinkered" on. Although this GitHub repository may help you understand an approach to using Senzing, it's not considered to be "production ready" and is not considered to be part of the Senzing product. Heck, it may not even be appropriate for your application of Senzing!

⚠️ WARNING: template-go is still in development ⚠️ _

At the moment, this is "work-in-progress" with Semantic Versions of 0.n.x. Although it can be reviewed and commented on, the recommendation is not to use it yet.

Synopsis

Helpers for working with gRPC.

Go Reference Badge Go Report Card Badge License Badge go-test-linux.yaml Badge go-test-darwin.yaml Badge go-test-windows.yaml Badge

golangci-lint.yaml Badge

Overview

Examples of using go-grpcing can be seen in main.go

Use

package main

import (
    "context"
    "fmt"
    "reflect"

    "github.com/senzing-garage/go-grpcing/grpcurl"
    "google.golang.org/grpc"
)

func main() {
    ctx := context.TODO()
    grpcUrl := "grpc://localhost:8258"

    grpcTarget, grpcDialOptions, err := grpcurl.Parse(ctx, grpcUrl)
    if err != nil {
        panic(err)
    }

    grpcConnection, err := grpc.Dial(grpcTarget, grpcDialOptions...)
    if err != nil {
        panic(err)
    }

    fmt.Printf("grpcTarget: %s\n", grpcTarget)
    fmt.Printf("grpcDialOptions: %s\n", reflect.TypeOf(grpcDialOptions))
    fmt.Printf("grpcConnection: %s\n", reflect.TypeOf(grpcConnection))
}

References

  1. SDK documentation
  2. Development
  3. Errors
  4. Examples

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •