Documentation
¶
Index ¶
- Constants
- func GetVersion() string
- type Block
- type ProcessResult
- type ProcessorConfig
- type RaptorQProcessor
- func (p *RaptorQProcessor) CreateMetadata(inputPath, layoutFile string, blockSize int) (*ProcessResult, error)
- func (p *RaptorQProcessor) DecodeSymbols(symbolsDir, outputPath, layoutPath string) error
- func (p *RaptorQProcessor) EncodeFile(inputPath, outputDir string, blockSize int) (*ProcessResult, error)
- func (p *RaptorQProcessor) Free() bool
- func (p *RaptorQProcessor) GetRecommendedBlockSize(fileSize uint64) int
Constants ¶
const ( DefaultSymbolSize uint16 = 65535 DefaultRedundancyFactor uint8 = 4 DefaultMaxMemoryMB uint64 = 16 * 1024 DefaultConcurrencyLimit uint64 = 4 //MaxMemoryMB_1GB uint64 = 1 * 1024 MaxMemoryMB_4GB uint64 = 4 * 1024 )
Default configuration values These values match the defaults in the Rust library src/lib.rs
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Block ¶
type Block struct {
BlockID uint64 `json:"block_id"`
EncoderParameters []uint8 `json:"encoder_parameters"`
OriginalOffset uint64 `json:"original_offset"`
Size uint64 `json:"size"`
SymbolsCount uint32 `json:"symbols_count"`
SourceSymbolsCount uint32 `json:"source_symbols_count"`
Hash string `json:"hash"`
}
Block represents information about a processed block
type ProcessResult ¶
type ProcessResult struct {
TotalSymbolsCount uint32 `json:"total_symbols_count"`
TotalRepairSymbols uint32 `json:"total_repair_symbols"`
SymbolsDirectory string `json:"symbols_directory"`
Blocks []Block `json:"blocks,omitempty"`
LayoutFilePath string `json:"layout_file_path"`
}
ProcessResult holds information about the processing results
type ProcessorConfig ¶
type ProcessorConfig struct {
SymbolSize uint16 `json:"symbol_size"`
RedundancyFactor uint8 `json:"redundancy_factor"`
MaxMemoryMB uint64 `json:"max_memory_mb"`
ConcurrencyLimit uint64 `json:"concurrency_limit"`
}
ProcessorConfig holds configuration for the RaptorQ processor
type RaptorQProcessor ¶
type RaptorQProcessor struct {
SessionID uintptr
}
RaptorQProcessor represents a RaptorQ processing session
func NewDefaultRaptorQProcessor ¶
func NewDefaultRaptorQProcessor() (*RaptorQProcessor, error)
NewDefaultRaptorQProcessor creates a new RaptorQ processor with default configuration
func NewRaptorQProcessor ¶
func NewRaptorQProcessor(symbolSize uint16, redundancyFactor uint8, maxMemoryMB uint64, concurrencyLimit uint64) (*RaptorQProcessor, error)
NewRaptorQProcessor creates a new RaptorQ processor with the specified configuration
func (*RaptorQProcessor) CreateMetadata ¶
func (p *RaptorQProcessor) CreateMetadata(inputPath, layoutFile string, blockSize int) (*ProcessResult, error)
CreateMetadata creates metadata for RaptorQ encoding without writing symbol data It writes the layout information to the specified layout file
func (*RaptorQProcessor) DecodeSymbols ¶
func (p *RaptorQProcessor) DecodeSymbols(symbolsDir, outputPath, layoutPath string) error
DecodeSymbols decodes RaptorQ symbols back to the original file
func (*RaptorQProcessor) EncodeFile ¶
func (p *RaptorQProcessor) EncodeFile(inputPath, outputDir string, blockSize int) (*ProcessResult, error)
EncodeFile encodes a file using RaptorQ
func (*RaptorQProcessor) Free ¶
func (p *RaptorQProcessor) Free() bool
Free manually frees the RaptorQ session Returns true if the session was successfully freed, false otherwise
func (*RaptorQProcessor) GetRecommendedBlockSize ¶
func (p *RaptorQProcessor) GetRecommendedBlockSize(fileSize uint64) int
GetRecommendedBlockSize returns a recommended block size for a file