MCPcopy
hub / github.com/dgraph-io/dgraph / SchemaExportKv

Function SchemaExportKv

worker/export.go:946–959  ·  view source on GitHub ↗
(attr string, val []byte, skipZero bool)

Source from the content-addressed store, hash-verified

944}
945
946func SchemaExportKv(attr string, val []byte, skipZero bool) (*bpb.KV, error) {
947 if !skipZero {
948 servesTablet, err := groups().ServesTablet(attr)
949 if err != nil || !servesTablet {
950 return nil, errors.Errorf("Tablet not found for attribute: %v", err)
951 }
952 }
953
954 var update pb.SchemaUpdate
955 if err := proto.Unmarshal(val, &update); err != nil {
956 return nil, err
957 }
958 return toSchema(attr, &update), nil
959}
960
961func TypeExportKv(attr string, val []byte) (*bpb.KV, error) {
962 var update pb.TypeUpdate

Callers 2

exportSchemaFunction · 0.92
exportInternalFunction · 0.85

Calls 4

groupsFunction · 0.85
toSchemaFunction · 0.85
ServesTabletMethod · 0.80
ErrorfMethod · 0.45

Tested by

no test coverage detected