Documentation ¶
Overview ¶
Package libdrop wraps libdrop fileshare implementation.
Index ¶
- Variables
- type Fileshare
- func (f *Fileshare) Accept(transferID, dstPath string, fileID string) error
- func (f *Fileshare) Cancel(transferID string) error
- func (f *Fileshare) CancelFile(transferID string, fileID string) error
- func (f *Fileshare) Disable() error
- func (f *Fileshare) Enable(listenAddr netip.Addr) (err error)
- func (f *Fileshare) GetTransfersSince(t time.Time) ([]fileshare.LibdropTransfer, error)
- func (f *Fileshare) PurgeTransfersUntil(until time.Time) error
- func (f *Fileshare) Send(peer netip.Addr, paths []string) (string, error)
Constants ¶
This section is empty.
Variables ¶
var ErrLAddressAlreadyInUse = errors.New("address already in use")
Functions ¶
This section is empty.
Types ¶
type Fileshare ¶
type Fileshare struct {
// contains filtered or unexported fields
}
Fileshare is the main functional filesharing implementation using norddrop library. Thread safe.
func New ¶
func New( eventFunc func(string), eventsDbPath string, appVersion string, isProd bool, pubkeyFunc func(string) []byte, privKey string, storagePath string, ) *Fileshare
New initializes norddrop library.
func (*Fileshare) Accept ¶
Accept starts downloading provided files into dstPath. dstPath must be absolute.
func (*Fileshare) CancelFile ¶
CancelFile id in a transfer
func (*Fileshare) Disable ¶
Disable executes Stop in norddrop library. Other Fileshare methods can't be called until after Enable is called again.
func (*Fileshare) Enable ¶
Enable executes Start in norddrop library. Has to be called before using other Fileshare methods.
func (*Fileshare) GetTransfersSince ¶
GetTransfersSince provided time from fileshare implementation storage
func (*Fileshare) PurgeTransfersUntil ¶
PurgeTransfersUntil provided time from fileshare implementation storage