Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: advanced split options [BREAKING] #311

Merged
merged 14 commits into from
Nov 7, 2024
Prev Previous commit
Next Next commit
Apply suggestions from code review
Co-authored-by: J. Yi <93548144+jyyi1@users.noreply.github.com>
fortuna and jyyi1 authored Nov 6, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
commit b3bdc9ef7bebbfa47590579b572f64e744004b0f
2 changes: 1 addition & 1 deletion transport/split/writer.go
Original file line number Diff line number Diff line change
@@ -34,7 +34,7 @@ type splitWriterReaderFrom struct {

var _ io.ReaderFrom = (*splitWriterReaderFrom)(nil)

// Split Iterator is a function that returns how many bytes until the next split point, or zero if there are no more splits to do.
// SplitIterator is a function that returns how many bytes until the next split point, or zero if there are no more splits to do.
type SplitIterator func() int64

// NewFixedSplitIterator is a helper function that returns a [SplitIterator] that returns the input number once, followed by zero.
2 changes: 1 addition & 1 deletion x/configurl/split.go
Original file line number Diff line number Diff line change
@@ -50,7 +50,7 @@ func registerSplitStreamDialer(r TypeRegistry[transport.StreamDialer], typeID st
}
bytes, err = strconv.ParseInt(subparts[1], 10, 64)
if err != nil {
return nil, fmt.Errorf("bytes is not a number: %v", subparts[0])
return nil, fmt.Errorf("bytes is not a number: %v", subparts[1])
}
default:
return nil, fmt.Errorf("split format must be a comma-separated list of '[$COUNT*]$BYTES' (e.g. '100,5*2'). Got %v", part)