{"id":23408483,"url":"https://github.com/rdhillbb/messagefile","last_synced_at":"2025-04-09T01:32:47.490Z","repository":{"id":269280146,"uuid":"906939590","full_name":"rdhillbb/messagefile","owner":"rdhillbb","description":"API to get messages from a file for prompts and or error message or general user messages","archived":false,"fork":false,"pushed_at":"2024-12-22T11:32:44.000Z","size":2,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-14T19:51:48.078Z","etag":null,"topics":["golang","messagefile","prompts","prompts-template"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rdhillbb.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2024-12-22T11:17:16.000Z","updated_at":"2024-12-22T11:35:29.000Z","dependencies_parsed_at":"2024-12-22T12:24:31.499Z","dependency_job_id":"bbb3353c-31b7-4b15-8376-dc1723ba8141","html_url":"https://github.com/rdhillbb/messagefile","commit_stats":null,"previous_names":["rdhillbb/messagefile"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rdhillbb%2Fmessagefile","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rdhillbb%2Fmessagefile/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rdhillbb%2Fmessagefile/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rdhillbb%2Fmessagefile/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rdhillbb","download_url":"https://codeload.github.com/rdhillbb/messagefile/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247956699,"owners_count":21024590,"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","messagefile","prompts","prompts-template"],"created_at":"2024-12-22T15:15:08.749Z","updated_at":"2025-04-09T01:32:47.458Z","avatar_url":"https://github.com/rdhillbb.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Message File Parser\n\nA simple Go package for parsing structured XML message files and retrieving messages using a section:message key format.\n\n## Installation\n\n```bash\ngo get github.com/rdhillbb/messagefile\n```\n\n## Usage\n\nThe package provides a simple API to retrieve messages from an XML message file. The message file should be named `messagefile.xml` and be in the following format:\n\n```xml\n\u003c?xml version=\"1.0\" encoding=\"UTF-8\"?\u003e\n\u003cmessages\u003e\n    \u003csection_name\u003e\n        \u003cmessage_type\u003e\n            Message content goes here\n        \u003c/message_type\u003e\n    \u003c/section_name\u003e\n\u003c/messages\u003e\n```\n\n### API Reference\n\n#### GetMSG(messageKey string) (string, error)\n\nRetrieves a message using a colon-separated section and message type key.\n\n- `messageKey`: Format is \"section:message\"\n- Returns: The message content and any error encountered\n\n### Example\n\n```go\npackage main\n\nimport (\n    \"fmt\"\n    \"github.com/yourusername/messagefile\"\n)\n\nfunc main() {\n    // Retrieve a message\n    msg, err := messagefile.GetMSG(\"utilmessages:query_rewrite\")\n    if err != nil {\n        fmt.Printf(\"Error: %v\\n\", err)\n        return\n    }\n    \n    fmt.Printf(\"Message: %s\\n\", msg)\n}\n```\n\n### Message File Example\n\n```xml\n\u003c?xml version=\"1.0\" encoding=\"UTF-8\"?\u003e\n\u003cmessages\u003e\n    \u003cutilmessages\u003e\n        \u003cquery_rewrite\u003e\n            You are tasked with enhancing a user's query.\n            Here is the user's original query:\n            \u003cuser_query\u003e\n            %s\n            \u003c/user_query\u003e\n        \u003c/query_rewrite\u003e\n    \u003c/utilmessages\u003e\n\u003c/messages\u003e\n```\n\n## Error Handling\n\nThe package returns errors for:\n- Invalid message key format\n- Missing message file\n- Invalid XML structure\n- Section not found\n- Message not found\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frdhillbb%2Fmessagefile","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frdhillbb%2Fmessagefile","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frdhillbb%2Fmessagefile/lists"}