{"id":16196280,"url":"https://github.com/nryanov/consul4s","last_synced_at":"2025-07-05T07:05:14.714Z","repository":{"id":39972020,"uuid":"262148205","full_name":"nryanov/consul4s","owner":"nryanov","description":"A native Scala client for interacting with Consul built on top of sttp-client.","archived":false,"fork":false,"pushed_at":"2025-03-13T20:39:47.000Z","size":655,"stargazers_count":7,"open_issues_count":10,"forks_count":4,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-13T21:34:46.662Z","etag":null,"topics":["client","consul","consul-api","scala","sttp"],"latest_commit_sha":null,"homepage":"","language":"Scala","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/nryanov.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-05-07T20:09:41.000Z","updated_at":"2025-03-13T20:39:51.000Z","dependencies_parsed_at":"2023-02-15T12:30:48.691Z","dependency_job_id":"0e325a1c-c96c-4a4a-9bd2-4bb6391b044b","html_url":"https://github.com/nryanov/consul4s","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nryanov%2Fconsul4s","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nryanov%2Fconsul4s/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nryanov%2Fconsul4s/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nryanov%2Fconsul4s/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nryanov","download_url":"https://codeload.github.com/nryanov/consul4s/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243971156,"owners_count":20376784,"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":["client","consul","consul-api","scala","sttp"],"created_at":"2024-10-10T08:47:06.695Z","updated_at":"2025-03-19T05:30:24.074Z","avatar_url":"https://github.com/nryanov.png","language":"Scala","funding_links":[],"categories":[],"sub_categories":[],"readme":"# consul4s\n\n[![GitHub license](https://img.shields.io/github/license/nryanov/consul4s)](https://github.com/nryanov/consul4s/blob/master/LICENSE.txt)\n[![Maven Central](https://maven-badges.herokuapp.com/maven-central/com.nryanov.consul4s/consul4s-core_2.13/badge.svg)](https://maven-badges.herokuapp.com/maven-central/com.nryanov.consul4s/consul4s-core_2.13)\n \nA native Scala client for interacting with Consul built on top of [sttp-client](https://github.com/softwaremill/sttp). \n\n## Features\nCurrently `consul4s` supports these endpoints:\n- agent\n- catalog\n- coordinate\n- event\n- health\n- kv\n- prepared queries (only existing query execution)\n- session\n- status\n- transaction\n\n## Modules\nConsul4s uses multi-project structure and contains of the following modules_:\n\n* [`consul4s-core`](modules/core) - core classes/functions\n* [`consul4s-circe`](modules/circe) - circe integration\n* [`consul4s-json4s`](modules/json4s) - json4s integration\n* [`consul4s-spray-json`](modules/spray-json) - spray-json integration\n\n## Installation\nconsul4s is published for Scala 2.13 and 2.12 to Maven Central, so just add the following to your build.sbt:\n\n```sbt\nlibraryDependencies ++= Seq(\n  \"com.nryanov.consul4s\" %% \"consul4s-core\" % \"[version]\",\n  // And one of the following:\n  \"com.nryanov.consul4s\" %% \"consul4s-circe\" % \"[version]\",\n  \"com.nryanov.consul4s\" %% \"consul4s-json4s\" % \"[version]\",\n  \"com.nryanov.consul4s\" %% \"consul4s-spray-json\" % \"[version]\",\n)\n```\n\nAlso you can add any sttp-client backend you want. \n\n## Getting Started\nWithout any additional dependencies you can use the default `HttpURLConnectionBackend` as backend for requests. But sttp also supports other backend implementations:\n\u003e STTP: Backend implementations include ones based on [akka-http](https://doc.akka.io/docs/akka-http/current/scala/http/), [async-http-client](https://github.com/AsyncHttpClient/async-http-client), [http4s](https://http4s.org), [OkHttp](http://square.github.io/okhttp/), and HTTP clients which ship with Java. They integrate with [Akka](https://akka.io), [Monix](https://monix.io), [fs2](https://github.com/functional-streams-for-scala/fs2), [cats-effect](https://github.com/typelevel/cats-effect), [scalaz](https://github.com/scalaz/scalaz) and [ZIO](https://github.com/zio/zio).\n\n```scala\nimport consul4s.v1._\nimport consul4s.circe._\nimport sttp.client.HttpURLConnectionBackend\n\nobject Main {\n def main(args: Array[String]): Unit = {\n    val backend = HttpURLConnectionBackend()\n    val client = ConsulClient(backend) // will use default host and port: http://localhost:8500\n\n    for {\n      datacenters \u003c- client.getDatacenters().body\n    } yield datacenters\n  }\n}\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnryanov%2Fconsul4s","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnryanov%2Fconsul4s","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnryanov%2Fconsul4s/lists"}