sync

package
v0.4.42 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 18, 2024 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func OneWay

func OneWay(src, dst Target, sync bool) error

Types

type FilesystemTarget

type FilesystemTarget struct {
	// contains filtered or unexported fields
}

func NewFilesystemTarget

func NewFilesystemTarget(cfg *FilesystemTargetConfig) *FilesystemTarget

func (*FilesystemTarget) Dir

func (t *FilesystemTarget) Dir(path string) ([]*Object, error)

func (*FilesystemTarget) Inventory

func (t *FilesystemTarget) Inventory() ([]*Object, error)

func (*FilesystemTarget) Mkdir

func (t *FilesystemTarget) Mkdir(path string) error

func (*FilesystemTarget) Move

func (t *FilesystemTarget) Move(src, dest string) error

func (*FilesystemTarget) ReadStream

func (t *FilesystemTarget) ReadStream(path string) (io.ReadCloser, error)

func (*FilesystemTarget) Rm

func (t *FilesystemTarget) Rm(path string) error

func (*FilesystemTarget) SetModificationTime

func (t *FilesystemTarget) SetModificationTime(path string, mtime time.Time) error

func (*FilesystemTarget) WriteStream

func (t *FilesystemTarget) WriteStream(path string, stream io.Reader, mode os.FileMode) error

func (*FilesystemTarget) WriteStreamWithModTime

func (t *FilesystemTarget) WriteStreamWithModTime(path string, stream io.Reader, mode os.FileMode, modTime time.Time) error

type FilesystemTargetConfig

type FilesystemTargetConfig struct {
	Root string
}

type Object

type Object struct {
	Path     string
	IsDir    bool
	Size     int64
	Modified time.Time
	ETag     string
}

type Target

type Target interface {
	Inventory() ([]*Object, error)
	Dir(path string) ([]*Object, error)
	Mkdir(path string) error
	ReadStream(path string) (io.ReadCloser, error)
	WriteStream(path string, stream io.Reader, mode os.FileMode) error
	WriteStreamWithModTime(path string, stream io.Reader, mode os.FileMode, modTime time.Time) error
	Move(src, dest string) error
	Rm(path string) error
	SetModificationTime(path string, mtime time.Time) error
}

func TargetForURL

func TargetForURL(url *url.URL, root env_core.Root, basicAuth string) (Target, error)

type WebDAVTarget

type WebDAVTarget struct {
	// contains filtered or unexported fields
}

func NewWebDAVTarget

func NewWebDAVTarget(cfg *WebDAVTargetConfig) (*WebDAVTarget, error)

func (*WebDAVTarget) Dir

func (t *WebDAVTarget) Dir(path string) ([]*Object, error)

func (*WebDAVTarget) Inventory

func (t *WebDAVTarget) Inventory() ([]*Object, error)

func (*WebDAVTarget) Mkdir

func (t *WebDAVTarget) Mkdir(path string) error

func (*WebDAVTarget) Move

func (t *WebDAVTarget) Move(src, dest string) error

func (*WebDAVTarget) ReadStream

func (t *WebDAVTarget) ReadStream(path string) (io.ReadCloser, error)

func (*WebDAVTarget) Rm

func (t *WebDAVTarget) Rm(path string) error

func (*WebDAVTarget) SetModificationTime

func (t *WebDAVTarget) SetModificationTime(path string, mtime time.Time) error

func (*WebDAVTarget) WriteStream

func (t *WebDAVTarget) WriteStream(path string, rs io.Reader, _ os.FileMode) error

func (*WebDAVTarget) WriteStreamWithModTime

func (t *WebDAVTarget) WriteStreamWithModTime(path string, rs io.Reader, _ os.FileMode, modTime time.Time) error

type WebDAVTargetConfig

type WebDAVTargetConfig struct {
	URL      *url.URL
	Username string
	Password string
}

type ZrokTarget

type ZrokTarget struct {
	// contains filtered or unexported fields
}

func NewZrokTarget

func NewZrokTarget(cfg *ZrokTargetConfig) (*ZrokTarget, error)

func (*ZrokTarget) Dir

func (t *ZrokTarget) Dir(path string) ([]*Object, error)

func (*ZrokTarget) Inventory

func (t *ZrokTarget) Inventory() ([]*Object, error)

func (*ZrokTarget) Mkdir

func (t *ZrokTarget) Mkdir(path string) error

func (*ZrokTarget) Move

func (t *ZrokTarget) Move(src, dest string) error

func (*ZrokTarget) ReadStream

func (t *ZrokTarget) ReadStream(path string) (io.ReadCloser, error)

func (*ZrokTarget) Rm

func (t *ZrokTarget) Rm(path string) error

func (*ZrokTarget) SetModificationTime

func (t *ZrokTarget) SetModificationTime(path string, mtime time.Time) error

func (*ZrokTarget) WriteStream

func (t *ZrokTarget) WriteStream(path string, rs io.Reader, _ os.FileMode) error

func (*ZrokTarget) WriteStreamWithModTime

func (t *ZrokTarget) WriteStreamWithModTime(path string, rs io.Reader, _ os.FileMode, modTime time.Time) error

type ZrokTargetConfig

type ZrokTargetConfig struct {
	URL  *url.URL
	Root env_core.Root
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL