Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Uid ¶
Uid converts an uint64 to a string, which can be used as part of Subject and ObjectId fields in the graph.NQuad
func ValueFromGeoJson ¶
loc, err := client.ValueFromGeoJson(`{"type":"Point","coordinates":[-122.2207184,37.72129059]}`)
if err != nil { log.Fatal(err) }
if err := req.AddMutation(graph.NQuad{ Subject: "alice", Predicate: "birthday", ObjectValue: loc, }, client.SET); err != nil {
log.Fatal(err) }
Types ¶
type BatchMutation ¶
type BatchMutation struct {
// contains filtered or unexported fields
}
func NewBatchMutation ¶
func NewBatchMutation(ctx context.Context, conn *grpc.ClientConn, size int, pending int) *BatchMutation
func (*BatchMutation) AddMutation ¶
func (batch *BatchMutation) AddMutation(nq graph.NQuad, op Op) error
func (*BatchMutation) Counter ¶
func (batch *BatchMutation) Counter() Counter
func (*BatchMutation) Flush ¶
func (batch *BatchMutation) Flush()
type Req ¶
type Req struct {
// contains filtered or unexported fields
}
Req wraps the graph.Request so that we can define helper methods for the client around it.
func (*Req) AddMutation ¶
To add a mutation with a DELETE operation
if err := req.AddMutation(graph.NQuad{ Sub: "alice", Pred: "name", Value: client.Str("Alice"), }, client.DEL); err != nil {
.... handle error .... }
Click to show internal directories.
Click to hide internal directories.