{"id":18920062,"url":"https://github.com/gongo/text-parameters","last_synced_at":"2025-08-02T05:41:48.061Z","repository":{"id":19702132,"uuid":"22957138","full_name":"gongo/text-parameters","owner":"gongo","description":"Encoding and decoding of text/parameters written by Go","archived":false,"fork":false,"pushed_at":"2014-09-18T13:03:06.000Z","size":184,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-12-31T16:32:40.766Z","etag":null,"topics":[],"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/gongo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-08-14T14:41:04.000Z","updated_at":"2014-09-18T13:03:06.000Z","dependencies_parsed_at":"2022-09-17T22:21:47.843Z","dependency_job_id":null,"html_url":"https://github.com/gongo/text-parameters","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gongo%2Ftext-parameters","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gongo%2Ftext-parameters/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gongo%2Ftext-parameters/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gongo%2Ftext-parameters/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gongo","download_url":"https://codeload.github.com/gongo/text-parameters/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239914937,"owners_count":19717760,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":[],"created_at":"2024-11-08T10:42:20.164Z","updated_at":"2025-02-20T21:18:38.252Z","avatar_url":"https://github.com/gongo.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"go-text-parameters\n==================\n\n[![GoDoc](http://godoc.org/github.com/gongo/text-parameters?status.svg)](http://godoc.org/github.com/gongo/text-parameters)\n[![Build Status](https://travis-ci.org/gongo/text-parameters.svg)](https://travis-ci.org/gongo/text-parameters)\n[![Coverage Status](https://coveralls.io/repos/gongo/text-parameters/badge.png)](https://coveralls.io/r/gongo/text-parameters)\n\nEncoding and decoding of text/parameters written by Go\n\n## Description\n\n**text/parameters** is consists of either a list of parameters or a list of parameters and associated values.\nEach entry of the list is a single line of text, and parameters are separated from values by a colon.\n\nThis package provides a read and write function of `text/parameters` format text from your Go programs.\n\n### Spec\n\n- [RFC 2326 - Real Time Streaming Protocol (RTSP)](http://tools.ietf.org/html/rfc2326)\n- [draft-ietf-mmusic-rfc2326bis-40 - Real Time Streaming Protocol 2.0 (RTSP)](http://tools.ietf.org/html/draft-ietf-mmusic-rfc2326bis-40#page-297)\n\n## Usage\n\n### Decoder\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\n\t\"github.com/gongo/text-parameters\"\n)\n\nfunc main() {\n\tbody := \"Name: Wataru MIYAGUNI\\nlogin: gongo\\nAge: 30\\n\"\n\n\tu := struct {\n\t\tName    string\n\t\tLoginId string `parameters:\"login\"`\n\t\tAge     int\n\t}{}\n\n\tdecoder := parameters.NewDecorder(strings.NewReader(body))\n\tdecoder.Decode(\u0026u)\n\n\tfmt.Println(\"u.Name    =\", u.Name)\n\tfmt.Println(\"u.LoginId =\", u.LoginId)\n\tfmt.Println(\"u.Age     =\", u.Age)\n}\n```\n\nOutput:\n\n```\nu.Name    = Wataru MIYAGUNI\nu.LoginId = gongo\nu.Age     = 30\n```\n\n### Encoder\n\n```go\npackage main\n\nimport (\n\t\"bytes\"\n\t\"fmt\"\n\n\t\"github.com/gongo/text-parameters\"\n)\n\nfunc main() {\n\tvar body bytes.Buffer\n\n\tu := struct {\n\t\tName    string\n\t\tLoginId string `parameters:\"login_id\"`\n\t\tRate    float64\n\t}{\n\t\tName:    \"Wataru MIYAGUNI\",\n\t\tLoginId: \"gongo\",\n\t\tRate:    0.923,\n\t}\n\n\tencoder := parameters.NewEncoder(\u0026body)\n\tencoder.Encode(\u0026u)\n\n\tfmt.Println(body.String())\n}\n```\n\nOutput:\n\n```\nName: Wataru MIYAGUNI\nRate: 0.923\nlogin_id: gongo\n```\n\n## Install\n\n```\n$ go get github.com/gongo/text-parameters\n```\n\n## LICENSE\n\n[MIT License](./LICENSE.txt)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgongo%2Ftext-parameters","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgongo%2Ftext-parameters","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgongo%2Ftext-parameters/lists"}