// Add adds an anchor to the anchor graph.
// Returns hl that contains anchor information.
Add adds an anchor to the anchor graph.
Returns hl that contains anchor information.
// Add adds an anchor to the anchor graph . // Returns hl that contains anchor information .
func (g *Graph) Add(anchorEvent *vocab.AnchorEventType) (string, error) { 
	canonicalBytes, err := canonicalizer.MarshalCanonical(anchorEvent)
	if err != nil {
		return "", fmt.Errorf("failed to marshal anchor event: %w", err)
	}
	hl, err := g.CasWriter.Write(canonicalBytes)
	if err != nil {
		return "", errors.NewTransient(fmt.Errorf("failed to add anchor to graph: %w", err))
	}
	logger.Debugf("added anchor event[%s]: %s", hl, string(canonicalBytes))
	return hl, nil
}
func ( g * Graph ) Add ( anchorEvent * vocab . AnchorEventType ) ( string , error ) { canonicalBytes , err := canonicalizer . MarshalCanonical ( anchorEvent ) if err != nil { return " " , fmt . Errorf ( " " , err ) } hl , err := g . CasWriter . Write ( canonicalBytes ) if err != nil { return " " , errors . NewTransient ( fmt . Errorf ( " " , err ) ) } logger . Debugf ( " " , hl , string ( canonicalBytes ) ) return hl , nil }
Add adds an anchor to the anchor graph.
Add adds an anchor to the anchor graph .
//nolint:interfacer