Documentation ¶
Index ¶
- Variables
- func LiftFromRustBuffer[GoType any](bufReader BufReader[GoType], rbuf RustBufferI) GoType
- func Version() string
- type BufLifter
- type BufLowerer
- type BufReader
- type BufWriter
- type Config
- type Event
- type EventCallback
- type EventKind
- type EventKindFileDownloaded
- type EventKindFileFailed
- type EventKindFilePaused
- type EventKindFilePending
- type EventKindFileProgress
- type EventKindFileRejected
- type EventKindFileStarted
- type EventKindFileThrottled
- type EventKindFileUploaded
- type EventKindFinalizeChecksumFinished
- type EventKindFinalizeChecksumProgress
- type EventKindFinalizeChecksumStarted
- type EventKindRequestQueued
- type EventKindRequestReceived
- type EventKindRuntimeError
- type EventKindTransferDeferred
- type EventKindTransferFailed
- type EventKindTransferFinalized
- type EventKindVerifyChecksumFinished
- type EventKindVerifyChecksumProgress
- type EventKindVerifyChecksumStarted
- type FdResolver
- type FfiConverter
- type FfiConverterBool
- type FfiConverterBytes
- type FfiConverterCallbackInterface
- func (c *FfiConverterCallbackInterface[CallbackInterface]) Lift(handle uint64) CallbackInterface
- func (c *FfiConverterCallbackInterface[CallbackInterface]) Lower(value CallbackInterface) C.uint64_t
- func (c *FfiConverterCallbackInterface[CallbackInterface]) Read(reader io.Reader) CallbackInterface
- func (c *FfiConverterCallbackInterface[CallbackInterface]) Write(writer io.Writer, value CallbackInterface)
- type FfiConverterCallbackInterfaceEventCallback
- type FfiConverterCallbackInterfaceFdResolver
- type FfiConverterCallbackInterfaceKeyStore
- type FfiConverterCallbackInterfaceLogger
- type FfiConverterInt32
- type FfiConverterInt64
- type FfiConverterNordDrop
- type FfiConverterOptionalBytes
- type FfiConverterOptionalInt32
- type FfiConverterOptionalString
- type FfiConverterOptionalUint32
- type FfiConverterOptionalUint64
- type FfiConverterSequenceString
- type FfiConverterSequenceTypeIncomingPath
- func (c FfiConverterSequenceTypeIncomingPath) Lift(rb RustBufferI) []IncomingPath
- func (c FfiConverterSequenceTypeIncomingPath) Lower(value []IncomingPath) RustBuffer
- func (c FfiConverterSequenceTypeIncomingPath) Read(reader io.Reader) []IncomingPath
- func (c FfiConverterSequenceTypeIncomingPath) Write(writer io.Writer, value []IncomingPath)
- type FfiConverterSequenceTypeIncomingPathState
- func (c FfiConverterSequenceTypeIncomingPathState) Lift(rb RustBufferI) []IncomingPathState
- func (c FfiConverterSequenceTypeIncomingPathState) Lower(value []IncomingPathState) RustBuffer
- func (c FfiConverterSequenceTypeIncomingPathState) Read(reader io.Reader) []IncomingPathState
- func (c FfiConverterSequenceTypeIncomingPathState) Write(writer io.Writer, value []IncomingPathState)
- type FfiConverterSequenceTypeOutgoingPath
- func (c FfiConverterSequenceTypeOutgoingPath) Lift(rb RustBufferI) []OutgoingPath
- func (c FfiConverterSequenceTypeOutgoingPath) Lower(value []OutgoingPath) RustBuffer
- func (c FfiConverterSequenceTypeOutgoingPath) Read(reader io.Reader) []OutgoingPath
- func (c FfiConverterSequenceTypeOutgoingPath) Write(writer io.Writer, value []OutgoingPath)
- type FfiConverterSequenceTypeOutgoingPathState
- func (c FfiConverterSequenceTypeOutgoingPathState) Lift(rb RustBufferI) []OutgoingPathState
- func (c FfiConverterSequenceTypeOutgoingPathState) Lower(value []OutgoingPathState) RustBuffer
- func (c FfiConverterSequenceTypeOutgoingPathState) Read(reader io.Reader) []OutgoingPathState
- func (c FfiConverterSequenceTypeOutgoingPathState) Write(writer io.Writer, value []OutgoingPathState)
- type FfiConverterSequenceTypeQueuedFile
- func (c FfiConverterSequenceTypeQueuedFile) Lift(rb RustBufferI) []QueuedFile
- func (c FfiConverterSequenceTypeQueuedFile) Lower(value []QueuedFile) RustBuffer
- func (c FfiConverterSequenceTypeQueuedFile) Read(reader io.Reader) []QueuedFile
- func (c FfiConverterSequenceTypeQueuedFile) Write(writer io.Writer, value []QueuedFile)
- type FfiConverterSequenceTypeReceivedFile
- func (c FfiConverterSequenceTypeReceivedFile) Lift(rb RustBufferI) []ReceivedFile
- func (c FfiConverterSequenceTypeReceivedFile) Lower(value []ReceivedFile) RustBuffer
- func (c FfiConverterSequenceTypeReceivedFile) Read(reader io.Reader) []ReceivedFile
- func (c FfiConverterSequenceTypeReceivedFile) Write(writer io.Writer, value []ReceivedFile)
- type FfiConverterSequenceTypeTransferDescriptor
- func (c FfiConverterSequenceTypeTransferDescriptor) Lift(rb RustBufferI) []TransferDescriptor
- func (c FfiConverterSequenceTypeTransferDescriptor) Lower(value []TransferDescriptor) RustBuffer
- func (c FfiConverterSequenceTypeTransferDescriptor) Read(reader io.Reader) []TransferDescriptor
- func (c FfiConverterSequenceTypeTransferDescriptor) Write(writer io.Writer, value []TransferDescriptor)
- type FfiConverterSequenceTypeTransferInfo
- func (c FfiConverterSequenceTypeTransferInfo) Lift(rb RustBufferI) []TransferInfo
- func (c FfiConverterSequenceTypeTransferInfo) Lower(value []TransferInfo) RustBuffer
- func (c FfiConverterSequenceTypeTransferInfo) Read(reader io.Reader) []TransferInfo
- func (c FfiConverterSequenceTypeTransferInfo) Write(writer io.Writer, value []TransferInfo)
- type FfiConverterSequenceTypeTransferState
- func (c FfiConverterSequenceTypeTransferState) Lift(rb RustBufferI) []TransferState
- func (c FfiConverterSequenceTypeTransferState) Lower(value []TransferState) RustBuffer
- func (c FfiConverterSequenceTypeTransferState) Read(reader io.Reader) []TransferState
- func (c FfiConverterSequenceTypeTransferState) Write(writer io.Writer, value []TransferState)
- type FfiConverterString
- type FfiConverterTypeConfig
- type FfiConverterTypeEvent
- type FfiConverterTypeEventKind
- type FfiConverterTypeIncomingPath
- func (c FfiConverterTypeIncomingPath) Lift(rb RustBufferI) IncomingPath
- func (c FfiConverterTypeIncomingPath) Lower(value IncomingPath) RustBuffer
- func (c FfiConverterTypeIncomingPath) Read(reader io.Reader) IncomingPath
- func (c FfiConverterTypeIncomingPath) Write(writer io.Writer, value IncomingPath)
- type FfiConverterTypeIncomingPathState
- func (c FfiConverterTypeIncomingPathState) Lift(rb RustBufferI) IncomingPathState
- func (c FfiConverterTypeIncomingPathState) Lower(value IncomingPathState) RustBuffer
- func (c FfiConverterTypeIncomingPathState) Read(reader io.Reader) IncomingPathState
- func (c FfiConverterTypeIncomingPathState) Write(writer io.Writer, value IncomingPathState)
- type FfiConverterTypeIncomingPathStateKind
- func (c FfiConverterTypeIncomingPathStateKind) Lift(rb RustBufferI) IncomingPathStateKind
- func (c FfiConverterTypeIncomingPathStateKind) Lower(value IncomingPathStateKind) RustBuffer
- func (FfiConverterTypeIncomingPathStateKind) Read(reader io.Reader) IncomingPathStateKind
- func (FfiConverterTypeIncomingPathStateKind) Write(writer io.Writer, value IncomingPathStateKind)
- type FfiConverterTypeLibdropError
- type FfiConverterTypeLogLevel
- type FfiConverterTypeOutgoingFileSource
- func (c FfiConverterTypeOutgoingFileSource) Lift(rb RustBufferI) OutgoingFileSource
- func (c FfiConverterTypeOutgoingFileSource) Lower(value OutgoingFileSource) RustBuffer
- func (FfiConverterTypeOutgoingFileSource) Read(reader io.Reader) OutgoingFileSource
- func (FfiConverterTypeOutgoingFileSource) Write(writer io.Writer, value OutgoingFileSource)
- type FfiConverterTypeOutgoingPath
- func (c FfiConverterTypeOutgoingPath) Lift(rb RustBufferI) OutgoingPath
- func (c FfiConverterTypeOutgoingPath) Lower(value OutgoingPath) RustBuffer
- func (c FfiConverterTypeOutgoingPath) Read(reader io.Reader) OutgoingPath
- func (c FfiConverterTypeOutgoingPath) Write(writer io.Writer, value OutgoingPath)
- type FfiConverterTypeOutgoingPathState
- func (c FfiConverterTypeOutgoingPathState) Lift(rb RustBufferI) OutgoingPathState
- func (c FfiConverterTypeOutgoingPathState) Lower(value OutgoingPathState) RustBuffer
- func (c FfiConverterTypeOutgoingPathState) Read(reader io.Reader) OutgoingPathState
- func (c FfiConverterTypeOutgoingPathState) Write(writer io.Writer, value OutgoingPathState)
- type FfiConverterTypeOutgoingPathStateKind
- func (c FfiConverterTypeOutgoingPathStateKind) Lift(rb RustBufferI) OutgoingPathStateKind
- func (c FfiConverterTypeOutgoingPathStateKind) Lower(value OutgoingPathStateKind) RustBuffer
- func (FfiConverterTypeOutgoingPathStateKind) Read(reader io.Reader) OutgoingPathStateKind
- func (FfiConverterTypeOutgoingPathStateKind) Write(writer io.Writer, value OutgoingPathStateKind)
- type FfiConverterTypeQueuedFile
- type FfiConverterTypeReceivedFile
- func (c FfiConverterTypeReceivedFile) Lift(rb RustBufferI) ReceivedFile
- func (c FfiConverterTypeReceivedFile) Lower(value ReceivedFile) RustBuffer
- func (c FfiConverterTypeReceivedFile) Read(reader io.Reader) ReceivedFile
- func (c FfiConverterTypeReceivedFile) Write(writer io.Writer, value ReceivedFile)
- type FfiConverterTypeStatus
- type FfiConverterTypeStatusCode
- type FfiConverterTypeTransferDescriptor
- func (c FfiConverterTypeTransferDescriptor) Lift(rb RustBufferI) TransferDescriptor
- func (c FfiConverterTypeTransferDescriptor) Lower(value TransferDescriptor) RustBuffer
- func (FfiConverterTypeTransferDescriptor) Read(reader io.Reader) TransferDescriptor
- func (FfiConverterTypeTransferDescriptor) Write(writer io.Writer, value TransferDescriptor)
- type FfiConverterTypeTransferInfo
- func (c FfiConverterTypeTransferInfo) Lift(rb RustBufferI) TransferInfo
- func (c FfiConverterTypeTransferInfo) Lower(value TransferInfo) RustBuffer
- func (c FfiConverterTypeTransferInfo) Read(reader io.Reader) TransferInfo
- func (c FfiConverterTypeTransferInfo) Write(writer io.Writer, value TransferInfo)
- type FfiConverterTypeTransferKind
- type FfiConverterTypeTransferState
- func (c FfiConverterTypeTransferState) Lift(rb RustBufferI) TransferState
- func (c FfiConverterTypeTransferState) Lower(value TransferState) RustBuffer
- func (c FfiConverterTypeTransferState) Read(reader io.Reader) TransferState
- func (c FfiConverterTypeTransferState) Write(writer io.Writer, value TransferState)
- type FfiConverterTypeTransferStateKind
- func (c FfiConverterTypeTransferStateKind) Lift(rb RustBufferI) TransferStateKind
- func (c FfiConverterTypeTransferStateKind) Lower(value TransferStateKind) RustBuffer
- func (FfiConverterTypeTransferStateKind) Read(reader io.Reader) TransferStateKind
- func (FfiConverterTypeTransferStateKind) Write(writer io.Writer, value TransferStateKind)
- type FfiConverterUint32
- type FfiConverterUint64
- type FfiDestroyerBool
- type FfiDestroyerBytes
- type FfiDestroyerCallbackInterfaceEventCallback
- type FfiDestroyerCallbackInterfaceFdResolver
- type FfiDestroyerCallbackInterfaceKeyStore
- type FfiDestroyerCallbackInterfaceLogger
- type FfiDestroyerInt32
- type FfiDestroyerInt64
- type FfiDestroyerNordDrop
- type FfiDestroyerOptionalBytes
- type FfiDestroyerOptionalInt32
- type FfiDestroyerOptionalString
- type FfiDestroyerOptionalUint32
- type FfiDestroyerOptionalUint64
- type FfiDestroyerSequenceString
- type FfiDestroyerSequenceTypeIncomingPath
- type FfiDestroyerSequenceTypeIncomingPathState
- type FfiDestroyerSequenceTypeOutgoingPath
- type FfiDestroyerSequenceTypeOutgoingPathState
- type FfiDestroyerSequenceTypeQueuedFile
- type FfiDestroyerSequenceTypeReceivedFile
- type FfiDestroyerSequenceTypeTransferDescriptor
- type FfiDestroyerSequenceTypeTransferInfo
- type FfiDestroyerSequenceTypeTransferState
- type FfiDestroyerString
- type FfiDestroyerTypeConfig
- type FfiDestroyerTypeEvent
- type FfiDestroyerTypeEventKind
- type FfiDestroyerTypeIncomingPath
- type FfiDestroyerTypeIncomingPathState
- type FfiDestroyerTypeIncomingPathStateKind
- type FfiDestroyerTypeLogLevel
- type FfiDestroyerTypeOutgoingFileSource
- type FfiDestroyerTypeOutgoingPath
- type FfiDestroyerTypeOutgoingPathState
- type FfiDestroyerTypeOutgoingPathStateKind
- type FfiDestroyerTypeQueuedFile
- type FfiDestroyerTypeReceivedFile
- type FfiDestroyerTypeStatus
- type FfiDestroyerTypeStatusCode
- type FfiDestroyerTypeTransferDescriptor
- type FfiDestroyerTypeTransferInfo
- type FfiDestroyerTypeTransferKind
- type FfiDestroyerTypeTransferState
- type FfiDestroyerTypeTransferStateKind
- type FfiDestroyerUint32
- type FfiDestroyerUint64
- type FfiObject
- type FfiRustBufConverter
- type IncomingPath
- type IncomingPathState
- type IncomingPathStateKind
- type IncomingPathStateKindCompleted
- type IncomingPathStateKindFailed
- type IncomingPathStateKindPaused
- type IncomingPathStateKindPending
- type IncomingPathStateKindRejected
- type IncomingPathStateKindStarted
- type KeyStore
- type LibdropError
- func NewLibdropErrorAddrInUse() *LibdropError
- func NewLibdropErrorBadInput() *LibdropError
- func NewLibdropErrorDbError() *LibdropError
- func NewLibdropErrorInstanceStart() *LibdropError
- func NewLibdropErrorInstanceStop() *LibdropError
- func NewLibdropErrorInvalidPrivkey() *LibdropError
- func NewLibdropErrorInvalidString() *LibdropError
- func NewLibdropErrorNotStarted() *LibdropError
- func NewLibdropErrorTransferCreate() *LibdropError
- func NewLibdropErrorUnknown() *LibdropError
- type LibdropErrorAddrInUse
- type LibdropErrorBadInput
- type LibdropErrorDbError
- type LibdropErrorInstanceStart
- type LibdropErrorInstanceStop
- type LibdropErrorInvalidPrivkey
- type LibdropErrorInvalidString
- type LibdropErrorNotStarted
- type LibdropErrorTransferCreate
- type LibdropErrorUnknown
- type LogLevel
- type Logger
- type NordDrop
- func (object *NordDrop) Destroy()
- func (_self *NordDrop) DownloadFile(transferId string, fileId string, destination string) error
- func (_self *NordDrop) FinalizeTransfer(transferId string) error
- func (_self *NordDrop) NetworkRefresh() error
- func (_self *NordDrop) NewTransfer(peer string, descriptors []TransferDescriptor) (string, error)
- func (_self *NordDrop) PurgeTransfers(transferIds []string) error
- func (_self *NordDrop) PurgeTransfersUntil(until int64) error
- func (_self *NordDrop) RejectFile(transferId string, fileId string) error
- func (_self *NordDrop) RemoveFile(transferId string, fileId string) error
- func (_self *NordDrop) SetFdResolver(resolver FdResolver) error
- func (_self *NordDrop) Start(addr string, config Config) error
- func (_self *NordDrop) Stop() error
- func (_self *NordDrop) TransfersSince(since int64) ([]TransferInfo, error)
- type OutgoingFileSource
- type OutgoingFileSourceBasePath
- type OutgoingFileSourceContentUri
- type OutgoingPath
- type OutgoingPathState
- type OutgoingPathStateKind
- type OutgoingPathStateKindCompleted
- type OutgoingPathStateKindFailed
- type OutgoingPathStateKindPaused
- type OutgoingPathStateKindRejected
- type OutgoingPathStateKindStarted
- type QueuedFile
- type ReceivedFile
- type RustBuffer
- type RustBufferI
- type Status
- type StatusCode
- type TransferDescriptor
- type TransferDescriptorFd
- type TransferDescriptorPath
- type TransferInfo
- type TransferKind
- type TransferKindIncoming
- type TransferKindOutgoing
- type TransferState
- type TransferStateKind
- type TransferStateKindCancel
- type TransferStateKindFailed
Constants ¶
This section is empty.
Variables ¶
var ErrLibdropErrorAddrInUse = fmt.Errorf("LibdropErrorAddrInUse")
var ErrLibdropErrorBadInput = fmt.Errorf("LibdropErrorBadInput")
var ErrLibdropErrorDbError = fmt.Errorf("LibdropErrorDbError")
var ErrLibdropErrorInstanceStart = fmt.Errorf("LibdropErrorInstanceStart")
var ErrLibdropErrorInstanceStop = fmt.Errorf("LibdropErrorInstanceStop")
var ErrLibdropErrorInvalidPrivkey = fmt.Errorf("LibdropErrorInvalidPrivkey")
var ErrLibdropErrorInvalidString = fmt.Errorf("LibdropErrorInvalidString")
var ErrLibdropErrorNotStarted = fmt.Errorf("LibdropErrorNotStarted")
var ErrLibdropErrorTransferCreate = fmt.Errorf("LibdropErrorTransferCreate")
var ErrLibdropErrorUnknown = fmt.Errorf("LibdropErrorUnknown")
Err* are used for checking error type with `errors.Is`
var FfiConverterBoolINSTANCE = FfiConverterBool{}
var FfiConverterBytesINSTANCE = FfiConverterBytes{}
var FfiConverterCallbackInterfaceEventCallbackINSTANCE = &FfiConverterCallbackInterfaceEventCallback{ FfiConverterCallbackInterface: FfiConverterCallbackInterface[EventCallback]{ handleMap: newConcurrentHandleMap[EventCallback](), }, }
var FfiConverterCallbackInterfaceFdResolverINSTANCE = &FfiConverterCallbackInterfaceFdResolver{ FfiConverterCallbackInterface: FfiConverterCallbackInterface[FdResolver]{ handleMap: newConcurrentHandleMap[FdResolver](), }, }
var FfiConverterCallbackInterfaceKeyStoreINSTANCE = &FfiConverterCallbackInterfaceKeyStore{ FfiConverterCallbackInterface: FfiConverterCallbackInterface[KeyStore]{ handleMap: newConcurrentHandleMap[KeyStore](), }, }
var FfiConverterCallbackInterfaceLoggerINSTANCE = &FfiConverterCallbackInterfaceLogger{ FfiConverterCallbackInterface: FfiConverterCallbackInterface[Logger]{ handleMap: newConcurrentHandleMap[Logger](), }, }
var FfiConverterInt32INSTANCE = FfiConverterInt32{}
var FfiConverterInt64INSTANCE = FfiConverterInt64{}
var FfiConverterNordDropINSTANCE = FfiConverterNordDrop{}
var FfiConverterOptionalBytesINSTANCE = FfiConverterOptionalBytes{}
var FfiConverterOptionalInt32INSTANCE = FfiConverterOptionalInt32{}
var FfiConverterOptionalStringINSTANCE = FfiConverterOptionalString{}
var FfiConverterOptionalUint32INSTANCE = FfiConverterOptionalUint32{}
var FfiConverterOptionalUint64INSTANCE = FfiConverterOptionalUint64{}
var FfiConverterSequenceStringINSTANCE = FfiConverterSequenceString{}
var FfiConverterSequenceTypeIncomingPathINSTANCE = FfiConverterSequenceTypeIncomingPath{}
var FfiConverterSequenceTypeIncomingPathStateINSTANCE = FfiConverterSequenceTypeIncomingPathState{}
var FfiConverterSequenceTypeOutgoingPathINSTANCE = FfiConverterSequenceTypeOutgoingPath{}
var FfiConverterSequenceTypeOutgoingPathStateINSTANCE = FfiConverterSequenceTypeOutgoingPathState{}
var FfiConverterSequenceTypeQueuedFileINSTANCE = FfiConverterSequenceTypeQueuedFile{}
var FfiConverterSequenceTypeReceivedFileINSTANCE = FfiConverterSequenceTypeReceivedFile{}
var FfiConverterSequenceTypeTransferDescriptorINSTANCE = FfiConverterSequenceTypeTransferDescriptor{}
var FfiConverterSequenceTypeTransferInfoINSTANCE = FfiConverterSequenceTypeTransferInfo{}
var FfiConverterSequenceTypeTransferStateINSTANCE = FfiConverterSequenceTypeTransferState{}
var FfiConverterStringINSTANCE = FfiConverterString{}
var FfiConverterTypeConfigINSTANCE = FfiConverterTypeConfig{}
var FfiConverterTypeEventINSTANCE = FfiConverterTypeEvent{}
var FfiConverterTypeEventKindINSTANCE = FfiConverterTypeEventKind{}
var FfiConverterTypeIncomingPathINSTANCE = FfiConverterTypeIncomingPath{}
var FfiConverterTypeIncomingPathStateINSTANCE = FfiConverterTypeIncomingPathState{}
var FfiConverterTypeIncomingPathStateKindINSTANCE = FfiConverterTypeIncomingPathStateKind{}
var FfiConverterTypeLibdropErrorINSTANCE = FfiConverterTypeLibdropError{}
var FfiConverterTypeLogLevelINSTANCE = FfiConverterTypeLogLevel{}
var FfiConverterTypeOutgoingFileSourceINSTANCE = FfiConverterTypeOutgoingFileSource{}
var FfiConverterTypeOutgoingPathINSTANCE = FfiConverterTypeOutgoingPath{}
var FfiConverterTypeOutgoingPathStateINSTANCE = FfiConverterTypeOutgoingPathState{}
var FfiConverterTypeOutgoingPathStateKindINSTANCE = FfiConverterTypeOutgoingPathStateKind{}
var FfiConverterTypeQueuedFileINSTANCE = FfiConverterTypeQueuedFile{}
var FfiConverterTypeReceivedFileINSTANCE = FfiConverterTypeReceivedFile{}
var FfiConverterTypeStatusCodeINSTANCE = FfiConverterTypeStatusCode{}
var FfiConverterTypeStatusINSTANCE = FfiConverterTypeStatus{}
var FfiConverterTypeTransferDescriptorINSTANCE = FfiConverterTypeTransferDescriptor{}
var FfiConverterTypeTransferInfoINSTANCE = FfiConverterTypeTransferInfo{}
var FfiConverterTypeTransferKindINSTANCE = FfiConverterTypeTransferKind{}
var FfiConverterTypeTransferStateINSTANCE = FfiConverterTypeTransferState{}
var FfiConverterTypeTransferStateKindINSTANCE = FfiConverterTypeTransferStateKind{}
var FfiConverterUint32INSTANCE = FfiConverterUint32{}
var FfiConverterUint64INSTANCE = FfiConverterUint64{}
Functions ¶
func LiftFromRustBuffer ¶
func LiftFromRustBuffer[GoType any](bufReader BufReader[GoType], rbuf RustBufferI) GoType
Types ¶
type BufLifter ¶
type BufLifter[GoType any] interface { Lift(value RustBufferI) GoType }
type BufLowerer ¶
type BufLowerer[GoType any] interface { Lower(value GoType) RustBuffer }
type Config ¶
type Config struct { // If the transfer directory tree contains more levels then the error is // returned. DirDepthLimit uint64 // When aggregating files from the path, if this limit is reached, an error // is returned. TransferFileLimit uint64 // Moose database path MooseEventPath string // Moose production flag MooseProd bool // Storage path for persistence engine StoragePath string // Emit checksum events only if file is equal or greater than this size. // If omited, no checksumming events are emited. ChecksumEventsSizeThreshold *uint64 // Emit checksum events at set granularity ChecksumEventsGranularity *uint64 // Limits the number of burst connection retries after the // `network_refresh()` call. Setting this to `0` or `1` gives an effect of // only one retry after `network_refresh()` call. // When set to `n > 1` the retry happens in a burst of `n` times and the // interval between burst retries is increased by the power of 2 starting // from 1-second interval. For example for `n = 5` the retries happen // * 1st burst retry immediately // * 2nd burst retry after 1s the previous burst retry // * 3rd burst retry after 2s the previous burst retry // * 4th burst retry after 4s the previous burst retry // * 5th burst retry after 8s the previous burst retry // When set to `null` the default of 5 burst retries is used. ConnectionRetries *uint32 // Enable auto retry loop inside libdrop. Conceptually this means that // libdrop is calling `network_refresh()` automatically with the given // period in milliseconds. When set to `null` the feature is disabled and // the application needs to call `network_refresh()` manually. // Note the setting `connection_retries` still applies, meaning the retry // is executed in burst with this number of counts. // For example for a single retry every 5 seconds the application needs to // set `connection_retries` to `1` or `0` and `auto_retry_interval_ms = 5000`. AutoRetryIntervalMs *uint32 }
The configuration structure
type EventCallback ¶
type EventCallback interface { // Method called whenever event occurs OnEvent(event Event) }
The event callback
type EventKindFileDownloaded ¶
The file has been successfully downloaded.
func (EventKindFileDownloaded) Destroy ¶
func (e EventKindFileDownloaded) Destroy()
type EventKindFileFailed ¶
File transfer has failed.
func (EventKindFileFailed) Destroy ¶
func (e EventKindFileFailed) Destroy()
type EventKindFilePaused ¶
Emited automatically for each file in flight in case the peer goes offline but the transfer will be resumed.
func (EventKindFilePaused) Destroy ¶
func (e EventKindFilePaused) Destroy()
type EventKindFilePending ¶
Indicates that the file transfer is registered and ready. It is emitted as a response to the `download()` call.
func (EventKindFilePending) Destroy ¶
func (e EventKindFilePending) Destroy()
type EventKindFileProgress ¶
Emitted whenever an amount of data for a single file is transferred between peers. Valid for both sending and receiving peers.
func (EventKindFileProgress) Destroy ¶
func (e EventKindFileProgress) Destroy()
type EventKindFileRejected ¶
The file was rejected.
func (EventKindFileRejected) Destroy ¶
func (e EventKindFileRejected) Destroy()
type EventKindFileStarted ¶
Emitted when a file transfer is started. Valid for both sending and receiving peers.
func (EventKindFileStarted) Destroy ¶
func (e EventKindFileStarted) Destroy()
type EventKindFileThrottled ¶
The event may be emitted before the outgoing file is started. It’s an indication of a delayed transfer because of too many active outgoing files in flight. Whenever the number of active files decreases the file will proceed with the TransferStarted event. Valid for sending peers.
func (EventKindFileThrottled) Destroy ¶
func (e EventKindFileThrottled) Destroy()
type EventKindFileUploaded ¶
The file has been successfully uploaded.
func (EventKindFileUploaded) Destroy ¶
func (e EventKindFileUploaded) Destroy()
type EventKindFinalizeChecksumFinished ¶
Reports finalize checksum finished(downloader side only).
func (EventKindFinalizeChecksumFinished) Destroy ¶
func (e EventKindFinalizeChecksumFinished) Destroy()
type EventKindFinalizeChecksumProgress ¶
type EventKindFinalizeChecksumProgress struct { TransferId string FileId string BytesChecksummed uint64 }
Reports finalize checksumming progress(downloader side only).
func (EventKindFinalizeChecksumProgress) Destroy ¶
func (e EventKindFinalizeChecksumProgress) Destroy()
type EventKindFinalizeChecksumStarted ¶
On the downloader side is emitted when the checksum calculation starts. It happens after the download.
func (EventKindFinalizeChecksumStarted) Destroy ¶
func (e EventKindFinalizeChecksumStarted) Destroy()
type EventKindRequestQueued ¶
type EventKindRequestQueued struct { Peer string TransferId string Files []QueuedFile }
Emitted when the application creates a transfer.
func (EventKindRequestQueued) Destroy ¶
func (e EventKindRequestQueued) Destroy()
type EventKindRequestReceived ¶
type EventKindRequestReceived struct { Peer string TransferId string Files []ReceivedFile }
Emitted when the application receives a transfer request from the peer. It contains the peer IP address, transfer ID, and file list.
func (EventKindRequestReceived) Destroy ¶
func (e EventKindRequestReceived) Destroy()
type EventKindRuntimeError ¶
type EventKindRuntimeError struct {
Status StatusCode
}
This event is used to indicate some runtime error that is not related to the transfer. For example database errors due to automatic retries.
func (EventKindRuntimeError) Destroy ¶
func (e EventKindRuntimeError) Destroy()
type EventKindTransferDeferred ¶
Indicates that the connection made towards the peer was unsuccessful. It might be emitted as a response to the `network_refresh()` call.
func (EventKindTransferDeferred) Destroy ¶
func (e EventKindTransferDeferred) Destroy()
type EventKindTransferFailed ¶
The whole transfer has failed.
func (EventKindTransferFailed) Destroy ¶
func (e EventKindTransferFailed) Destroy()
type EventKindTransferFinalized ¶
Transfer is finalized and no further action on the transfer are possible.
func (EventKindTransferFinalized) Destroy ¶
func (e EventKindTransferFinalized) Destroy()
type EventKindVerifyChecksumFinished ¶
Reports verify checksum finished(downloader side only).
func (EventKindVerifyChecksumFinished) Destroy ¶
func (e EventKindVerifyChecksumFinished) Destroy()
type EventKindVerifyChecksumProgress ¶
type EventKindVerifyChecksumProgress struct { TransferId string FileId string BytesChecksummed uint64 }
Reports verify checksumming progress(downloader side only).
func (EventKindVerifyChecksumProgress) Destroy ¶
func (e EventKindVerifyChecksumProgress) Destroy()
type EventKindVerifyChecksumStarted ¶
On the downloader side is emitted when the checksum calculation starts. It happens when resuming the download.
func (EventKindVerifyChecksumStarted) Destroy ¶
func (e EventKindVerifyChecksumStarted) Destroy()
type FdResolver ¶
Profides the file descriptor based on the content URI
# Warning Can be used only on UNIX systems
type FfiConverter ¶
type FfiConverterBool ¶
type FfiConverterBool struct{}
type FfiConverterBytes ¶
type FfiConverterBytes struct{}
func (FfiConverterBytes) Lift ¶
func (c FfiConverterBytes) Lift(rb RustBufferI) []byte
func (FfiConverterBytes) Lower ¶
func (c FfiConverterBytes) Lower(value []byte) RustBuffer
type FfiConverterCallbackInterface ¶
type FfiConverterCallbackInterface[CallbackInterface any] struct { // contains filtered or unexported fields }
func (*FfiConverterCallbackInterface[CallbackInterface]) Lift ¶
func (c *FfiConverterCallbackInterface[CallbackInterface]) Lift(handle uint64) CallbackInterface
func (*FfiConverterCallbackInterface[CallbackInterface]) Lower ¶
func (c *FfiConverterCallbackInterface[CallbackInterface]) Lower(value CallbackInterface) C.uint64_t
func (*FfiConverterCallbackInterface[CallbackInterface]) Read ¶
func (c *FfiConverterCallbackInterface[CallbackInterface]) Read(reader io.Reader) CallbackInterface
func (*FfiConverterCallbackInterface[CallbackInterface]) Write ¶
func (c *FfiConverterCallbackInterface[CallbackInterface]) Write(writer io.Writer, value CallbackInterface)
type FfiConverterCallbackInterfaceEventCallback ¶
type FfiConverterCallbackInterfaceEventCallback struct { FfiConverterCallbackInterface[EventCallback] }
type FfiConverterCallbackInterfaceFdResolver ¶
type FfiConverterCallbackInterfaceFdResolver struct { FfiConverterCallbackInterface[FdResolver] }
type FfiConverterCallbackInterfaceKeyStore ¶
type FfiConverterCallbackInterfaceKeyStore struct { FfiConverterCallbackInterface[KeyStore] }
type FfiConverterCallbackInterfaceLogger ¶
type FfiConverterCallbackInterfaceLogger struct { FfiConverterCallbackInterface[Logger] }
type FfiConverterInt32 ¶
type FfiConverterInt32 struct{}
type FfiConverterInt64 ¶
type FfiConverterInt64 struct{}
type FfiConverterNordDrop ¶
type FfiConverterNordDrop struct{}
func (FfiConverterNordDrop) Lift ¶
func (c FfiConverterNordDrop) Lift(pointer unsafe.Pointer) *NordDrop
type FfiConverterOptionalBytes ¶
type FfiConverterOptionalBytes struct{}
func (FfiConverterOptionalBytes) Lift ¶
func (c FfiConverterOptionalBytes) Lift(rb RustBufferI) *[]byte
func (FfiConverterOptionalBytes) Lower ¶
func (c FfiConverterOptionalBytes) Lower(value *[]byte) RustBuffer
type FfiConverterOptionalInt32 ¶
type FfiConverterOptionalInt32 struct{}
func (FfiConverterOptionalInt32) Lift ¶
func (c FfiConverterOptionalInt32) Lift(rb RustBufferI) *int32
func (FfiConverterOptionalInt32) Lower ¶
func (c FfiConverterOptionalInt32) Lower(value *int32) RustBuffer
type FfiConverterOptionalString ¶
type FfiConverterOptionalString struct{}
func (FfiConverterOptionalString) Lift ¶
func (c FfiConverterOptionalString) Lift(rb RustBufferI) *string
func (FfiConverterOptionalString) Lower ¶
func (c FfiConverterOptionalString) Lower(value *string) RustBuffer
type FfiConverterOptionalUint32 ¶
type FfiConverterOptionalUint32 struct{}
func (FfiConverterOptionalUint32) Lift ¶
func (c FfiConverterOptionalUint32) Lift(rb RustBufferI) *uint32
func (FfiConverterOptionalUint32) Lower ¶
func (c FfiConverterOptionalUint32) Lower(value *uint32) RustBuffer
type FfiConverterOptionalUint64 ¶
type FfiConverterOptionalUint64 struct{}
func (FfiConverterOptionalUint64) Lift ¶
func (c FfiConverterOptionalUint64) Lift(rb RustBufferI) *uint64
func (FfiConverterOptionalUint64) Lower ¶
func (c FfiConverterOptionalUint64) Lower(value *uint64) RustBuffer
type FfiConverterSequenceString ¶
type FfiConverterSequenceString struct{}
func (FfiConverterSequenceString) Lift ¶
func (c FfiConverterSequenceString) Lift(rb RustBufferI) []string
func (FfiConverterSequenceString) Lower ¶
func (c FfiConverterSequenceString) Lower(value []string) RustBuffer
type FfiConverterSequenceTypeIncomingPath ¶
type FfiConverterSequenceTypeIncomingPath struct{}
func (FfiConverterSequenceTypeIncomingPath) Lift ¶
func (c FfiConverterSequenceTypeIncomingPath) Lift(rb RustBufferI) []IncomingPath
func (FfiConverterSequenceTypeIncomingPath) Lower ¶
func (c FfiConverterSequenceTypeIncomingPath) Lower(value []IncomingPath) RustBuffer
func (FfiConverterSequenceTypeIncomingPath) Read ¶
func (c FfiConverterSequenceTypeIncomingPath) Read(reader io.Reader) []IncomingPath
func (FfiConverterSequenceTypeIncomingPath) Write ¶
func (c FfiConverterSequenceTypeIncomingPath) Write(writer io.Writer, value []IncomingPath)
type FfiConverterSequenceTypeIncomingPathState ¶
type FfiConverterSequenceTypeIncomingPathState struct{}
func (FfiConverterSequenceTypeIncomingPathState) Lift ¶
func (c FfiConverterSequenceTypeIncomingPathState) Lift(rb RustBufferI) []IncomingPathState
func (FfiConverterSequenceTypeIncomingPathState) Lower ¶
func (c FfiConverterSequenceTypeIncomingPathState) Lower(value []IncomingPathState) RustBuffer
func (FfiConverterSequenceTypeIncomingPathState) Read ¶
func (c FfiConverterSequenceTypeIncomingPathState) Read(reader io.Reader) []IncomingPathState
func (FfiConverterSequenceTypeIncomingPathState) Write ¶
func (c FfiConverterSequenceTypeIncomingPathState) Write(writer io.Writer, value []IncomingPathState)
type FfiConverterSequenceTypeOutgoingPath ¶
type FfiConverterSequenceTypeOutgoingPath struct{}
func (FfiConverterSequenceTypeOutgoingPath) Lift ¶
func (c FfiConverterSequenceTypeOutgoingPath) Lift(rb RustBufferI) []OutgoingPath
func (FfiConverterSequenceTypeOutgoingPath) Lower ¶
func (c FfiConverterSequenceTypeOutgoingPath) Lower(value []OutgoingPath) RustBuffer
func (FfiConverterSequenceTypeOutgoingPath) Read ¶
func (c FfiConverterSequenceTypeOutgoingPath) Read(reader io.Reader) []OutgoingPath
func (FfiConverterSequenceTypeOutgoingPath) Write ¶
func (c FfiConverterSequenceTypeOutgoingPath) Write(writer io.Writer, value []OutgoingPath)
type FfiConverterSequenceTypeOutgoingPathState ¶
type FfiConverterSequenceTypeOutgoingPathState struct{}
func (FfiConverterSequenceTypeOutgoingPathState) Lift ¶
func (c FfiConverterSequenceTypeOutgoingPathState) Lift(rb RustBufferI) []OutgoingPathState
func (FfiConverterSequenceTypeOutgoingPathState) Lower ¶
func (c FfiConverterSequenceTypeOutgoingPathState) Lower(value []OutgoingPathState) RustBuffer
func (FfiConverterSequenceTypeOutgoingPathState) Read ¶
func (c FfiConverterSequenceTypeOutgoingPathState) Read(reader io.Reader) []OutgoingPathState
func (FfiConverterSequenceTypeOutgoingPathState) Write ¶
func (c FfiConverterSequenceTypeOutgoingPathState) Write(writer io.Writer, value []OutgoingPathState)
type FfiConverterSequenceTypeQueuedFile ¶
type FfiConverterSequenceTypeQueuedFile struct{}
func (FfiConverterSequenceTypeQueuedFile) Lift ¶
func (c FfiConverterSequenceTypeQueuedFile) Lift(rb RustBufferI) []QueuedFile
func (FfiConverterSequenceTypeQueuedFile) Lower ¶
func (c FfiConverterSequenceTypeQueuedFile) Lower(value []QueuedFile) RustBuffer
func (FfiConverterSequenceTypeQueuedFile) Read ¶
func (c FfiConverterSequenceTypeQueuedFile) Read(reader io.Reader) []QueuedFile
func (FfiConverterSequenceTypeQueuedFile) Write ¶
func (c FfiConverterSequenceTypeQueuedFile) Write(writer io.Writer, value []QueuedFile)
type FfiConverterSequenceTypeReceivedFile ¶
type FfiConverterSequenceTypeReceivedFile struct{}
func (FfiConverterSequenceTypeReceivedFile) Lift ¶
func (c FfiConverterSequenceTypeReceivedFile) Lift(rb RustBufferI) []ReceivedFile
func (FfiConverterSequenceTypeReceivedFile) Lower ¶
func (c FfiConverterSequenceTypeReceivedFile) Lower(value []ReceivedFile) RustBuffer
func (FfiConverterSequenceTypeReceivedFile) Read ¶
func (c FfiConverterSequenceTypeReceivedFile) Read(reader io.Reader) []ReceivedFile
func (FfiConverterSequenceTypeReceivedFile) Write ¶
func (c FfiConverterSequenceTypeReceivedFile) Write(writer io.Writer, value []ReceivedFile)
type FfiConverterSequenceTypeTransferDescriptor ¶
type FfiConverterSequenceTypeTransferDescriptor struct{}
func (FfiConverterSequenceTypeTransferDescriptor) Lift ¶
func (c FfiConverterSequenceTypeTransferDescriptor) Lift(rb RustBufferI) []TransferDescriptor
func (FfiConverterSequenceTypeTransferDescriptor) Lower ¶
func (c FfiConverterSequenceTypeTransferDescriptor) Lower(value []TransferDescriptor) RustBuffer
func (FfiConverterSequenceTypeTransferDescriptor) Read ¶
func (c FfiConverterSequenceTypeTransferDescriptor) Read(reader io.Reader) []TransferDescriptor
func (FfiConverterSequenceTypeTransferDescriptor) Write ¶
func (c FfiConverterSequenceTypeTransferDescriptor) Write(writer io.Writer, value []TransferDescriptor)
type FfiConverterSequenceTypeTransferInfo ¶
type FfiConverterSequenceTypeTransferInfo struct{}
func (FfiConverterSequenceTypeTransferInfo) Lift ¶
func (c FfiConverterSequenceTypeTransferInfo) Lift(rb RustBufferI) []TransferInfo
func (FfiConverterSequenceTypeTransferInfo) Lower ¶
func (c FfiConverterSequenceTypeTransferInfo) Lower(value []TransferInfo) RustBuffer
func (FfiConverterSequenceTypeTransferInfo) Read ¶
func (c FfiConverterSequenceTypeTransferInfo) Read(reader io.Reader) []TransferInfo
func (FfiConverterSequenceTypeTransferInfo) Write ¶
func (c FfiConverterSequenceTypeTransferInfo) Write(writer io.Writer, value []TransferInfo)
type FfiConverterSequenceTypeTransferState ¶
type FfiConverterSequenceTypeTransferState struct{}
func (FfiConverterSequenceTypeTransferState) Lift ¶
func (c FfiConverterSequenceTypeTransferState) Lift(rb RustBufferI) []TransferState
func (FfiConverterSequenceTypeTransferState) Lower ¶
func (c FfiConverterSequenceTypeTransferState) Lower(value []TransferState) RustBuffer
func (FfiConverterSequenceTypeTransferState) Read ¶
func (c FfiConverterSequenceTypeTransferState) Read(reader io.Reader) []TransferState
func (FfiConverterSequenceTypeTransferState) Write ¶
func (c FfiConverterSequenceTypeTransferState) Write(writer io.Writer, value []TransferState)
type FfiConverterString ¶
type FfiConverterString struct{}
func (FfiConverterString) Lift ¶
func (FfiConverterString) Lift(rb RustBufferI) string
func (FfiConverterString) Lower ¶
func (FfiConverterString) Lower(value string) RustBuffer
type FfiConverterTypeConfig ¶
type FfiConverterTypeConfig struct{}
func (FfiConverterTypeConfig) Lift ¶
func (c FfiConverterTypeConfig) Lift(rb RustBufferI) Config
func (FfiConverterTypeConfig) Lower ¶
func (c FfiConverterTypeConfig) Lower(value Config) RustBuffer
type FfiConverterTypeEvent ¶
type FfiConverterTypeEvent struct{}
func (FfiConverterTypeEvent) Lift ¶
func (c FfiConverterTypeEvent) Lift(rb RustBufferI) Event
func (FfiConverterTypeEvent) Lower ¶
func (c FfiConverterTypeEvent) Lower(value Event) RustBuffer
type FfiConverterTypeEventKind ¶
type FfiConverterTypeEventKind struct{}
func (FfiConverterTypeEventKind) Lift ¶
func (c FfiConverterTypeEventKind) Lift(rb RustBufferI) EventKind
func (FfiConverterTypeEventKind) Lower ¶
func (c FfiConverterTypeEventKind) Lower(value EventKind) RustBuffer
type FfiConverterTypeIncomingPath ¶
type FfiConverterTypeIncomingPath struct{}
func (FfiConverterTypeIncomingPath) Lift ¶
func (c FfiConverterTypeIncomingPath) Lift(rb RustBufferI) IncomingPath
func (FfiConverterTypeIncomingPath) Lower ¶
func (c FfiConverterTypeIncomingPath) Lower(value IncomingPath) RustBuffer
func (FfiConverterTypeIncomingPath) Read ¶
func (c FfiConverterTypeIncomingPath) Read(reader io.Reader) IncomingPath
func (FfiConverterTypeIncomingPath) Write ¶
func (c FfiConverterTypeIncomingPath) Write(writer io.Writer, value IncomingPath)
type FfiConverterTypeIncomingPathState ¶
type FfiConverterTypeIncomingPathState struct{}
func (FfiConverterTypeIncomingPathState) Lift ¶
func (c FfiConverterTypeIncomingPathState) Lift(rb RustBufferI) IncomingPathState
func (FfiConverterTypeIncomingPathState) Lower ¶
func (c FfiConverterTypeIncomingPathState) Lower(value IncomingPathState) RustBuffer
func (FfiConverterTypeIncomingPathState) Read ¶
func (c FfiConverterTypeIncomingPathState) Read(reader io.Reader) IncomingPathState
func (FfiConverterTypeIncomingPathState) Write ¶
func (c FfiConverterTypeIncomingPathState) Write(writer io.Writer, value IncomingPathState)
type FfiConverterTypeIncomingPathStateKind ¶
type FfiConverterTypeIncomingPathStateKind struct{}
func (FfiConverterTypeIncomingPathStateKind) Lift ¶
func (c FfiConverterTypeIncomingPathStateKind) Lift(rb RustBufferI) IncomingPathStateKind
func (FfiConverterTypeIncomingPathStateKind) Lower ¶
func (c FfiConverterTypeIncomingPathStateKind) Lower(value IncomingPathStateKind) RustBuffer
func (FfiConverterTypeIncomingPathStateKind) Read ¶
func (FfiConverterTypeIncomingPathStateKind) Read(reader io.Reader) IncomingPathStateKind
func (FfiConverterTypeIncomingPathStateKind) Write ¶
func (FfiConverterTypeIncomingPathStateKind) Write(writer io.Writer, value IncomingPathStateKind)
type FfiConverterTypeLibdropError ¶
type FfiConverterTypeLibdropError struct{}
func (FfiConverterTypeLibdropError) Lift ¶
func (c FfiConverterTypeLibdropError) Lift(eb RustBufferI) error
func (FfiConverterTypeLibdropError) Lower ¶
func (c FfiConverterTypeLibdropError) Lower(value *LibdropError) RustBuffer
func (FfiConverterTypeLibdropError) Read ¶
func (c FfiConverterTypeLibdropError) Read(reader io.Reader) error
func (FfiConverterTypeLibdropError) Write ¶
func (c FfiConverterTypeLibdropError) Write(writer io.Writer, value *LibdropError)
type FfiConverterTypeLogLevel ¶
type FfiConverterTypeLogLevel struct{}
func (FfiConverterTypeLogLevel) Lift ¶
func (c FfiConverterTypeLogLevel) Lift(rb RustBufferI) LogLevel
func (FfiConverterTypeLogLevel) Lower ¶
func (c FfiConverterTypeLogLevel) Lower(value LogLevel) RustBuffer
type FfiConverterTypeOutgoingFileSource ¶
type FfiConverterTypeOutgoingFileSource struct{}
func (FfiConverterTypeOutgoingFileSource) Lift ¶
func (c FfiConverterTypeOutgoingFileSource) Lift(rb RustBufferI) OutgoingFileSource
func (FfiConverterTypeOutgoingFileSource) Lower ¶
func (c FfiConverterTypeOutgoingFileSource) Lower(value OutgoingFileSource) RustBuffer
func (FfiConverterTypeOutgoingFileSource) Read ¶
func (FfiConverterTypeOutgoingFileSource) Read(reader io.Reader) OutgoingFileSource
func (FfiConverterTypeOutgoingFileSource) Write ¶
func (FfiConverterTypeOutgoingFileSource) Write(writer io.Writer, value OutgoingFileSource)
type FfiConverterTypeOutgoingPath ¶
type FfiConverterTypeOutgoingPath struct{}
func (FfiConverterTypeOutgoingPath) Lift ¶
func (c FfiConverterTypeOutgoingPath) Lift(rb RustBufferI) OutgoingPath
func (FfiConverterTypeOutgoingPath) Lower ¶
func (c FfiConverterTypeOutgoingPath) Lower(value OutgoingPath) RustBuffer
func (FfiConverterTypeOutgoingPath) Read ¶
func (c FfiConverterTypeOutgoingPath) Read(reader io.Reader) OutgoingPath
func (FfiConverterTypeOutgoingPath) Write ¶
func (c FfiConverterTypeOutgoingPath) Write(writer io.Writer, value OutgoingPath)
type FfiConverterTypeOutgoingPathState ¶
type FfiConverterTypeOutgoingPathState struct{}
func (FfiConverterTypeOutgoingPathState) Lift ¶
func (c FfiConverterTypeOutgoingPathState) Lift(rb RustBufferI) OutgoingPathState
func (FfiConverterTypeOutgoingPathState) Lower ¶
func (c FfiConverterTypeOutgoingPathState) Lower(value OutgoingPathState) RustBuffer
func (FfiConverterTypeOutgoingPathState) Read ¶
func (c FfiConverterTypeOutgoingPathState) Read(reader io.Reader) OutgoingPathState
func (FfiConverterTypeOutgoingPathState) Write ¶
func (c FfiConverterTypeOutgoingPathState) Write(writer io.Writer, value OutgoingPathState)
type FfiConverterTypeOutgoingPathStateKind ¶
type FfiConverterTypeOutgoingPathStateKind struct{}
func (FfiConverterTypeOutgoingPathStateKind) Lift ¶
func (c FfiConverterTypeOutgoingPathStateKind) Lift(rb RustBufferI) OutgoingPathStateKind
func (FfiConverterTypeOutgoingPathStateKind) Lower ¶
func (c FfiConverterTypeOutgoingPathStateKind) Lower(value OutgoingPathStateKind) RustBuffer
func (FfiConverterTypeOutgoingPathStateKind) Read ¶
func (FfiConverterTypeOutgoingPathStateKind) Read(reader io.Reader) OutgoingPathStateKind
func (FfiConverterTypeOutgoingPathStateKind) Write ¶
func (FfiConverterTypeOutgoingPathStateKind) Write(writer io.Writer, value OutgoingPathStateKind)
type FfiConverterTypeQueuedFile ¶
type FfiConverterTypeQueuedFile struct{}
func (FfiConverterTypeQueuedFile) Lift ¶
func (c FfiConverterTypeQueuedFile) Lift(rb RustBufferI) QueuedFile
func (FfiConverterTypeQueuedFile) Lower ¶
func (c FfiConverterTypeQueuedFile) Lower(value QueuedFile) RustBuffer
func (FfiConverterTypeQueuedFile) Read ¶
func (c FfiConverterTypeQueuedFile) Read(reader io.Reader) QueuedFile
func (FfiConverterTypeQueuedFile) Write ¶
func (c FfiConverterTypeQueuedFile) Write(writer io.Writer, value QueuedFile)
type FfiConverterTypeReceivedFile ¶
type FfiConverterTypeReceivedFile struct{}
func (FfiConverterTypeReceivedFile) Lift ¶
func (c FfiConverterTypeReceivedFile) Lift(rb RustBufferI) ReceivedFile
func (FfiConverterTypeReceivedFile) Lower ¶
func (c FfiConverterTypeReceivedFile) Lower(value ReceivedFile) RustBuffer
func (FfiConverterTypeReceivedFile) Read ¶
func (c FfiConverterTypeReceivedFile) Read(reader io.Reader) ReceivedFile
func (FfiConverterTypeReceivedFile) Write ¶
func (c FfiConverterTypeReceivedFile) Write(writer io.Writer, value ReceivedFile)
type FfiConverterTypeStatus ¶
type FfiConverterTypeStatus struct{}
func (FfiConverterTypeStatus) Lift ¶
func (c FfiConverterTypeStatus) Lift(rb RustBufferI) Status
func (FfiConverterTypeStatus) Lower ¶
func (c FfiConverterTypeStatus) Lower(value Status) RustBuffer
type FfiConverterTypeStatusCode ¶
type FfiConverterTypeStatusCode struct{}
func (FfiConverterTypeStatusCode) Lift ¶
func (c FfiConverterTypeStatusCode) Lift(rb RustBufferI) StatusCode
func (FfiConverterTypeStatusCode) Lower ¶
func (c FfiConverterTypeStatusCode) Lower(value StatusCode) RustBuffer
func (FfiConverterTypeStatusCode) Read ¶
func (FfiConverterTypeStatusCode) Read(reader io.Reader) StatusCode
func (FfiConverterTypeStatusCode) Write ¶
func (FfiConverterTypeStatusCode) Write(writer io.Writer, value StatusCode)
type FfiConverterTypeTransferDescriptor ¶
type FfiConverterTypeTransferDescriptor struct{}
func (FfiConverterTypeTransferDescriptor) Lift ¶
func (c FfiConverterTypeTransferDescriptor) Lift(rb RustBufferI) TransferDescriptor
func (FfiConverterTypeTransferDescriptor) Lower ¶
func (c FfiConverterTypeTransferDescriptor) Lower(value TransferDescriptor) RustBuffer
func (FfiConverterTypeTransferDescriptor) Read ¶
func (FfiConverterTypeTransferDescriptor) Read(reader io.Reader) TransferDescriptor
func (FfiConverterTypeTransferDescriptor) Write ¶
func (FfiConverterTypeTransferDescriptor) Write(writer io.Writer, value TransferDescriptor)
type FfiConverterTypeTransferInfo ¶
type FfiConverterTypeTransferInfo struct{}
func (FfiConverterTypeTransferInfo) Lift ¶
func (c FfiConverterTypeTransferInfo) Lift(rb RustBufferI) TransferInfo
func (FfiConverterTypeTransferInfo) Lower ¶
func (c FfiConverterTypeTransferInfo) Lower(value TransferInfo) RustBuffer
func (FfiConverterTypeTransferInfo) Read ¶
func (c FfiConverterTypeTransferInfo) Read(reader io.Reader) TransferInfo
func (FfiConverterTypeTransferInfo) Write ¶
func (c FfiConverterTypeTransferInfo) Write(writer io.Writer, value TransferInfo)
type FfiConverterTypeTransferKind ¶
type FfiConverterTypeTransferKind struct{}
func (FfiConverterTypeTransferKind) Lift ¶
func (c FfiConverterTypeTransferKind) Lift(rb RustBufferI) TransferKind
func (FfiConverterTypeTransferKind) Lower ¶
func (c FfiConverterTypeTransferKind) Lower(value TransferKind) RustBuffer
func (FfiConverterTypeTransferKind) Read ¶
func (FfiConverterTypeTransferKind) Read(reader io.Reader) TransferKind
func (FfiConverterTypeTransferKind) Write ¶
func (FfiConverterTypeTransferKind) Write(writer io.Writer, value TransferKind)
type FfiConverterTypeTransferState ¶
type FfiConverterTypeTransferState struct{}
func (FfiConverterTypeTransferState) Lift ¶
func (c FfiConverterTypeTransferState) Lift(rb RustBufferI) TransferState
func (FfiConverterTypeTransferState) Lower ¶
func (c FfiConverterTypeTransferState) Lower(value TransferState) RustBuffer
func (FfiConverterTypeTransferState) Read ¶
func (c FfiConverterTypeTransferState) Read(reader io.Reader) TransferState
func (FfiConverterTypeTransferState) Write ¶
func (c FfiConverterTypeTransferState) Write(writer io.Writer, value TransferState)
type FfiConverterTypeTransferStateKind ¶
type FfiConverterTypeTransferStateKind struct{}
func (FfiConverterTypeTransferStateKind) Lift ¶
func (c FfiConverterTypeTransferStateKind) Lift(rb RustBufferI) TransferStateKind
func (FfiConverterTypeTransferStateKind) Lower ¶
func (c FfiConverterTypeTransferStateKind) Lower(value TransferStateKind) RustBuffer
func (FfiConverterTypeTransferStateKind) Read ¶
func (FfiConverterTypeTransferStateKind) Read(reader io.Reader) TransferStateKind
func (FfiConverterTypeTransferStateKind) Write ¶
func (FfiConverterTypeTransferStateKind) Write(writer io.Writer, value TransferStateKind)
type FfiConverterUint32 ¶
type FfiConverterUint32 struct{}
type FfiConverterUint64 ¶
type FfiConverterUint64 struct{}
type FfiDestroyerBool ¶
type FfiDestroyerBool struct{}
func (FfiDestroyerBool) Destroy ¶
func (FfiDestroyerBool) Destroy(_ bool)
type FfiDestroyerBytes ¶
type FfiDestroyerBytes struct{}
func (FfiDestroyerBytes) Destroy ¶
func (FfiDestroyerBytes) Destroy(_ []byte)
type FfiDestroyerCallbackInterfaceEventCallback ¶
type FfiDestroyerCallbackInterfaceEventCallback struct{}
func (FfiDestroyerCallbackInterfaceEventCallback) Destroy ¶
func (FfiDestroyerCallbackInterfaceEventCallback) Destroy(value EventCallback)
type FfiDestroyerCallbackInterfaceFdResolver ¶
type FfiDestroyerCallbackInterfaceFdResolver struct{}
func (FfiDestroyerCallbackInterfaceFdResolver) Destroy ¶
func (FfiDestroyerCallbackInterfaceFdResolver) Destroy(value FdResolver)
type FfiDestroyerCallbackInterfaceKeyStore ¶
type FfiDestroyerCallbackInterfaceKeyStore struct{}
func (FfiDestroyerCallbackInterfaceKeyStore) Destroy ¶
func (FfiDestroyerCallbackInterfaceKeyStore) Destroy(value KeyStore)
type FfiDestroyerCallbackInterfaceLogger ¶
type FfiDestroyerCallbackInterfaceLogger struct{}
func (FfiDestroyerCallbackInterfaceLogger) Destroy ¶
func (FfiDestroyerCallbackInterfaceLogger) Destroy(value Logger)
type FfiDestroyerInt32 ¶
type FfiDestroyerInt32 struct{}
func (FfiDestroyerInt32) Destroy ¶
func (FfiDestroyerInt32) Destroy(_ int32)
type FfiDestroyerInt64 ¶
type FfiDestroyerInt64 struct{}
func (FfiDestroyerInt64) Destroy ¶
func (FfiDestroyerInt64) Destroy(_ int64)
type FfiDestroyerNordDrop ¶
type FfiDestroyerNordDrop struct{}
func (FfiDestroyerNordDrop) Destroy ¶
func (_ FfiDestroyerNordDrop) Destroy(value *NordDrop)
type FfiDestroyerOptionalBytes ¶
type FfiDestroyerOptionalBytes struct{}
func (FfiDestroyerOptionalBytes) Destroy ¶
func (_ FfiDestroyerOptionalBytes) Destroy(value *[]byte)
type FfiDestroyerOptionalInt32 ¶
type FfiDestroyerOptionalInt32 struct{}
func (FfiDestroyerOptionalInt32) Destroy ¶
func (_ FfiDestroyerOptionalInt32) Destroy(value *int32)
type FfiDestroyerOptionalString ¶
type FfiDestroyerOptionalString struct{}
func (FfiDestroyerOptionalString) Destroy ¶
func (_ FfiDestroyerOptionalString) Destroy(value *string)
type FfiDestroyerOptionalUint32 ¶
type FfiDestroyerOptionalUint32 struct{}
func (FfiDestroyerOptionalUint32) Destroy ¶
func (_ FfiDestroyerOptionalUint32) Destroy(value *uint32)
type FfiDestroyerOptionalUint64 ¶
type FfiDestroyerOptionalUint64 struct{}
func (FfiDestroyerOptionalUint64) Destroy ¶
func (_ FfiDestroyerOptionalUint64) Destroy(value *uint64)
type FfiDestroyerSequenceString ¶
type FfiDestroyerSequenceString struct{}
func (FfiDestroyerSequenceString) Destroy ¶
func (FfiDestroyerSequenceString) Destroy(sequence []string)
type FfiDestroyerSequenceTypeIncomingPath ¶
type FfiDestroyerSequenceTypeIncomingPath struct{}
func (FfiDestroyerSequenceTypeIncomingPath) Destroy ¶
func (FfiDestroyerSequenceTypeIncomingPath) Destroy(sequence []IncomingPath)
type FfiDestroyerSequenceTypeIncomingPathState ¶
type FfiDestroyerSequenceTypeIncomingPathState struct{}
func (FfiDestroyerSequenceTypeIncomingPathState) Destroy ¶
func (FfiDestroyerSequenceTypeIncomingPathState) Destroy(sequence []IncomingPathState)
type FfiDestroyerSequenceTypeOutgoingPath ¶
type FfiDestroyerSequenceTypeOutgoingPath struct{}
func (FfiDestroyerSequenceTypeOutgoingPath) Destroy ¶
func (FfiDestroyerSequenceTypeOutgoingPath) Destroy(sequence []OutgoingPath)
type FfiDestroyerSequenceTypeOutgoingPathState ¶
type FfiDestroyerSequenceTypeOutgoingPathState struct{}
func (FfiDestroyerSequenceTypeOutgoingPathState) Destroy ¶
func (FfiDestroyerSequenceTypeOutgoingPathState) Destroy(sequence []OutgoingPathState)
type FfiDestroyerSequenceTypeQueuedFile ¶
type FfiDestroyerSequenceTypeQueuedFile struct{}
func (FfiDestroyerSequenceTypeQueuedFile) Destroy ¶
func (FfiDestroyerSequenceTypeQueuedFile) Destroy(sequence []QueuedFile)
type FfiDestroyerSequenceTypeReceivedFile ¶
type FfiDestroyerSequenceTypeReceivedFile struct{}
func (FfiDestroyerSequenceTypeReceivedFile) Destroy ¶
func (FfiDestroyerSequenceTypeReceivedFile) Destroy(sequence []ReceivedFile)
type FfiDestroyerSequenceTypeTransferDescriptor ¶
type FfiDestroyerSequenceTypeTransferDescriptor struct{}
func (FfiDestroyerSequenceTypeTransferDescriptor) Destroy ¶
func (FfiDestroyerSequenceTypeTransferDescriptor) Destroy(sequence []TransferDescriptor)
type FfiDestroyerSequenceTypeTransferInfo ¶
type FfiDestroyerSequenceTypeTransferInfo struct{}
func (FfiDestroyerSequenceTypeTransferInfo) Destroy ¶
func (FfiDestroyerSequenceTypeTransferInfo) Destroy(sequence []TransferInfo)
type FfiDestroyerSequenceTypeTransferState ¶
type FfiDestroyerSequenceTypeTransferState struct{}
func (FfiDestroyerSequenceTypeTransferState) Destroy ¶
func (FfiDestroyerSequenceTypeTransferState) Destroy(sequence []TransferState)
type FfiDestroyerString ¶
type FfiDestroyerString struct{}
func (FfiDestroyerString) Destroy ¶
func (FfiDestroyerString) Destroy(_ string)
type FfiDestroyerTypeConfig ¶
type FfiDestroyerTypeConfig struct{}
func (FfiDestroyerTypeConfig) Destroy ¶
func (_ FfiDestroyerTypeConfig) Destroy(value Config)
type FfiDestroyerTypeEvent ¶
type FfiDestroyerTypeEvent struct{}
func (FfiDestroyerTypeEvent) Destroy ¶
func (_ FfiDestroyerTypeEvent) Destroy(value Event)
type FfiDestroyerTypeEventKind ¶
type FfiDestroyerTypeEventKind struct{}
func (FfiDestroyerTypeEventKind) Destroy ¶
func (_ FfiDestroyerTypeEventKind) Destroy(value EventKind)
type FfiDestroyerTypeIncomingPath ¶
type FfiDestroyerTypeIncomingPath struct{}
func (FfiDestroyerTypeIncomingPath) Destroy ¶
func (_ FfiDestroyerTypeIncomingPath) Destroy(value IncomingPath)
type FfiDestroyerTypeIncomingPathState ¶
type FfiDestroyerTypeIncomingPathState struct{}
func (FfiDestroyerTypeIncomingPathState) Destroy ¶
func (_ FfiDestroyerTypeIncomingPathState) Destroy(value IncomingPathState)
type FfiDestroyerTypeIncomingPathStateKind ¶
type FfiDestroyerTypeIncomingPathStateKind struct{}
func (FfiDestroyerTypeIncomingPathStateKind) Destroy ¶
func (_ FfiDestroyerTypeIncomingPathStateKind) Destroy(value IncomingPathStateKind)
type FfiDestroyerTypeLogLevel ¶
type FfiDestroyerTypeLogLevel struct{}
func (FfiDestroyerTypeLogLevel) Destroy ¶
func (_ FfiDestroyerTypeLogLevel) Destroy(value LogLevel)
type FfiDestroyerTypeOutgoingFileSource ¶
type FfiDestroyerTypeOutgoingFileSource struct{}
func (FfiDestroyerTypeOutgoingFileSource) Destroy ¶
func (_ FfiDestroyerTypeOutgoingFileSource) Destroy(value OutgoingFileSource)
type FfiDestroyerTypeOutgoingPath ¶
type FfiDestroyerTypeOutgoingPath struct{}
func (FfiDestroyerTypeOutgoingPath) Destroy ¶
func (_ FfiDestroyerTypeOutgoingPath) Destroy(value OutgoingPath)
type FfiDestroyerTypeOutgoingPathState ¶
type FfiDestroyerTypeOutgoingPathState struct{}
func (FfiDestroyerTypeOutgoingPathState) Destroy ¶
func (_ FfiDestroyerTypeOutgoingPathState) Destroy(value OutgoingPathState)
type FfiDestroyerTypeOutgoingPathStateKind ¶
type FfiDestroyerTypeOutgoingPathStateKind struct{}
func (FfiDestroyerTypeOutgoingPathStateKind) Destroy ¶
func (_ FfiDestroyerTypeOutgoingPathStateKind) Destroy(value OutgoingPathStateKind)
type FfiDestroyerTypeQueuedFile ¶
type FfiDestroyerTypeQueuedFile struct{}
func (FfiDestroyerTypeQueuedFile) Destroy ¶
func (_ FfiDestroyerTypeQueuedFile) Destroy(value QueuedFile)
type FfiDestroyerTypeReceivedFile ¶
type FfiDestroyerTypeReceivedFile struct{}
func (FfiDestroyerTypeReceivedFile) Destroy ¶
func (_ FfiDestroyerTypeReceivedFile) Destroy(value ReceivedFile)
type FfiDestroyerTypeStatus ¶
type FfiDestroyerTypeStatus struct{}
func (FfiDestroyerTypeStatus) Destroy ¶
func (_ FfiDestroyerTypeStatus) Destroy(value Status)
type FfiDestroyerTypeStatusCode ¶
type FfiDestroyerTypeStatusCode struct{}
func (FfiDestroyerTypeStatusCode) Destroy ¶
func (_ FfiDestroyerTypeStatusCode) Destroy(value StatusCode)
type FfiDestroyerTypeTransferDescriptor ¶
type FfiDestroyerTypeTransferDescriptor struct{}
func (FfiDestroyerTypeTransferDescriptor) Destroy ¶
func (_ FfiDestroyerTypeTransferDescriptor) Destroy(value TransferDescriptor)
type FfiDestroyerTypeTransferInfo ¶
type FfiDestroyerTypeTransferInfo struct{}
func (FfiDestroyerTypeTransferInfo) Destroy ¶
func (_ FfiDestroyerTypeTransferInfo) Destroy(value TransferInfo)
type FfiDestroyerTypeTransferKind ¶
type FfiDestroyerTypeTransferKind struct{}
func (FfiDestroyerTypeTransferKind) Destroy ¶
func (_ FfiDestroyerTypeTransferKind) Destroy(value TransferKind)
type FfiDestroyerTypeTransferState ¶
type FfiDestroyerTypeTransferState struct{}
func (FfiDestroyerTypeTransferState) Destroy ¶
func (_ FfiDestroyerTypeTransferState) Destroy(value TransferState)
type FfiDestroyerTypeTransferStateKind ¶
type FfiDestroyerTypeTransferStateKind struct{}
func (FfiDestroyerTypeTransferStateKind) Destroy ¶
func (_ FfiDestroyerTypeTransferStateKind) Destroy(value TransferStateKind)
type FfiDestroyerUint32 ¶
type FfiDestroyerUint32 struct{}
func (FfiDestroyerUint32) Destroy ¶
func (FfiDestroyerUint32) Destroy(_ uint32)
type FfiDestroyerUint64 ¶
type FfiDestroyerUint64 struct{}
func (FfiDestroyerUint64) Destroy ¶
func (FfiDestroyerUint64) Destroy(_ uint64)
type FfiRustBufConverter ¶
type FfiRustBufConverter[GoType any, FfiType any] interface { FfiConverter[GoType, FfiType] BufReader[GoType] }
type IncomingPath ¶
type IncomingPath struct { // File ID FileId string // File path relative to the transfer's root directory RelativePath string // File size Bytes uint64 // Curently received file bytes BytesReceived uint64 // History of the file state chagnes States []IncomingPathState }
The description and history of a signle incoming file
func (*IncomingPath) Destroy ¶
func (r *IncomingPath) Destroy()
type IncomingPathState ¶
type IncomingPathState struct { // The creation time as a UNIX timestamp in milliseconds. CreatedAt int64 // The type of the state change. Kind IncomingPathStateKind }
A single change in the incoming file state
func (*IncomingPathState) Destroy ¶
func (r *IncomingPathState) Destroy()
type IncomingPathStateKind ¶
type IncomingPathStateKind interface {
Destroy()
}
Description of incoming file states. Some states are considered **terminal**. Terminal states appear once and it is the final state. Other states might appear multiple times.
type IncomingPathStateKindCompleted ¶
type IncomingPathStateKindCompleted struct {
FinalPath string
}
The file was successfully received and saved to the disk. Contains the final path of the file. This is a **terminal** state.
func (IncomingPathStateKindCompleted) Destroy ¶
func (e IncomingPathStateKindCompleted) Destroy()
type IncomingPathStateKindFailed ¶
type IncomingPathStateKindFailed struct { Status StatusCode BytesReceived uint64 }
Contains status code of failure. This is a **terminal** state.
func (IncomingPathStateKindFailed) Destroy ¶
func (e IncomingPathStateKindFailed) Destroy()
type IncomingPathStateKindPaused ¶
type IncomingPathStateKindPaused struct {
BytesReceived uint64
}
The file was paused due to recoverable errors. Most probably due to network availability.
func (IncomingPathStateKindPaused) Destroy ¶
func (e IncomingPathStateKindPaused) Destroy()
type IncomingPathStateKindPending ¶
type IncomingPathStateKindPending struct {
BaseDir string
}
The download was issued for this file and it will proceed when possible.
func (IncomingPathStateKindPending) Destroy ¶
func (e IncomingPathStateKindPending) Destroy()
type IncomingPathStateKindRejected ¶
The file was rejected by the receiver. Contains indicator of who rejected the file. This is a **terminal** state.
func (IncomingPathStateKindRejected) Destroy ¶
func (e IncomingPathStateKindRejected) Destroy()
type IncomingPathStateKindStarted ¶
type IncomingPathStateKindStarted struct {
BytesReceived uint64
}
The file was started to be received. Contains the base directory of the file.
func (IncomingPathStateKindStarted) Destroy ¶
func (e IncomingPathStateKindStarted) Destroy()
type KeyStore ¶
type KeyStore interface { // It is used to request // the app to provide the peer’s public key or the node itself. // // # Arguments // * `peer` - peer's IP address // // # Returns // 32bytes private key. Note that it’s not BASE64, it must // be decoded if it is beforehand. // The `null` value is used to indicate that the key could not be // provided. OnPubkey(peer string) *[]byte // 32bytes private key // // # Warning // This it’s not BASE64, it must // be decoded if it is beforehand. Privkey() []byte }
The interface for providing crypto keys
type LibdropError ¶
type LibdropError struct {
// contains filtered or unexported fields
}
The commmon error type thrown from functions
func NewLibdropErrorAddrInUse ¶
func NewLibdropErrorAddrInUse() *LibdropError
Address already in use
func NewLibdropErrorBadInput ¶
func NewLibdropErrorBadInput() *LibdropError
One of the arguments provided is invalid
func NewLibdropErrorInstanceStart ¶
func NewLibdropErrorInstanceStart() *LibdropError
Failed to start the libdrop instance
func NewLibdropErrorInstanceStop ¶
func NewLibdropErrorInstanceStop() *LibdropError
Failed to stop the libdrop instance
func NewLibdropErrorInvalidPrivkey ¶
func NewLibdropErrorInvalidPrivkey() *LibdropError
Invalid private key provided
func NewLibdropErrorInvalidString ¶
func NewLibdropErrorInvalidString() *LibdropError
The string provided is not valid UTF8
func NewLibdropErrorNotStarted ¶
func NewLibdropErrorNotStarted() *LibdropError
The libdrop instance is not started yet
func NewLibdropErrorTransferCreate ¶
func NewLibdropErrorTransferCreate() *LibdropError
Failed to create transfer based on arguments provided
func NewLibdropErrorUnknown ¶
func NewLibdropErrorUnknown() *LibdropError
Operation resulted to unknown error.
func (LibdropError) Error ¶
func (err LibdropError) Error() string
func (LibdropError) Unwrap ¶
func (err LibdropError) Unwrap() error
type LibdropErrorAddrInUse ¶
type LibdropErrorAddrInUse struct {
// contains filtered or unexported fields
}
Address already in use
func (LibdropErrorAddrInUse) Error ¶
func (err LibdropErrorAddrInUse) Error() string
func (LibdropErrorAddrInUse) Is ¶
func (self LibdropErrorAddrInUse) Is(target error) bool
type LibdropErrorBadInput ¶
type LibdropErrorBadInput struct {
// contains filtered or unexported fields
}
One of the arguments provided is invalid
func (LibdropErrorBadInput) Error ¶
func (err LibdropErrorBadInput) Error() string
func (LibdropErrorBadInput) Is ¶
func (self LibdropErrorBadInput) Is(target error) bool
type LibdropErrorDbError ¶
type LibdropErrorDbError struct {
// contains filtered or unexported fields
}
Database error
func (LibdropErrorDbError) Error ¶
func (err LibdropErrorDbError) Error() string
func (LibdropErrorDbError) Is ¶
func (self LibdropErrorDbError) Is(target error) bool
type LibdropErrorInstanceStart ¶
type LibdropErrorInstanceStart struct {
// contains filtered or unexported fields
}
Failed to start the libdrop instance
func (LibdropErrorInstanceStart) Error ¶
func (err LibdropErrorInstanceStart) Error() string
func (LibdropErrorInstanceStart) Is ¶
func (self LibdropErrorInstanceStart) Is(target error) bool
type LibdropErrorInstanceStop ¶
type LibdropErrorInstanceStop struct {
// contains filtered or unexported fields
}
Failed to stop the libdrop instance
func (LibdropErrorInstanceStop) Error ¶
func (err LibdropErrorInstanceStop) Error() string
func (LibdropErrorInstanceStop) Is ¶
func (self LibdropErrorInstanceStop) Is(target error) bool
type LibdropErrorInvalidPrivkey ¶
type LibdropErrorInvalidPrivkey struct {
// contains filtered or unexported fields
}
Invalid private key provided
func (LibdropErrorInvalidPrivkey) Error ¶
func (err LibdropErrorInvalidPrivkey) Error() string
func (LibdropErrorInvalidPrivkey) Is ¶
func (self LibdropErrorInvalidPrivkey) Is(target error) bool
type LibdropErrorInvalidString ¶
type LibdropErrorInvalidString struct {
// contains filtered or unexported fields
}
The string provided is not valid UTF8
func (LibdropErrorInvalidString) Error ¶
func (err LibdropErrorInvalidString) Error() string
func (LibdropErrorInvalidString) Is ¶
func (self LibdropErrorInvalidString) Is(target error) bool
type LibdropErrorNotStarted ¶
type LibdropErrorNotStarted struct {
// contains filtered or unexported fields
}
The libdrop instance is not started yet
func (LibdropErrorNotStarted) Error ¶
func (err LibdropErrorNotStarted) Error() string
func (LibdropErrorNotStarted) Is ¶
func (self LibdropErrorNotStarted) Is(target error) bool
type LibdropErrorTransferCreate ¶
type LibdropErrorTransferCreate struct {
// contains filtered or unexported fields
}
Failed to create transfer based on arguments provided
func (LibdropErrorTransferCreate) Error ¶
func (err LibdropErrorTransferCreate) Error() string
func (LibdropErrorTransferCreate) Is ¶
func (self LibdropErrorTransferCreate) Is(target error) bool
type LibdropErrorUnknown ¶
type LibdropErrorUnknown struct {
// contains filtered or unexported fields
}
Variant structs Operation resulted to unknown error.
func (LibdropErrorUnknown) Error ¶
func (err LibdropErrorUnknown) Error() string
func (LibdropErrorUnknown) Is ¶
func (self LibdropErrorUnknown) Is(target error) bool
type Logger ¶
type Logger interface { // Function called when log message occurs OnLog(level LogLevel, msg string) // Maximum log level Level() LogLevel }
The logger callback interface
type NordDrop ¶
type NordDrop struct {
// contains filtered or unexported fields
}
func NewNordDrop ¶
func NewNordDrop(eventCb EventCallback, keyStore KeyStore, logger Logger) (*NordDrop, error)
Create a new instance of norddrop. This is a required step to work with API further
# Arguments * `event_cb` - Event callback * `logger` - Logger callback * `key_store` - Fetches peer's public key and provides own private key.
func (*NordDrop) DownloadFile ¶
Download a file from the peer ¶
# Arguments * `transfer_id` - Transfer UUID * `file_id` - File ID * `destination` - Destination path
func (*NordDrop) FinalizeTransfer ¶
Finalizes the transfer from either side ¶
# Arguments * `transfer_id`: Transfer UUID
func (*NordDrop) NetworkRefresh ¶
Refresh connections. Should be called when anything about the network changes that might affect connections. Also when peer availability has changed. This will kick-start the automated retries for all transfers.
func (*NordDrop) NewTransfer ¶
func (_self *NordDrop) NewTransfer(peer string, descriptors []TransferDescriptor) (string, error)
Initialize a new transfer with the provided peer and descriptors
# Arguments * `peer` - Peer address. * `descriptors` - transfer file descriptors.
# Returns A String containing the transfer UUID.
func (*NordDrop) PurgeTransfers ¶
Purge transfers from the database
# Arguments * `transfer_ids` - array of transfer UUIDs
func (*NordDrop) PurgeTransfersUntil ¶
Purge transfers from the database until the given timestamp
# Arguments * `until` - Unix timestamp in milliseconds
func (*NordDrop) RejectFile ¶
Reject a file from either side
# Arguments * `transfer_id`: Transfer UUID * `file_id`: File ID
func (*NordDrop) RemoveFile ¶
Removes a single transfer file from the database. The file must be in the **terminal** state beforehand, otherwise the error is returned.
# Arguments
* `transfer_id`: Transfer UUID * `file_id`: File ID
func (*NordDrop) SetFdResolver ¶
func (_self *NordDrop) SetFdResolver(resolver FdResolver) error
Set a file descriptor (FD) resolver callback. The callback provides FDs based on URI. This function should be called before `start()`, otherwise it will return an error.
# Arguments * `resolver`: The resolver structure
# Warning This function is intended to be called only on UNIX platforms
func (*NordDrop) Start ¶
Starts libdrop
# Arguments * `addr` - Address to listen on * `config` - configuration
Configuration Parameters ¶
* `dir_depth_limit` - if the tree contains more levels then the error is returned.
* `transfer_file_limit` - when aggregating files from the path, if this limit is reached, an error is returned.
* `moose_event_path` - moose database path.
* `moose_prod` - moose production flag.
* `storage_path` - storage path for persistence engine.
- `checksum_events_size_threshold_bytes` - emit checksum events only if file is equal or greater than this size. If omited, no checksumming events are emited.
# Safety The pointers provided must be valid
func (*NordDrop) TransfersSince ¶
func (_self *NordDrop) TransfersSince(since int64) ([]TransferInfo, error)
Get transfers from the database
# Arguments * `since_timestamp` - UNIX timestamp in milliseconds
type OutgoingFileSource ¶
type OutgoingFileSource interface {
Destroy()
}
The outgoing file data source
type OutgoingFileSourceBasePath ¶
type OutgoingFileSourceBasePath struct {
BasePath string
}
The file is read from disk, from the given path
func (OutgoingFileSourceBasePath) Destroy ¶
func (e OutgoingFileSourceBasePath) Destroy()
type OutgoingFileSourceContentUri ¶
type OutgoingFileSourceContentUri struct {
Uri string
}
The file descriptor is retrieved with the FD resolver
# Warning This mechanism can only be used on UNIX systems
func (OutgoingFileSourceContentUri) Destroy ¶
func (e OutgoingFileSourceContentUri) Destroy()
type OutgoingPath ¶
type OutgoingPath struct { // File ID FileId string // File path relative to the transfer's root directory RelativePath string // File size Bytes uint64 // Curently transferred file bytes BytesSent uint64 // The source of the file data Source OutgoingFileSource // History of the file state chagnes States []OutgoingPathState }
The description and history of a signle outgoing file
func (*OutgoingPath) Destroy ¶
func (r *OutgoingPath) Destroy()
type OutgoingPathState ¶
type OutgoingPathState struct { // The creation time as a UNIX timestamp in milliseconds. CreatedAt int64 // The type of the state change. Kind OutgoingPathStateKind }
The description and history of a signle outgoing file
func (*OutgoingPathState) Destroy ¶
func (r *OutgoingPathState) Destroy()
type OutgoingPathStateKind ¶
type OutgoingPathStateKind interface {
Destroy()
}
Description of outgoing file states. Some states are considered **terminal**. Terminal states appear once and it is the final state. Other states might appear multiple times.
type OutgoingPathStateKindCompleted ¶
type OutgoingPathStateKindCompleted struct { }
The file was successfully received and saved to the disk. Contains the final path of the file. This is a **terminal** state.
func (OutgoingPathStateKindCompleted) Destroy ¶
func (e OutgoingPathStateKindCompleted) Destroy()
type OutgoingPathStateKindFailed ¶
type OutgoingPathStateKindFailed struct { Status StatusCode BytesSent uint64 }
Contains status code of failure. This is a **terminal** state.
func (OutgoingPathStateKindFailed) Destroy ¶
func (e OutgoingPathStateKindFailed) Destroy()
type OutgoingPathStateKindPaused ¶
type OutgoingPathStateKindPaused struct {
BytesSent uint64
}
The file was paused due to recoverable errors. Most probably due to network availability.
func (OutgoingPathStateKindPaused) Destroy ¶
func (e OutgoingPathStateKindPaused) Destroy()
type OutgoingPathStateKindRejected ¶
The file was rejected by the receiver. Contains indicator of who rejected the file. This is a **terminal** state.
func (OutgoingPathStateKindRejected) Destroy ¶
func (e OutgoingPathStateKindRejected) Destroy()
type OutgoingPathStateKindStarted ¶
type OutgoingPathStateKindStarted struct {
BytesSent uint64
}
The file was started to be received. Contains the base directory of the file.
func (OutgoingPathStateKindStarted) Destroy ¶
func (e OutgoingPathStateKindStarted) Destroy()
type QueuedFile ¶
type QueuedFile struct { // File ID Id string // File path Path string // File size Size uint64 // File base directory BaseDir *string }
The outgoing transfer file structure
func (*QueuedFile) Destroy ¶
func (r *QueuedFile) Destroy()
type ReceivedFile ¶
The incoming transfer file structure
func (*ReceivedFile) Destroy ¶
func (r *ReceivedFile) Destroy()
type RustBuffer ¶
type RustBuffer = C.RustBuffer
func LowerIntoRustBuffer ¶
func LowerIntoRustBuffer[GoType any](bufWriter BufWriter[GoType], value GoType) RustBuffer
func RustBufferFromExternal ¶
func RustBufferFromExternal(b RustBufferI) RustBuffer
func (RustBuffer) AsReader ¶
func (cb RustBuffer) AsReader() *bytes.Reader
func (RustBuffer) Capacity ¶
func (cb RustBuffer) Capacity() int
func (RustBuffer) Data ¶
func (cb RustBuffer) Data() unsafe.Pointer
func (RustBuffer) Free ¶
func (cb RustBuffer) Free()
func (RustBuffer) Len ¶
func (cb RustBuffer) Len() int
func (RustBuffer) ToGoBytes ¶
func (cb RustBuffer) ToGoBytes() []byte
type RustBufferI ¶
type Status ¶
type Status struct { // Status code Status StatusCode // OS error number if available OsErrorCode *int32 }
The common state structure
type StatusCode ¶
type StatusCode uint
Status codes returend by the events
const ( // Not an error per se; indicates finalized transfers. StatusCodeFinalized StatusCode = 1 // An invalid path was provided. // File path contains invalid components (e.g. parent `..`). StatusCodeBadPath StatusCode = 2 // Failed to open the file or file doesn’t exist when asked to download. Might // indicate bad API usage. For Unix platforms using file descriptors, it might // indicate invalid FD being passed to libdrop. StatusCodeBadFile StatusCode = 3 // Invalid input transfer ID passed. StatusCodeBadTransfer StatusCode = 4 // An error occurred during the transfer and it cannot continue. The most probable // reason is the error occurred on the peer’s device or other error that cannot be // categorize elsewhere. StatusCodeBadTransferState StatusCode = 5 // Invalid input file ID passed when. StatusCodeBadFileId StatusCode = 6 // General IO error. Check the logs and contact libdrop team. StatusCodeIoError StatusCode = 7 // Transfer limits exceeded. Limit is in terms of depth and breadth for // directories. StatusCodeTransferLimitsExceeded StatusCode = 8 // The file size has changed since adding it to the transfer. The original file was // modified while not in flight in such a way that its size changed. StatusCodeMismatchedSize StatusCode = 9 // An invalid argument was provided either as a function argument or // invalid config value. StatusCodeInvalidArgument StatusCode = 10 // The WebSocket server failed to bind because of an address collision. StatusCodeAddrInUse StatusCode = 11 // The file was modified while being uploaded. StatusCodeFileModified StatusCode = 12 // The filename is too long which might be due to the fact the sender uses // a filesystem supporting longer filenames than the one which’s downloading the // file. StatusCodeFilenameTooLong StatusCode = 13 // A peer couldn’t validate our authentication request. StatusCodeAuthenticationFailed StatusCode = 14 // Persistence error. StatusCodeStorageError StatusCode = 15 // The persistence database is lost. A new database will be created. StatusCodeDbLost StatusCode = 16 // Downloaded file checksum differs from the advertised one. The downloaded // file is deleted by libdrop. StatusCodeFileChecksumMismatch StatusCode = 17 // Download is impossible of the rejected file. StatusCodeFileRejected StatusCode = 18 // Action is blocked because the failed condition has been reached. StatusCodeFileFailed StatusCode = 19 // Action is blocked because the file is already transferred. StatusCodeFileFinished StatusCode = 20 // Transfer requested with empty file list. StatusCodeEmptyTransfer StatusCode = 21 // Transfer resume attempt was closed by peer for no reason. It might indicate // temporary issues on the peer’s side. It is safe to continue to resume the // transfer. StatusCodeConnectionClosedByPeer StatusCode = 22 // Peer’s DDoS protection kicked in. // Transfer should be resumed after some cooldown period. StatusCodeTooManyRequests StatusCode = 23 // This error code is intercepted from the OS errors. Indicate lack of // privileges to do certain operation. StatusCodePermissionDenied StatusCode = 24 )
type TransferDescriptor ¶
type TransferDescriptor interface {
Destroy()
}
The transfer file description
type TransferDescriptorFd ¶
File descriptor with the given URI (used for the `FdResolver`)
func (TransferDescriptorFd) Destroy ¶
func (e TransferDescriptorFd) Destroy()
type TransferDescriptorPath ¶
type TransferDescriptorPath struct {
Path string
}
Disk file with the given path
func (TransferDescriptorPath) Destroy ¶
func (e TransferDescriptorPath) Destroy()
type TransferInfo ¶
type TransferInfo struct { // Transfer UUID Id string // The creation time as a UNIX timestamp in milliseconds. CreatedAt int64 // Peer's IP address Peer string // History of transfer states States []TransferState // The transfer type description Kind TransferKind }
Transfer and files in it contain history of states that can be used to replay what happened and the last state denotes the current state of the transfer.
func (*TransferInfo) Destroy ¶
func (r *TransferInfo) Destroy()
type TransferKindIncoming ¶
type TransferKindIncoming struct {
Paths []IncomingPath
}
The transfer is incoming, meaning we are the one who receives the files
func (TransferKindIncoming) Destroy ¶
func (e TransferKindIncoming) Destroy()
type TransferKindOutgoing ¶
type TransferKindOutgoing struct {
Paths []OutgoingPath
}
The transfer is incoming, meaning we are the one who sends the files
func (TransferKindOutgoing) Destroy ¶
func (e TransferKindOutgoing) Destroy()
type TransferState ¶
type TransferState struct { // The creation time as a UNIX timestamp in milliseconds. CreatedAt int64 // The type of the state change. Kind TransferStateKind }
A single change in the transfer state
func (*TransferState) Destroy ¶
func (r *TransferState) Destroy()
type TransferStateKind ¶
type TransferStateKind interface {
Destroy()
}
Description of the transfer state
type TransferStateKindCancel ¶
type TransferStateKindCancel struct {
ByPeer bool
}
The transfer was successfully canceled by either peer. Contains indicator of who canceled the transfer.
func (TransferStateKindCancel) Destroy ¶
func (e TransferStateKindCancel) Destroy()
type TransferStateKindFailed ¶
type TransferStateKindFailed struct {
Status StatusCode
}
Contains status code of failure.
func (TransferStateKindFailed) Destroy ¶
func (e TransferStateKindFailed) Destroy()