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) CancelFile(transferID string, fileID string) error
- func (f *Fileshare) Disable() error
- func (f *Fileshare) Enable(listenAddr netip.Addr) (err error)
- func (f *Fileshare) Finalize(transferID string) error
- func (f *Fileshare) Load() (map[string]*pb.Transfer, 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 ¶
View Source
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( eventCb fileshare.EventCallback, eventsDbPath string, isProd bool, pubkeyFunc func(string) []byte, privKey string, storagePath string, ) (*Fileshare, error)
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) PurgeTransfersUntil ¶
PurgeTransfersUntil provided time from fileshare implementation storage
Click to show internal directories.
Click to hide internal directories.