Documentation
¶
Overview ¶
Package rsync (gokrazy/rsync) contains a native Go rsync implementation that supports sending and receiving files as client or server, compatible with the original tridge rsync (from the samba project) or openrsync (used on OpenBSD and macOS 15+).
The only component currently is gokr-rsyncd, a read-only rsync daemon sender-only Go implementation of rsyncd. rsync daemon is a custom (un-standardized) network protocol, running on port 873 by default.
Index ¶
Constants ¶
const ( XMIT_TOP_DIR = (1 << 0) XMIT_SAME_MODE = (1 << 1) XMIT_EXTENDED_FLAGS = (1 << 2) XMIT_SAME_RDEV_pre28 = XMIT_EXTENDED_FLAGS /* Only in protocols < 28 */ XMIT_SAME_UID = (1 << 3) XMIT_SAME_GID = (1 << 4) XMIT_SAME_NAME = (1 << 5) XMIT_LONG_NAME = (1 << 6) XMIT_SAME_TIME = (1 << 7) XMIT_SAME_RDEV_MAJOR = (1 << 8) XMIT_HAS_IDEV_DATA = (1 << 9) XMIT_SAME_DEV = (1 << 10) XMIT_RDEV_MINOR_IS_SMALL = (1 << 11) )
rsync.h
const ( S_IFMT = 0o0170000 // bits determining the file type S_IFDIR = 0o0040000 // Directory S_IFCHR = 0o0020000 // Character device S_IFBLK = 0o0060000 // Block device S_IFREG = 0o0100000 // Regular file S_IFIFO = 0o0010000 // FIFO S_IFLNK = 0o0120000 // Symbolic link S_IFSOCK = 0o0140000 // Socket )
as per /usr/include/bits/stat.h:
const FileSystemRoot = "/"
const ProtocolVersion = 27
ProtocolVersion defines the currently implemented rsync protocol version. Protocol version 27 seems to be the safest bet for wide compatibility: version 27 was introduced by rsync 2.6.0 (released 2004), and is supported by openrsync and rsyn.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BothCloser ¶
type BothCloser struct {
io.ReadCloser
io.WriteCloser
}
BothCloser is a wrapper around a ReadCloser and WriteCloser that provides its own Close() function which calls Close() on both, the WriteCloser and ReadCloser, in order, and returns the first non-nil error.
type Logger ¶
Logger is an interface that allows specifying your own logger. By default, the Go log package is used, which prints to stderr.
type SumHead ¶
type SumHead struct {
// “number of blocks” (openrsync)
// “how many chunks” (rsync)
ChecksumCount int32
// “block length in the file” (openrsync)
// maximum (1 << 29) for older rsync, (1 << 17) for newer
BlockLength int32
// “long checksum length” (openrsync)
ChecksumLength int32
// “terminal (remainder) block length” (openrsync)
// RemainderLength is flength % BlockLength
RemainderLength int32
Sums []SumBuf
}
TODO: remove connection.go:sumHead in favor of this type
Directories
¶
| Path | Synopsis |
|---|---|
|
cmd
|
|
|
gokr-rsync
command
Tool gokr-rsync is an rsync Go implementation.
|
Tool gokr-rsync is an rsync Go implementation. |
|
gokr-rsyncd
command
Tool gokr-rsyncd is an old name for gokr-rsync.
|
Tool gokr-rsyncd is an old name for gokr-rsync. |
|
internal
|
|
|
log
Package log defines the logger interface used in rsync library.
|
Package log defines the logger interface used in rsync library. |
|
maincmd
Package maincmd implements a subset of the '$ rsync' CLI surface, namely that it can:
|
Package maincmd implements a subset of the '$ rsync' CLI surface, namely that it can: |
|
restrict
Package restrict can be used to restrict further file system access of the process if the operating system provides an API for that.
|
Package restrict can be used to restrict further file system access of the process if the operating system provides an API for that. |
|
rsynccommon
Package rsynccommon contains functionality that both the sender and the receiver implementation need.
|
Package rsynccommon contains functionality that both the sender and the receiver implementation need. |
|
rsyncopts
Package rsyncopts implements a parser for command-line options that implements a subset of popt(3) semantics; just enough to parse typical rsync(1) invocations without the advanced popt features like aliases or option prefix matching (not --del, only --delete).
|
Package rsyncopts implements a parser for command-line options that implements a subset of popt(3) semantics; just enough to parse typical rsync(1) invocations without the advanced popt features like aliases or option prefix matching (not --del, only --delete). |
|
testlogger
Package testlogger contains a helper to put a stdout/stderr output stream of a subprocess onto the testing package's t.Log().
|
Package testlogger contains a helper to put a stdout/stderr output stream of a subprocess onto the testing package's t.Log(). |
|
Package rsyncclient implements an rsync client (only), but note that gokrazy/rsync contains a native Go rsync implementation that supports sending and receiving files as client or server, compatible with the original tridge rsync (from the samba project) or openrsync (used on OpenBSD and macOS 15+).
|
Package rsyncclient implements an rsync client (only), but note that gokrazy/rsync contains a native Go rsync implementation that supports sending and receiving files as client or server, compatible with the original tridge rsync (from the samba project) or openrsync (used on OpenBSD and macOS 15+). |
|
Package rsynccmd provides a command-like interface to gokrazy/rsync, which contains a native Go rsync implementation that supports sending and receiving files as client or server, compatible with the original tridge rsync (from the samba project) or openrsync (used on OpenBSD and macOS 15+).
|
Package rsynccmd provides a command-like interface to gokrazy/rsync, which contains a native Go rsync implementation that supports sending and receiving files as client or server, compatible with the original tridge rsync (from the samba project) or openrsync (used on OpenBSD and macOS 15+). |
|
Package rsyncd implements an rsync server (only), but note that gokrazy/rsync contains a native Go rsync implementation that supports sending and receiving files as client or server, compatible with the original tridge rsync (from the samba project) or openrsync (used on OpenBSD and macOS 15+).
|
Package rsyncd implements an rsync server (only), but note that gokrazy/rsync contains a native Go rsync implementation that supports sending and receiving files as client or server, compatible with the original tridge rsync (from the samba project) or openrsync (used on OpenBSD and macOS 15+). |