func main() {
	d := rsyncDriver{
		srcdst:   make(map[string]string),
		volRoot:  *volRoot,
		sshKey:   *sshKey,
		archive:  *archive,
		del:      *del,
		compress: *compress,
	}
	h := dkvolume.NewHandler(&d)
	log.Printf("Listening on %s\n", socketAddress)
	fmt.Println(h.ServeUnix("root", socketAddress))
}
-----------------------------------------------------------------------------
Function main of package main:
-----------------------------------------------------------------------------
package main
import (
	"flag"
	"fmt"
	"log"
	"os"
	"os/user"
	"path/filepath"
	"github.com/calavera/dkvolume"
)
const (
	id            = "rsync"
	socketAddress = "/var/run/docker/plugins/rsync.sock"
)
var (
	defVolRoot = filepath.Join(dkvolume.DefaultDockerRootDirectory, id)
	defSshKey  = sshKeyPath()
	volRoot  = flag.String("volroot", defVolRoot, "Docker volumes root directory")
	archive  = flag.Bool("archive", true, "Archive mode; equals -rlptgoD")
	del      = flag.Bool("delete", false, "Delete extraneous files from dest dirs")
	compress = flag.Bool("compress", false, "Compress file data during the transfer")
	sshKey   = flag.String("ssh-private-key", defSshKey, "Path to the private SSH key")
)
func sshKeyPath() string {
	usr, err := user.Current()
	if err != nil {
		log.Fatal(err)
	}
	return filepath.Join(usr.HomeDir, ".ssh/id_rsa")
}
func init() {
	if len(os.Args) < 1 {
		usage()
	}
	flag.Usage = usage
	flag.Parse()
}
func usage() {
	fmt.Fprintf(os.Stderr, "Usage: %s [options]\n", os.Args[0])
	flag.PrintDefaults()
	os.Exit(2)
}