{"id":13786749,"url":"https://github.com/dnnrly/wait-for","last_synced_at":"2026-01-24T16:20:07.690Z","repository":{"id":39915339,"uuid":"470947829","full_name":"dnnrly/wait-for","owner":"dnnrly","description":"Super simple tool to help with orchestration of commands on the CLI by waiting on networking resources.","archived":false,"fork":false,"pushed_at":"2023-02-02T23:37:35.000Z","size":111,"stargazers_count":17,"open_issues_count":1,"forks_count":3,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-05-11T22:40:36.484Z","etag":null,"topics":["go"],"latest_commit_sha":null,"homepage":"","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/dnnrly.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":"2022-03-17T10:33:01.000Z","updated_at":"2024-11-06T11:55:31.000Z","dependencies_parsed_at":"2023-02-18T01:25:15.753Z","dependency_job_id":null,"html_url":"https://github.com/dnnrly/wait-for","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/dnnrly/wait-for","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dnnrly%2Fwait-for","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dnnrly%2Fwait-for/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dnnrly%2Fwait-for/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dnnrly%2Fwait-for/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dnnrly","download_url":"https://codeload.github.com/dnnrly/wait-for/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dnnrly%2Fwait-for/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28731224,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-24T10:24:43.181Z","status":"ssl_error","status_checked_at":"2026-01-24T10:24:36.112Z","response_time":89,"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":["go"],"created_at":"2024-08-03T19:01:33.095Z","updated_at":"2026-01-24T16:20:07.646Z","avatar_url":"https://github.com/dnnrly.png","language":"Go","funding_links":[],"categories":["Software Packages","软件包","Go Tools"],"sub_categories":["DevOps Tools","DevOps 工具"],"readme":"# `wait-for`\n\nThis is a CLI tool that waits for an event before continuing. Simples. But it does it\ncross platform and as a single dependency that can be downloaded into your container\nor environment.\n\nTypically, you would use this to wait on another resource (such as an HTTP resource)\nto become available before continuing - or timeout and exit with an error.\n\nAt the moment, you can wait for a few different kinds of thing. They are:\n\n* HTTP or HTTPS success response or any expected response following regular expressions\n* TCP or GRPC connection\n* DNS IP resolve address change\n\n[![GitHub release (latest SemVer)](https://img.shields.io/github/v/release/dnnrly/wait-for)](https://github.com/dnnrly/wait-for/releases/latest)\n[![GitHub Workflow Status](https://img.shields.io/github/workflow/status/dnnrly/wait-for/Release%20workflow)](https://github.com/dnnrly/wait-for/actions?query=workflow%3A%22Release+workflow%22)\n[![codecov](https://codecov.io/gh/dnnrly/wait-for/branch/main/graph/badge.svg?token=s0OfKkTFuI)](https://codecov.io/gh/dnnrly/wait-for)\n[![report card](https://goreportcard.com/badge/github.com/dnnrly/wait-for)](https://goreportcard.com/report/github.com/dnnrly/wait-for)\n[![Go Reference](https://pkg.go.dev/badge/github.com/dnnrly/wait-for.svg)](https://pkg.go.dev/github.com/dnnrly/wait-for)\n\n![GitHub watchers](https://img.shields.io/github/watchers/dnnrly/wait-for?style=social)\n![GitHub stars](https://img.shields.io/github/stars/dnnrly/wait-for?style=social)\n[![Twitter URL](https://img.shields.io/twitter/url?style=social\u0026url=https%3A%2F%2Fgithub.com%2Fdnnrly%2Fwait-for)](https://twitter.com/intent/tweet?url=https://github.com/dnnrly/wait-for)\n\n## Installing `wait-for`\n\nUsing the `go` command:\n\n```shell\ngo install github.com/dnnrly/wait-for/cmd/wait-for@latest\n```\n\nIf you don't have Go installed (in a Docker container, for example) then you can take advantage of the pre-built versions. Check out the [releases](https://github.com/dnnrly/wait-for/releases) and check out the links for direct downloads. You can download and unpack a release like so:\n\n```shell\nwget https://github.com/dnnrly/wait-for/releases/download/v0.0.5/wait-for_0.0.5_linux_386.tar.gz\ngunzip wait-for_0.0.5_linux_386.tar.gz\ntar -xfv wait-for_0.0.5_linux_386.tar\n```\n\nIn your Dockerfile, you can do this:\n```docker\nADD https://github.com/dnnrly/wait-for/releases/download/v0.0.1/wait-for_0.0.5_linux_386.tar.gz wait-for.tar.gz\nRUN gunzip wait-for.tar.gz \u0026\u0026 tar -xf wait-for.tar\n```\n\nFeel free to choose from any of the other releases though.\n\n## Using `wait-for`\n\n### Waiting for arbitrary HTTP services\n\n```shell script\n$ wait-for http://your-service-here:8080/health https://another-service/\n``` \n\n### Waiting for HTTP services with expected response status\n\n```shell script\n$ wait-for -status=[0-2]{3} http://your-service-here:8080/health \n```  \n\n### Waiting for gRPC services\n\n```shell script\n$ wait-for grpc-server:8092 other-grpc-server:9091\n```\n\n### Waiting for DNS changes\n\n```shell script\n$ wait-for dns:google.com\n```\n\nThis will wait for the list of IP addresses bound to that DNS name to be\nupdated, regardless of order. You can use this to wait for a DNS update\nsuch as failover or other similar operations.\n\n### Preconfiguring services to connect to\n\n```shell script\n$ wait-for preconfigured-service\n```\n\nBy default, `wait-for` will look for a file in the current directory called\n`.wait-for.yml`. In this, you can define the names of services that you would\nlike to wait on.\n\n```yaml\nwait-for:\n  preconfigured-service:\n    type: http\n    target: http://the-service:8080/health?reload=true\n    interval: 5s\n    timeout: 60s\n    http-client-timeout: 3s\n  another-service:\n    type: http\n    target: https://another-one\n  grpcService:\n    type: grpc\n    target: localhost:9092\n  snmp-service:\n    type: tcp\n    target: snmp-trap-dns:514\n  dns-thing:\n    type: dns\n    target: your.r53-entry.com\n```\n\n### Using `wait-for` in Docker Compose\n\nYou can use `wait-for` to do some of the orchestration for you in your compose file. A good example\nwould be something like this:\n\n```yaml\nversion: '3'\nservices:\n  web:\n    build: .\n    ports:\n      - \"8080\"\n    command: sh -c 'wait-for tcp:db:5432 \u0026\u0026 ./your-api\n    depends_on:\n      - db\n  db:\n    image: \"postgres:13-alpine\"\n    command: \"-c log_statement=all\"\n    environment:\n      POSTGRES_DB: weallvote-api\n      POSTGRES_USER: ${POSTGRES_USER:-postgres}\n      POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-postgres}\n```\n\n## Developing `wait-for`\n\n### Building the tool\n\nTo build the tool so that you can run it locally, you can use the following\ncommand.\n\n```shell script\n$ make build\n```\n\n### Unit tests\n\nYou can run the tests as the build system would, using the following command:\n\n```shell script\n$ make test\n```\n\nYou can also run the Go tests in the 'usual' way with the following command:\n\n```shell script\n$ go test ./...\n```\n\n### Acceptance tests\n\nThere is a suite of GoDog tests that check that the built tooling works as\nexpected.\n\n```shell script\n$ make acceptance-test\n```\n\nDepending on how your system is set up, it might not be possible for you to\nopen up the necessary ports to run the acceptance tests. To get around this\nyou can run those same tests in Docker\n\n\n```shell script\n$ make acceptance-test-docker\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdnnrly%2Fwait-for","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdnnrly%2Fwait-for","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdnnrly%2Fwait-for/lists"}