utils

package
v0.0.8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 9, 2025 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ByteCountSI

func ByteCountSI(b int64) string

func CompressStream

func CompressStream(file *os.File, blockSize int) *io.PipeReader

func CopyGeneratedSDPPrompt

func CopyGeneratedSDPPrompt(sdp string)

func DecodeSDP

func DecodeSDP(in string) (*webrtc.SessionDescription, []webrtc.ICECandidateInit, error)

func DecompressStream

func DecompressStream(dataReader io.Reader, blockSize int) *io.PipeReader

func EncodeSDP

func EncodeSDP(sdp *webrtc.SessionDescription, candidates []webrtc.ICECandidateInit) (string, error)

func FormatFileProposal

func FormatFileProposal(fileMDList *controlpb.FileMetadataList) string

func IsArchiveFile

func IsArchiveFile(filePath string) bool

func NewProgressBar

func NewProgressBar(totalBytes int64, peerInfoStr string, isSender bool) *progressbar.ProgressBar

func ValidateDestPath added in v0.0.8

func ValidateDestPath(destPath string) (string, error)

Types

type FileTransfer

type FileTransfer struct {
	TransferUUID uuid.UUID
	FilePath     string
	FileInfo     os.FileInfo
}

func ParseFiles

func ParseFiles(files []string) ([]FileTransfer, error)

type SwapInfo added in v0.0.8

type SwapInfo struct {
	Sdp        *webrtc.SessionDescription `json:"sdp"`
	Candidates []webrtc.ICECandidateInit  `json:"candidates"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL