sync

package module
v0.0.0-...-4bb517c Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CompareState

type CompareState byte
const (
	Same CompareState = iota
	Local
	Server
	OutOfSync
	NotExistLocal
	NotExistServer
	Unknown
)

type SyncClient

type SyncClient struct {
	SftpClient *sftp.Client
	Conn       *ssh.Client
	Config     SyncConfig
}

func NewClient

func NewClient(cfg SyncConfig) (SyncClient, error)

func (SyncClient) Close

func (c SyncClient) Close() error

func (*SyncClient) Update

func (c *SyncClient) Update(files ...string) error

type SyncConfig

type SyncConfig struct {
	Host           string `toml:"host"`
	User           string `toml:"user"`
	Port           int    `toml:"port"`
	PrivateKeyPath string `toml:"private_key_path"`
}

func ReadConfig

func ReadConfig(configPath string) (SyncConfig, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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