// AddReference adds the reference of the given type to the given object.
AddReference adds the reference of the given type to the given object.
// AddReference adds the reference of the given type to the given object .
func (s *Provider) AddReference(referenceType spi.ReferenceType, objectIRI *url.URL, referenceIRI *url.URL,
	refMetaDataOpts ...spi.RefMetadataOpt) error {
	logger.Debugf("[%s] Adding reference of type %s to object %s: %s",
		s.serviceName, referenceType, objectIRI, referenceIRI)
	valueBytes, err := json.Marshal(referenceIRI.String())
	if err != nil {
		return fmt.Errorf("marshal: %w", err)
	}
	tags := determineTags(referenceType, objectIRI, refMetaDataOpts)
	err = s.referenceStore.Put(getRefKey(referenceType, objectIRI, referenceIRI), valueBytes, tags...)
	if err != nil {
		return orberrors.NewTransient(fmt.Errorf("failed to store reference: %w", err))
	}
	return nil
}
func ( s * Provider ) AddReference ( referenceType spi . ReferenceType , objectIRI * url . URL , referenceIRI * url . URL , refMetaDataOpts ... spi . RefMetadataOpt ) error { logger . Debugf ( " " , s . serviceName , referenceType , objectIRI , referenceIRI ) valueBytes , err := json . Marshal ( referenceIRI . String ( ) ) if err != nil { return fmt . Errorf ( " " , err ) } tags := determineTags ( referenceType , objectIRI , refMetaDataOpts ) err = s . referenceStore . Put ( getRefKey ( referenceType , objectIRI , referenceIRI ) , valueBytes , tags ... ) if err != nil { return orberrors . NewTransient ( fmt . Errorf ( " " , err ) ) } return nil }
AddReference adds the reference of the given type to the given object.
AddReference adds the reference of the given type to the given object .