https://github.com/arirusso/minidisc
Mini service discovery in Ruby
https://github.com/arirusso/minidisc
discovery ruby service-discovery
Last synced: over 1 year ago
JSON representation
Mini service discovery in Ruby
- Host: GitHub
- URL: https://github.com/arirusso/minidisc
- Owner: arirusso
- License: other
- Created: 2017-06-21T21:18:55.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2019-03-02T15:52:40.000Z (over 7 years ago)
- Last Synced: 2025-02-26T06:47:08.314Z (over 1 year ago)
- Topics: discovery, ruby, service-discovery
- Language: Ruby
- Homepage:
- Size: 30.3 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# MiniDisc
Mini service discovery in Ruby
## Description
I recently extracted MiniDisc from a personal project I've been working on. It offers a single line interface for common patterns in service discovery that I'd been redundantly implementing.
Under the hood it wraps the DNSSD gem and is cross compatible with services using that. It adds helpers for common tasks like matching services by name, dynamically overriding discovery, error handling, logging
## Requirements
### Linux
* dns-sd
* avahi 0.6.25+ (plus libavahi-compat-libdnssd-dev on Debian)
## Usage
To broadcast a service use something like:
```ruby
require "minidisc"
MiniDisc::Network.add(:http, 8080, id: "my-service-instance1")
```
To discover other services use
```ruby
MiniDisc::Network.find_all(:http, id: /^my-service/) do |services|
...
end
```
## Installation
`gem install minidisc`
or when Bundler, add this to your Gemfile
`gem "minidisc"`
## License
Apache 2.0, See LICENSE file
Copyright (c) 2017-2019 [Ari Russo](http://arirusso.com)