Documentation
¶
Index ¶
- func AcceptAndSend(ln net.Listener, filePath string, tlsConfig *tls.Config, ...) error
- func EnsureUnique(dir, name string) (string, error)
- func ListenSideChannel(ctx context.Context, cfg config.ShareConfig, tlsConfig *tls.Config) (net.Listener, int, error)
- func ReceiveSideChannel(ctx context.Context, ip net.IP, port int, size int64, dest string, ...) error
- func SanitizeFilename(name string) string
- type ShareBody
- type SharePlugin
- func (p *SharePlugin) Handle(ctx context.Context, dev device.Sender, pkt *protocol.Packet) error
- func (p *SharePlugin) IncomingTypes() []string
- func (p *SharePlugin) Name() string
- func (p *SharePlugin) OnConnect(dev device.Sender)
- func (p *SharePlugin) OnDisconnect(dev device.Sender)
- func (p *SharePlugin) OutgoingTypes() []string
- func (p *SharePlugin) SendFile(ctx context.Context, dev device.Sender, filePath string) error
- func (p *SharePlugin) Timeout() time.Duration
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AcceptAndSend ¶ added in v1.10.0
func AcceptAndSend(ln net.Listener, filePath string, tlsConfig *tls.Config, expectedDeviceID string, timeout time.Duration, onProgress func(int64, int64), logger *zap.Logger) error
AcceptAndSend waits for the phone to connect, performs the TLS handshake, and streams the file.
func EnsureUnique ¶
EnsureUnique finds a non-conflicting filename in the destination directory.
func ListenSideChannel ¶ added in v1.10.0
func ListenSideChannel(ctx context.Context, cfg config.ShareConfig, tlsConfig *tls.Config) (net.Listener, int, error)
ListenSideChannel binds to an available TCP port in the KDE Connect side-channel range.
func ReceiveSideChannel ¶
func SanitizeFilename ¶
SanitizeFilename strips path components and prevents traversal.
Types ¶
type ShareBody ¶
type ShareBody struct {
}
ShareBody includes the missing Android metadata (LastModified/CreationTime)
type SharePlugin ¶
type SharePlugin struct {
// contains filtered or unexported fields
}
func NewSharePlugin ¶
func NewSharePlugin(downloadDir string, cfg config.ShareConfig, tlsConfig *tls.Config, bus *events.Bus, logger *zap.Logger) *SharePlugin
func (*SharePlugin) IncomingTypes ¶
func (p *SharePlugin) IncomingTypes() []string
func (*SharePlugin) Name ¶
func (p *SharePlugin) Name() string
func (*SharePlugin) OnConnect ¶
func (p *SharePlugin) OnConnect(dev device.Sender)
func (*SharePlugin) OnDisconnect ¶
func (p *SharePlugin) OnDisconnect(dev device.Sender)
func (*SharePlugin) OutgoingTypes ¶
func (p *SharePlugin) OutgoingTypes() []string
func (*SharePlugin) Timeout ¶
func (p *SharePlugin) Timeout() time.Duration
Click to show internal directories.
Click to hide internal directories.