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

Function toBinary

types/conversion.go:715–721  ·  view source on GitHub ↗
(id TypeID, b interface{})

Source from the content-addressed store, hash-verified

713}
714
715func toBinary(id TypeID, b interface{}) ([]byte, error) {
716 p1 := ValueForType(BinaryID)
717 if err := Marshal(Val{id, b}, &p1); err != nil {
718 return nil, err
719 }
720 return p1.Value.([]byte), nil
721}
722
723func cantConvert(from TypeID, to TypeID) error {
724 return errors.Errorf("Cannot convert %s to type %s", from.Name(), to.Name())

Callers 1

ObjectValueFunction · 0.85

Calls 2

ValueForTypeFunction · 0.85
MarshalFunction · 0.85

Tested by

no test coverage detected