(attr string, val []byte, skipZero bool)
| 944 | } |
| 945 | |
| 946 | func 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 | |
| 961 | func TypeExportKv(attr string, val []byte) (*bpb.KV, error) { |
| 962 | var update pb.TypeUpdate |
no test coverage detected