Moved from GitHub dgo/12
Posted by CreatCodeBuild:
I copied & pasted the example code from readme
package dgraph
import (
"log"
"google.golang.org/grpc"
"github.com/dgraph-io/dgo"
"github.com/dgraph-io/dgo/protos/api"
"context"
)
func F() error {
conn, err := grpc.Dial("localhost:5080", grpc.WithInsecure())
if err != nil {
log.Fatal(err)
}
defer conn.Close()
dgraphClient := dgo.NewDgraphClient(api.NewDgraphClient(conn))
op := &api.Operation{
Schema: `name: string @index(exact) .`,
}
err = dgraphClient.Alter(context.Background(), op)
return err
}
get
rpc error: code = Unimplemented desc = unknown service api.Dgraph