{"id":37157762,"url":"https://github.com/devimteam/observer","last_synced_at":"2026-01-14T18:49:55.035Z","repository":{"id":57516461,"uuid":"95896137","full_name":"devimteam/observer","owner":"devimteam","description":"Golang pub/sub observer","archived":false,"fork":false,"pushed_at":"2018-03-23T15:35:29.000Z","size":37,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-08-09T21:37:47.719Z","etag":null,"topics":["amqp","golang","golang-library"],"latest_commit_sha":null,"homepage":null,"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/devimteam.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}},"created_at":"2017-06-30T14:29:06.000Z","updated_at":"2018-03-23T15:35:15.000Z","dependencies_parsed_at":"2022-09-26T18:00:49.760Z","dependency_job_id":null,"html_url":"https://github.com/devimteam/observer","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"purl":"pkg:github/devimteam/observer","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devimteam%2Fobserver","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devimteam%2Fobserver/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devimteam%2Fobserver/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devimteam%2Fobserver/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/devimteam","download_url":"https://codeload.github.com/devimteam/observer/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devimteam%2Fobserver/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28430932,"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":["amqp","golang","golang-library"],"created_at":"2026-01-14T18:49:54.408Z","updated_at":"2026-01-14T18:49:55.021Z","avatar_url":"https://github.com/devimteam.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"RMQ Observer For Pub/Sub Event\n============================\n\nSubscribe event - Sub(service string, reply interface{}) (OutCh, error)\n\nPublish event - Pub(service string, data interface{}) error\n\n## Examples\n\n## Sub\n\n``` go\npackage main\n\nimport (\n    \"log\"\n    \n    \"github.com/streadway/amqp\"\n    \"github.com/l-vitaly/observer\"\n    \"github.com/l-vitaly/observer/json\"\n)\n\ntype CreateUserEvent struct {\n  ID   int    `json:\"id\"`\n  Name string `json:\"name\"`\n}\n\nfunc main() {\n    conn, err := amqp.Dial(\"amqp://rmqhost/\")\n    if err != nil {\n        panic(err)\n    }\n\tch, err := conn.Channel()\n\tif err != nil {\n\t    panic(err)\n\t}\n\tobserv := observer.New(ch, json.NewCodec())\n    chOut, err := observ.Sub(\"serviceName\", \u0026CreateUserEvent{})\n    if err != nil {\n   \t    panic(err)\n   \t}\n    for e := range chOut {\n        log.Printf(\"ID: %d, User name: %s\", e.Data.(*CreateUserEvent).ID, e.Data.(*CreateUserEvent).Name)         \n    }   \n}\n```\n\n## Pub\n\n``` go\npackage main\n\nimport (\n    \"log\"\n    \n    \"github.com/streadway/amqp\"\n    \"github.com/l-vitaly/observer\"\n    \"github.com/l-vitaly/observer/json\"\n)\n\ntype CreateUserEvent struct {\n  ID   int    `json:\"id\"`\n  Name string `json:\"name\"`\n}\n\nfunc main() {\n    conn, err := amqp.Dial(\"amqp://rmqhost/\")\n    if err != nil {\n        panic(err)\n    }\n\tch, err := conn.Channel()\n\tif err != nil {\n\t    panic(err)\n\t}\n\tobserv := observer.New(ch, json.NewCodec())\n\terr = observ.Pub(\"serviceName\", \u0026CreateUserEvent{ID: 1, Name: \"Hello World\"})\n\tif err != nil {\n        panic(err)\n    }\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevimteam%2Fobserver","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdevimteam%2Fobserver","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevimteam%2Fobserver/lists"}