File: reader_context.go

package info (click to toggle)
golang-github-anacrolix-missinggo 2.1.0-4
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, sid
  • size: 836 kB
  • sloc: makefile: 4
file content (16 lines) | stat: -rw-r--r-- 289 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
package missinggo

import "context"

type ContextedReader struct {
	R   ReadContexter
	Ctx context.Context
}

func (me ContextedReader) Read(b []byte) (int, error) {
	return me.R.ReadContext(me.Ctx, b)
}

type ReadContexter interface {
	ReadContext(context.Context, []byte) (int, error)
}