chore(tvix/nar-bridge): move to nar-bridge-go
Make some space for the rust implementation. Change-Id: I924dc1657be10abe5a11951c3b9de50bae06db19 Reviewed-on: https://cl.tvl.fyi/c/depot/+/11662 Tested-by: BuildkiteCI Autosubmit: flokli <flokli@flokli.de> Reviewed-by: yuka <yuka@yuka.dev>
This commit is contained in:
parent
ce1aa10b69
commit
1392913e98
32 changed files with 13 additions and 14 deletions
21
tvix/nar-bridge-go/pkg/importer/counting_writer.go
Normal file
21
tvix/nar-bridge-go/pkg/importer/counting_writer.go
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
package importer
|
||||
|
||||
import (
|
||||
"io"
|
||||
)
|
||||
|
||||
// CountingWriter implements io.Writer.
|
||||
var _ io.Writer = &CountingWriter{}
|
||||
|
||||
type CountingWriter struct {
|
||||
bytesWritten uint64
|
||||
}
|
||||
|
||||
func (cw *CountingWriter) Write(p []byte) (n int, err error) {
|
||||
cw.bytesWritten += uint64(len(p))
|
||||
return len(p), nil
|
||||
}
|
||||
|
||||
func (cw *CountingWriter) BytesWritten() uint64 {
|
||||
return cw.bytesWritten
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue