{"id":36443219,"url":"https://github.com/go-amqprpc/amqprpc","last_synced_at":"2026-01-11T22:01:05.075Z","repository":{"id":57602663,"uuid":"78557064","full_name":"go-amqprpc/amqprpc","owner":"go-amqprpc","description":"Package amqprpc provides access to the exported methods of an object across RabbitMQ connection.","archived":false,"fork":false,"pushed_at":"2017-02-20T17:27:09.000Z","size":20,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-06-21T16:26:45.031Z","etag":null,"topics":["amqp","rabbitmq-connection","rpc"],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/go-amqprpc.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}},"created_at":"2017-01-10T17:30:11.000Z","updated_at":"2017-11-24T10:20:45.000Z","dependencies_parsed_at":"2022-09-26T20:01:01.290Z","dependency_job_id":null,"html_url":"https://github.com/go-amqprpc/amqprpc","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/go-amqprpc/amqprpc","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/go-amqprpc%2Famqprpc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/go-amqprpc%2Famqprpc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/go-amqprpc%2Famqprpc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/go-amqprpc%2Famqprpc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/go-amqprpc","download_url":"https://codeload.github.com/go-amqprpc/amqprpc/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/go-amqprpc%2Famqprpc/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28324835,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-11T18:42:50.174Z","status":"ssl_error","status_checked_at":"2026-01-11T18:39:13.842Z","response_time":60,"last_error":"SSL_read: 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","rabbitmq-connection","rpc"],"created_at":"2026-01-11T22:01:04.431Z","updated_at":"2026-01-11T22:01:05.069Z","avatar_url":"https://github.com/go-amqprpc.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# amqprpc\n\nProject `amqprpc` provides access to the exported methods of an object across \nRabbitMQ connection. It is meant as a near drop-in implementation of TCP based\nbuilt-in `net/rpc` package thus most of characteristics and limitations are\nkept intact. The major difference stems from the fact of using messaging \nqueues for transport, one well defined queue for requests and a temporary\nqueue established internally by a client for processing responses. The \nimplementation is intended to follow to certain extent RabbitMQ tutorial \n[Remote procedure call (RPC)](http://www.rabbitmq.com/tutorials/tutorial-six-go.html)\n\n\n## Status\n\n*Beta*\n\n[![Build Status](https://travis-ci.org/go-amqprpc/amqprpc.svg?branch=master)](https://travis-ci.org/go-amqprpc/amqprpc) [![Coverage Status](https://coveralls.io/repos/github/go-amqprpc/amqprpc/badge.svg?branch=master)](https://coveralls.io/github/go-amqprpc/amqprpc?branch=master) [![GoDoc](https://godoc.org/github.com/go-amqprpc/amqprpc?status.svg)](https://godoc.org/github.com/go-amqprpc/amqprpc)\n\n\n## Usage\n\n### Go get\n\n~~~\ngo get -u github.com/go-amqprpc/amqprpc\n~~~\n\n### Import\n\n~~~go\nimport \"github.com/go-amqprpc/amqprpc\"\n~~~\n\n### Examples\n\n\nA simple example of a use-case adopted from [net/rpc](https://golang.org/pkg/net/rpc/)\nwould look as follows using a queue based RPC:\n\nA server wishes to export an object of type Arith:\n\n~~~go\npackage X\n\nimport \"errors\"\n\ntype Args struct {\n\tA, B int\n}\n\ntype Quotient struct {\n\tQuo, Rem int\n}\n\ntype Arith int\n\nfunc (t *Arith) Multiply(args *Args, reply *int) error {\n\t*reply = args.A * args.B\n\treturn nil\n}\n\nfunc (t *Arith) Divide(args *Args, quo *Quotient) error {\n        if args.B == 0 {\n            return errors.New(\"divide by zero\")\n        }\n        quo.Quo = args.A / args.B\n        quo.Rem = args.A % args.B\n        return nil\n}\n~~~\n\nThe server calls for AMQP service:\n\n~~~go\npackage X\n\nimport \"github.com/go-amqprpc/amqprpc\"\n\nconst (\n        RPCQueueName = \"rpc_queue\"\n        AMQPURI = \"amqp://guest:guest@127.0.0.1:5672//\"\n)\n\narith := new(Arith)\nserver, err := amqprpc.NewServer(AMQPURI)\nif err != nil {\n        panic(err)\n}\ndefer server.Close()\n\nserver.Register(RPCQueueName, arith)\nerr = server.Listen()\nif err != nil {\n        panic(err)\n}\n~~~\n\nAt this point, clients can see a service `Arith` with methods `Arith.Multiply` and `Arith.Divide`. \nTo invoke one, a client first dials the server:\n\n~~~go\npackage X\n\nimport \"github.com/go-amqprpc/amqprpc\"\n\nclient, err := amqprpc.NewClient(AMQPURI)\nif err != nil {\n        panic(err)\n}\ndefer client.Close()\n~~~\n\nThen it can make a remote call:\n\n// Synchronous call\n\n~~~go\nargs := \u0026X.Args{7,8}\nvar reply int\nerr = client.Call(RPCQueueName, \"Arith.Multiply\", args, \u0026reply)\nif err != nil {\n        panic(err)\n}\nfmt.Printf(\"Arith: %d*%d=%d\", args.A, args.B, reply)\n~~~\n\nor\n\n// Asynchronous call\n\n~~~go\nquotient := new(X.Quotient)\ndivCall := client.Go(RPCQueueName, \"Arith.Divide\", args, quotient, nil)\nreplyCall := \u003c-divCall.Done\t// will be equal to divCall\n// check errors, print, etc.\n~~~\n\n\n## License\n\nApache License v2 - see LICENSE for more details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgo-amqprpc%2Famqprpc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgo-amqprpc%2Famqprpc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgo-amqprpc%2Famqprpc/lists"}