From 41d23c22df853b0bdf35e2d0988c8d4c4281d42f Mon Sep 17 00:00:00 2001 From: Grégoire Duchêne Date: Sun, 19 Jun 2022 13:31:49 +0100 Subject: Move redirection logic to a separate package MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Also, add an optional ‘-c’ flag to pass the path to a configuration file that can be used to specify several matching patterns and replacements. --- README.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'README.md') diff --git a/README.md b/README.md index 5412c96..61b90fd 100644 --- a/README.md +++ b/README.md @@ -11,12 +11,16 @@ to https://godoc.org. It can either be a normal `IP:PORT` address or an absolute path to a UNIX socket that will be created. Defaults to `localhost:8080`. See https://golang.org/pkg/net/#Dial for more details. -* `-from` for the prefix that must be removed from your package name, - e.g. `golang.org/x/` for `golang.org/x/image`. +* `-from` for the regular expression that the import path must match, + including any capturing group, e.g. `go\\.example\\.com/(.+)`. * `-to` for the URL that will be used to build the repository URL. + Capturing groups can be used, e.g. `https://git.example.com/$1`. * `-vcs` for the type of VCS you are using, e.g. `git`. Defaults to `git`. +Additionally, a configuration file can be passed with `-c`. See +`archlinux/go-import-redirect.conf` for an example. + It is recommended to enable the companion systemd socket and customize it so systemd can start the service when needed and pass the socket to `go-import-redirect`. -- cgit v1.2.3-70-g09d2