{"id":27958419,"url":"https://github.com/determinatesystems/detsys-srv","last_synced_at":"2026-03-16T14:03:06.767Z","repository":{"id":275806241,"uuid":"927265041","full_name":"DeterminateSystems/detsys-srv","owner":"DeterminateSystems","description":"Rust client for communicating with services located by DNS SRV records.","archived":false,"fork":false,"pushed_at":"2025-03-19T15:51:06.000Z","size":79,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-19T22:52:13.063Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/DeterminateSystems.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","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":"2025-02-04T17:15:35.000Z","updated_at":"2025-03-19T15:48:59.000Z","dependencies_parsed_at":"2025-02-04T17:49:05.471Z","dependency_job_id":"207b1638-75a9-4e64-9689-52a8555ec6ce","html_url":"https://github.com/DeterminateSystems/detsys-srv","commit_stats":null,"previous_names":["determinatesystems/srv-rs","determinatesystems/detsys-srv"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DeterminateSystems%2Fdetsys-srv","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DeterminateSystems%2Fdetsys-srv/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DeterminateSystems%2Fdetsys-srv/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DeterminateSystems%2Fdetsys-srv/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DeterminateSystems","download_url":"https://codeload.github.com/DeterminateSystems/detsys-srv/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252932300,"owners_count":21827271,"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":[],"created_at":"2025-05-07T18:23:37.199Z","updated_at":"2026-03-16T14:03:01.746Z","avatar_url":"https://github.com/DeterminateSystems.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# detsys-srv\n\n[![Test Status](https://github.com/DeterminateSystems/detsys-srv/workflows/Rust/badge.svg?event=push)](https://github.com/DeterminateSystems/detsys-srv/actions)\n[![Crate](https://img.shields.io/crates/v/detsys-srv.svg)](https://crates.io/crates/detsys-srv)\n\nRust client for communicating with services located by DNS SRV records.\n\n## Introduction\n\nSRV Records, as defined in [RFC 2782](https://tools.ietf.org/html/rfc2782),\nare DNS records of the form\n\n`_Service._Proto.Name TTL Class SRV Priority Weight Port Target`\n\nFor instance, a DNS server might respond with the following SRV records for\n`_http._tcp.example.com`:\n\n```\n_http._tcp.example.com. 60 IN SRV 1 100 443 test1.example.com.\n_http._tcp.example.com. 60 IN SRV 2 50  443 test2.example.com.\n_http._tcp.example.com. 60 IN SRV 2 50  443 test3.example.com.\n```\n\nA client wanting to communicate with this example service would first try to\ncommunicate with `test1.example.com:443` (the record with the lowest\npriority), then with the other two (in a random order, since they are of the\nsame priority) should the first be unavailable.\n\n`detsys-srv` handles the lookup and caching of SRV records as well as the ordered\nselection of targets to use for communication with SRV-located services.\n\n[`SrvClient::new`] creates a client (that should be reused to take advantage of\ncaching) for communicating with the service located by `_http._tcp.example.com`.\n[`SrvClient::execute`] takes in a future-producing closure (emulating async\nclosures, which are currently unstable) and executes the closure on a series of\ntargets parsed from the discovered SRV records, stopping and returning the\nfirst `Ok` or last `Err` it obtains.\n\n## Alternative Resolvers and Target Selection Policies\n\n`detsys-srv` provides multiple resolver backends for SRV lookup and by default uses\na target selection policy that maintains affinity for the last target it has\nused successfully. Both of these behaviors can be changed by implementing the\n[`SrvResolver`] and [`Policy`] traits, respectively.\n\n\n[`SrvResolver`]: resolver::SrvResolver\n[`Policy`]: policy::Policy\n\n\n## Contributing\n\n1. Clone the repo\n2. Make some changes\n3. Test: `cargo test`\n4. Format: `cargo fmt`\n5. Clippy: `cargo clippy --tests -- -Dclippy::all`\n6. If modifying crate-level docs (`src/lib.rs`) or `README.tpl`, update `README.md`:\n    1. `cargo install cargo-readme`\n    2. `cargo readme \u003e README.md`\n\n## History\n\nForked from https://github.com/deshaw/srv-rs/.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeterminatesystems%2Fdetsys-srv","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdeterminatesystems%2Fdetsys-srv","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeterminatesystems%2Fdetsys-srv/lists"}