MCPcopy Create free account
hub / github.com/devaccuracy/ledgerforge / updateEntityMetadata

Method updateEntityMetadata

metadata.go:208–225  ·  view source on GitHub ↗

updateEntityMetadata updates the metadata for a specific entity. It routes the update operation to the appropriate datasource method based on the entity type. Parameters: - ctx: The context for the operation. - entityType: The type of entity being updated. - entityID: The ID of the entity being upd

(ctx context.Context, entityType, entityID string, metadata map[string]interface{})

Source from the content-addressed store, hash-verified

206// Returns:
207// - error: An error if the update operation fails.
208func (l *LedgerForge) updateEntityMetadata(ctx context.Context, entityType, entityID string, metadata map[string]interface{}) error {
209 switch entityType {
210 case "ledgers":
211 return l.datasource.UpdateLedgerMetadata(entityID, metadata)
212
213 case "transactions":
214 return l.datasource.UpdateTransactionMetadata(ctx, entityID, metadata)
215
216 case "balances":
217 return l.datasource.UpdateBalanceMetadata(ctx, entityID, metadata)
218
219 case "identities":
220 return l.datasource.UpdateIdentityMetadata(entityID, metadata)
221
222 default:
223 return fmt.Errorf("unsupported entity type: %s", entityType)
224 }
225}

Callers 2

UpdateMetadataMethod · 0.95

Calls 4

UpdateLedgerMetadataMethod · 0.65
UpdateBalanceMetadataMethod · 0.65

Tested by

no test coverage detected