Sha256: 5270e507417a3e6a4ef31a7cff7201ecb30990a43dda40b0e6dcefbda8b391f4

Contents?: true

Size: 1.51 KB

Versions: 396

Compression:

Stored size: 1.51 KB

Contents

package paasio

import "io"

// ReadCounter is an interface describing objects that can be read from,
// and that can count the number of times they have been read from.
//
// If multiple goroutines concurrently call Read, implementations are not
// required to provide any guarantees about interleaving of the Read calls.
// However, implementations MUST guarantee that calls to ReadCount always return
// correct results even in the presence of concurrent Read calls.
type ReadCounter interface {
	io.Reader
	// ReadCount returns the total number of bytes successfully read along
	// with the total number of calls to Read().
	ReadCount() (n int64, nops int)
}

// WriteCounter is an interface describing objects that can be written to,
// and that can count the number of times they have been written to.
//
// If multiple goroutines concurrently call Write, implementations are not
// required to provide any guarantees about interleaving of the Write calls.
// However, implementations MUST guarantee that calls to WriteCount always return
// correct results even in the presence of concurrent Write calls.
type WriteCounter interface {
	io.Writer
	// WriteCount returns the total number of bytes successfully written along
	// with the total number of calls to Write().
	WriteCount() (n int64, nops int)
}

// ReadWriteCounter is the union of ReadCounter and WriteCounter.
//
// All guarantees that apply to either of ReadCounter or WriteCounter
// also apply to ReadWriteCounter.
type ReadWriteCounter interface {
	ReadCounter
	WriteCounter
}

Version data entries

396 entries across 396 versions & 1 rubygems

Version Path
trackler-2.2.1.180 tracks/go/exercises/paasio/interface.go
trackler-2.2.1.179 tracks/go/exercises/paasio/interface.go
trackler-2.2.1.178 tracks/go/exercises/paasio/interface.go
trackler-2.2.1.177 tracks/go/exercises/paasio/interface.go
trackler-2.2.1.176 tracks/go/exercises/paasio/interface.go
trackler-2.2.1.175 tracks/go/exercises/paasio/interface.go
trackler-2.2.1.174 tracks/go/exercises/paasio/interface.go
trackler-2.2.1.173 tracks/go/exercises/paasio/interface.go
trackler-2.2.1.172 tracks/go/exercises/paasio/interface.go
trackler-2.2.1.171 tracks/go/exercises/paasio/interface.go
trackler-2.2.1.170 tracks/go/exercises/paasio/interface.go
trackler-2.2.1.169 tracks/go/exercises/paasio/interface.go
trackler-2.2.1.167 tracks/go/exercises/paasio/interface.go
trackler-2.2.1.166 tracks/go/exercises/paasio/interface.go
trackler-2.2.1.165 tracks/go/exercises/paasio/interface.go
trackler-2.2.1.164 tracks/go/exercises/paasio/interface.go
trackler-2.2.1.163 tracks/go/exercises/paasio/interface.go
trackler-2.2.1.162 tracks/go/exercises/paasio/interface.go
trackler-2.2.1.161 tracks/go/exercises/paasio/interface.go
trackler-2.2.1.160 tracks/go/exercises/paasio/interface.go