{"id":37150002,"url":"https://github.com/financial-times/neo-utils-go","last_synced_at":"2026-01-14T17:43:06.958Z","repository":{"id":48444102,"uuid":"49427723","full_name":"Financial-Times/neo-utils-go","owner":"Financial-Times","description":"Neo4j Utils in Go","archived":true,"fork":false,"pushed_at":"2021-08-10T08:32:36.000Z","size":80,"stargazers_count":2,"open_issues_count":1,"forks_count":1,"subscribers_count":23,"default_branch":"master","last_synced_at":"2025-08-15T06:21:58.687Z","etag":null,"topics":["universal-publishing"],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Financial-Times.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null}},"created_at":"2016-01-11T13:20:38.000Z","updated_at":"2023-01-28T04:34:19.000Z","dependencies_parsed_at":"2022-07-29T01:18:21.735Z","dependency_job_id":null,"html_url":"https://github.com/Financial-Times/neo-utils-go","commit_stats":null,"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"purl":"pkg:github/Financial-Times/neo-utils-go","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Financial-Times%2Fneo-utils-go","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Financial-Times%2Fneo-utils-go/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Financial-Times%2Fneo-utils-go/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Financial-Times%2Fneo-utils-go/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Financial-Times","download_url":"https://codeload.github.com/Financial-Times/neo-utils-go/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Financial-Times%2Fneo-utils-go/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28428926,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T16:38:47.836Z","status":"ssl_error","status_checked_at":"2026-01-14T16:34:59.695Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["universal-publishing"],"created_at":"2026-01-14T17:43:06.309Z","updated_at":"2026-01-14T17:43:06.951Z","avatar_url":"https://github.com/Financial-Times.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# neo-utils-go\n\n[![CircleCI](https://circleci.com/gh/Financial-Times/neo-utils-go.svg?style=svg)](https://circleci.com/gh/Financial-Times/neo-utils-go)\n\nNeo4j Utils in Go.\n\nProvides a wrapper for neoism.Database to output the database URL in the String() method.\n\nProvides an EnsureIndexes function that will take a map of label/property pairs,\nand an IndexManager (normally this will be a neoism.Database) and checks whether these\nindexes exist. If not, they are created.\n\n## Batch Cypher Runner\nCurrently supports batch running of queries.\n\n1. Import \"github.com/Financial-Times/neo-cypher-runner-go\"\n\n2. Create a batch cypher runner like this:\n\n    cypherRunner := neocypherrunner.NewBatchCypherRunner(db, maxBatchSize)\n\n3. Execute a batch of queries like this:\n\n    cypherRunner.CypherBatch([]*neoism.CypherQuery{query})\n\n### Logging\nTo use neo-utils-go in a service, follow these steps:\n1. Migrate the service to Go modules and then to go-logger v2\n2. Update the neo-utils-go version to v2.\n3. Initialize the logger and add the instance to the function parameters in any of the neo-utils-go functions that requires it. \nThe logger initialization will vary depending on the service logs.\n// Non-JSON\nl := logger.NewUnstructuredLogger()\n// JSON, no \"@time\" key\nl := logger.NewUPPLogger(*serviceName, \"INFO\")\n// JSON + @time\nlogConf := logger.KeyNamesConfig{KeyTime: \"@time\"}\nl := logger.NewUPPLogger(*serviceName, \"INFO\", logConf)\nThe logger is an optional parameter. If it is not provided by the user, the library will create a logger with an INFO logging level.\n\n### Metrics\nThere are three metrics that this library will capture, using go-metrics:\n\n - batchQueueSize: a gauge which keeps track of the number of queued requests, i.e. waiting to be written to Neo4j\n - batchThroughput: a meter keeping track of queries processed, with throughput over several time periods\n - execute-neo4j-batch: a timer measuring how long each batch or queries takes to run against neo4j\n\nTo use the metrics, set up metrics in your application, for example to output to graphite.ft.com:\n\n    addr, _ := net.ResolveTCPAddr(\"tcp\", graphiteTCPAddress)\n\t\tgo graphite.Graphite(metrics.DefaultRegistry, 1*time.Minute, graphitePrefix, addr)\n\nwhere, for example:\n\n - graphiteTCPAddress is for graphite.ft.com:2003\n - and graphitePrefix is unique for your service, e.g. content.[env].people.rw.neo4j.[hostname] - you should probably set this from environment-specific configuration, e.g. hiera data\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffinancial-times%2Fneo-utils-go","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffinancial-times%2Fneo-utils-go","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffinancial-times%2Fneo-utils-go/lists"}