sync

package
v3.0.0-alpha5.0...-c974331 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2024 License: LGPL-3.0 Imports: 30 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckRemote

func CheckRemote(rcCli *downloader.RCloneClient, src string) error

func DownloadManifest

func DownloadManifest(ctx context.Context, session DownloadSession) ([]fs.DirEntry, error)

func Logger

func Logger(ctx context.Context) log.Logger

func NewTorrentSession

func NewTorrentSession(cli *TorrentClient, chain string) *torrentSession

func TempDir

func TempDir(ctx context.Context) string

func WithLogger

func WithLogger(ctx context.Context, logger log.Logger) context.Context

func WithTempDir

func WithTempDir(ctx context.Context, tempDir string) context.Context

Types

type CreateNewTorrentClientConfig

type CreateNewTorrentClientConfig struct {
	Chain        string
	WebSeeds     string
	DownloadRate string
	UploadRate   string
	Verbosity    int
	TorrentPort  int
	ConnsPerFile int
	DisableIPv6  bool
	DisableIPv4  bool
	NatFlag      string
	Logger       log.Logger
	TempDir      string
	CleanDir     bool
}

func NewDefaultTorrentClientConfig

func NewDefaultTorrentClientConfig(chain string, torrentDir string, logger log.Logger) CreateNewTorrentClientConfig

func NewTorrentClientConfigFromCobra

func NewTorrentClientConfigFromCobra(cliCtx *cli.Context, chain string) CreateNewTorrentClientConfig

type DownloadSession

type DownloadSession interface {
	Download(ctx context.Context, files ...string) error
	ReadRemoteDir(ctx context.Context, refresh bool) ([]fs.DirEntry, error)
	LocalFsRoot() string
	RemoteFsRoot() string
	Label() string
}

type LType

type LType int
const (
	TorrentFs LType = iota
	LocalFs
	RemoteFs
)

type Locator

type Locator struct {
	LType   LType
	Src     string
	Root    string
	Version snaptype.Version
	Chain   string
}

func ParseLocator

func ParseLocator(value string) (*Locator, error)

func (Locator) String

func (l Locator) String() string

type TorrentClient

type TorrentClient struct {
	*torrent.Client
	// contains filtered or unexported fields
}

func NewTorrentClient

func NewTorrentClient(ctx context.Context, config CreateNewTorrentClientConfig) (*TorrentClient, error)

Jump to

Keyboard shortcuts

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