{"id":41426796,"url":"https://github.com/jjeffery/kv","last_synced_at":"2026-01-23T14:17:34.249Z","repository":{"id":57482950,"uuid":"67745527","full_name":"jjeffery/kv","owner":"jjeffery","description":"Package kv provides support for collections of key/value pairs.","archived":false,"fork":false,"pushed_at":"2019-11-08T00:13:31.000Z","size":120,"stargazers_count":7,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-08-13T19:06:52.449Z","etag":null,"topics":["golang","key-value","keyval","structured-logging"],"latest_commit_sha":null,"homepage":"https://godoc.org/github.com/jjeffery/kv","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/jjeffery.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-09-08T22:43:26.000Z","updated_at":"2024-09-03T21:09:30.000Z","dependencies_parsed_at":"2022-08-27T20:02:40.101Z","dependency_job_id":null,"html_url":"https://github.com/jjeffery/kv","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/jjeffery/kv","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jjeffery%2Fkv","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jjeffery%2Fkv/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jjeffery%2Fkv/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jjeffery%2Fkv/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jjeffery","download_url":"https://codeload.github.com/jjeffery/kv/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jjeffery%2Fkv/sbom","scorecard":{"id":522065,"data":{"date":"2025-08-11","repo":{"name":"github.com/jjeffery/kv","commit":"72e2ddb3b728be1a0878a6b6f58e529489a02a0b"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.9,"checks":[{"name":"Code-Review","score":0,"reason":"Found 0/30 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE.md:0","Info: FSF or OSI recognized license: MIT License: LICENSE.md:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Vulnerabilities","score":9,"reason":"1 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GO-2022-0493 / GHSA-p782-xgp4-8hr8"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-20T03:17:33.063Z","repository_id":57482950,"created_at":"2025-08-20T03:17:33.063Z","updated_at":"2025-08-20T03:17:33.063Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28693789,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-23T14:15:13.573Z","status":"ssl_error","status_checked_at":"2026-01-23T14:09:05.534Z","response_time":59,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6: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":["golang","key-value","keyval","structured-logging"],"created_at":"2026-01-23T14:17:33.536Z","updated_at":"2026-01-23T14:17:34.243Z","avatar_url":"https://github.com/jjeffery.png","language":"Go","readme":"# kv [![GoDoc](https://godoc.org/github.com/jjeffery/kv?status.svg)](https://godoc.org/github.com/jjeffery/kv) [![License](http://img.shields.io/badge/license-MIT-green.svg?style=flat)](https://raw.githubusercontent.com/jjeffery/kv/master/LICENSE.md) [![Build Status](https://travis-ci.org/jjeffery/kv.svg?branch=master)](https://travis-ci.org/jjeffery/kv) [![Coverage Status](https://coveralls.io/repos/github/jjeffery/kv/badge.svg?branch=master)](https://coveralls.io/github/jjeffery/kv?branch=master) [![GoReportCard](https://goreportcard.com/badge/github.com/jjeffery/kv)](https://goreportcard.com/report/github.com/jjeffery/kv) [![Release](https://img.shields.io/github/release/jjeffery/kv.svg)](https://github.com/jjeffery/kv/releases/latest)\n\nPackage kv provides support for working with collections of key/value pairs.\n\n- [Lists](#lists)\n- [Errors](#errors)\n- [Context](#context)\n- [Parse](#parse)\n- [Logging](#logging)\n\n## Lists\n\nThe `List` type represents a sequence of alternating key/value pairs. Lists\ncan render themselves as text in [logfmt](https://brandur.org/logfmt) format, \nso if you like logging messages with key value pairs but are not ready to move \naway from the standard library log package you can use something like:\n```go\nlog.Println(\"this is a log message\", kv.With(\n    \"key1\", \"value 1\",\n    \"key2\", 2,\n))\n\n// Output:\n// this is a log message key1=\"value 1\" key2=2\n```\n\nThe output from the previous example can be easily read by humans, and easily [parsed](#parse)\nby machines. This makes it an excellent format for \n[structured logging](https://www.thoughtworks.com/radar/techniques/structured-logging).\n\n## Errors\n\nThe `Error` type implements the builtin `error` interface and renders its error message as a\nfree text message followed by key/value pairs:\n```\ncannot open file: permission denied file=\"/etc/passwd\" user=alice\n```\n\nErrors are constructed with message text and key/value pairs.\n```go\n// create an error\nerr := kv.NewError(\"permission denied\").With(\"user\", user)\nlog.Println(err)\n\n// Output:\n// permission denied user=alice\n```\n\nErrors can wrap other errors:\n```go\nerr = kv.Wrap(err, \"cannot open file\").With(\"file\", filename)\nlog.Println(err)\n\n// Output:\n// cannot open file: permission denied file=\"/etc/passwd\" user=alice\n```\n\n## Context\n\nKey/value pairs can be stored in the context:\n```go\nctx := context.Background()\n\n// associate some key/value pairs with the context\nctx = kv.From(ctx).With(\"url\", \"/api/widgets\", \"method\", \"get\")\n\n// ... later on ...\n\nlog.Println(\"access denied\", kv.From(ctx).With(\"file\", filename))\n\n// Output:\n// access denied file=\"/etc/passwd\" url=\"/api/widgets\" method=get\n```\n\n## Parse\n\nOne of the key points of structured logging is that logs are machine\nreadable. The `Parse` function provides an easy way to read messages.\n```go\n// read one line\nline := []byte(`cannot open file: access denied file=\"/etc/passwd\" user=alice`)\n\n text, list := kv.Parse(line)\n log.Println(\"text:\", string(text))\n log.Println(\"list:\", list)\n\n// Output:\n// text: cannot open file: access denied\n// list: file=\"/etc/passwd\" user=alice\n```\n\n## Logging\n\nThe `kvlog` subdirectory contains a package that works well with the `log` package\nin the Go standard library. Its usage is as simple as:\n```go\nfunc main() {\n    kvlog.Attach() // attach to the standard logger\n    log.Println(\"program started\", kv.With(\"args\", os.Args))\n}\n```\n\nSee the [GoDoc](https://godoc.org/github.com/jjeffery/kv) for more details.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjjeffery%2Fkv","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjjeffery%2Fkv","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjjeffery%2Fkv/lists"}