summary refs log tree commit diff stats
path: root/doc/examples/README
blob: ca5148533bc9eba90540d976a5320767a68c477f (plain) (blame)
1
2
3
4
5
6
7
8
The files in this directory contain applications or extensions of ranger which
are put here for your inspiration and as references.

In order to use a plugin from this directory, you need to copy it to
~/.config/ranger/plugins/

Note that if you update ranger to a new minor version (for example,
from 1.6.* to 1.7.0), your outdated plugins WILL break and crash ranger.
span class="s">"fmt" "log" "net/url" ) // Guesses the appropriate worker type based on the given source string func NewWorker(source string, logger *log.Logger) (*types.Worker, error) { u, err := url.Parse(source) if err != nil { return nil, err } worker := types.NewWorker(logger) switch u.Scheme { case "imap": fallthrough case "imaps": worker.Backend = imap.NewIMAPWorker(worker) default: return nil, fmt.Errorf("Unknown backend %s", u.Scheme) } return worker, nil }