{"id":21972816,"url":"https://github.com/agustinsrg/go-simple-rpc-message","last_synced_at":"2025-10-22T21:42:05.102Z","repository":{"id":137361740,"uuid":"612143512","full_name":"AgustinSRG/go-simple-rpc-message","owner":"AgustinSRG","description":"Golang library that implements a very simple RPC message system to be used in a text-based communication system.","archived":false,"fork":false,"pushed_at":"2023-07-15T12:05:39.000Z","size":9,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-28T02:44:09.534Z","etag":null,"topics":["golang","library","protocol","rpc"],"latest_commit_sha":null,"homepage":"https://pkg.go.dev/github.com/AgustinSRG/go-simple-rpc-message","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/AgustinSRG.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":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-03-10T09:42:53.000Z","updated_at":"2023-10-26T19:45:18.000Z","dependencies_parsed_at":null,"dependency_job_id":"2c106bac-3cbf-4d76-bf0a-de4859e35329","html_url":"https://github.com/AgustinSRG/go-simple-rpc-message","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AgustinSRG%2Fgo-simple-rpc-message","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AgustinSRG%2Fgo-simple-rpc-message/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AgustinSRG%2Fgo-simple-rpc-message/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AgustinSRG%2Fgo-simple-rpc-message/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AgustinSRG","download_url":"https://codeload.github.com/AgustinSRG/go-simple-rpc-message/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245031516,"owners_count":20549926,"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":["golang","library","protocol","rpc"],"created_at":"2024-11-29T15:21:27.012Z","updated_at":"2025-10-22T21:42:04.986Z","avatar_url":"https://github.com/AgustinSRG.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Simple RPC message\n\nThis library implements a very simple RPC message system to be used in a text-based communication system.\n\n[Documentation](https://pkg.go.dev/github.com/AgustinSRG/go-simple-rpc-message)\n\n## Message format\n\nThe messages are UTF-8 encoded strings, with parts split by line breaks (\\n):\n \n  - The first line is the message type (upper case string)\n  - After it, the message can have an arbitrary number of parameters. Each parameter has a name, followed by a colon and it's value. Parameter names are case-insensitive.\n  - Optionally, after the arguments, it can be an empty line, followed by the body of the message (an arbitrary string).\n\n```\nMESSAGE-TYPE\nRequest-ID: request-id\nAuth: auth-token\nArgument: value\n\n{body}\n```\n\n## Usage\n\nYou can use the structure `RPCMessage` to create RPC messages. Use the `Serialize` method to serialize them to string, in order to send them.\n\nYou can parse a received RPC message with `ParseRPCMessage`.\n\nAfter the message is parsed, you can access the structure properties: `Method`, `Params` and `Body`.\n\nIn order to get a parameter, since names are case-insensitive, you can use the `GetParam` method.\n\n```go\npackage main\n\nimport (\n  \"fmt\"\n\n\t// Import the module\n\tsimple_rpc_message \"github.com/AgustinSRG/go-simple-rpc-message\"\n)\n\nfunc main() {\n  message := simple_rpc_message.RPCMessage{\n    Method: \"TEST\",\n    Params: map[string]string{\n      \"Test-Param\":   \"Test-Value\",\n      \"Test-Param-2\": \"Test-Value-2\",\n    },\n    Body: \"Test Body\\nTest second line\\nThird line\",\n  }\n\n  // Serialize the message to string\n  serialized := message.Serialize()\n\n  // Parse serialized message\n  recovered := simple_rpc_message.ParseRPCMessage(serialized)\n\n  fmt.Println(\"Method: \" + recovered.Method);\n  fmt.Println(\"Params[Test-Param]: \" + recovered.GetParam(\"test-param\"));\n  fmt.Println(\"Params[Test-Param-2]: \" + recovered.GetParam(\"Test-Param-2\"));\n  fmt.Println(\"Body: \" + recovered.Body);\n}\n```\n\n## Compilation\n\nIn order to install dependencies, type:\n\n```\ngo get .\n```\n\nTo compile the code type:\n\n```\ngo build\n```\n\nTo order to run the tests, type: \n\n```\ngo test\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fagustinsrg%2Fgo-simple-rpc-message","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fagustinsrg%2Fgo-simple-rpc-message","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fagustinsrg%2Fgo-simple-rpc-message/lists"}