Documentation ¶
Index ¶
- Variables
- func ContextWithLogger(ctx context.Context, logger Logger) context.Context
- func IdBytesGen() []byte
- func IdGen() string
- func MarshalSized(pb proto.Message) ([]byte, error)
- func Parallel(fn ...func() error) error
- func PathSafeIdEncode(data []byte) string
- func ReaderCompare(readers ...io.ReadCloser) io.ReadCloser
- func ReaderTee(r io.Reader) (io.Reader, io.Reader)
- func UnmarshalSized(source io.Reader, pb proto.Message) error
- type FramingReader
- type LogLevel
- type LogWrapper
- type Logger
- type LoggerFunc
- type ReaderBuf
- type ReaderFunc
- type UnframingReader
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrComparisonMismatch = errs.Class("reader comparer mismatch")
)
Functions ¶
func IdBytesGen ¶
func IdBytesGen() []byte
func PathSafeIdEncode ¶
func ReaderCompare ¶
func ReaderCompare(readers ...io.ReadCloser) io.ReadCloser
ReaderCompare will return an io.ReadCloser that will error if any Reader returns data that doesn't match the others.
Types ¶
type FramingReader ¶
type FramingReader struct {
// contains filtered or unexported fields
}
func NewFramingReader ¶
func NewFramingReader(r io.Reader) *FramingReader
type LogWrapper ¶
type LogWrapper struct {
Logger
}
func L ¶
func L(ctx context.Context) LogWrapper
func (LogWrapper) Debugf ¶
func (l LogWrapper) Debugf(format string, v ...interface{})
func (LogWrapper) Normalf ¶
func (l LogWrapper) Normalf(format string, v ...interface{})
func (LogWrapper) Urgentf ¶
func (l LogWrapper) Urgentf(format string, v ...interface{})
type Logger ¶
func StandardLogger ¶
type LoggerFunc ¶
func (LoggerFunc) Printf ¶
func (f LoggerFunc) Printf(level LogLevel, format string, v ...interface{})
type ReaderBuf ¶
type ReaderBuf struct {
// contains filtered or unexported fields
}
ReaderBuf wraps a Reader with a goroutine that fills an internal buffer of the next read. Using ReaderBuf will keep the next read pipelined and ready. Calling a read (however small) will trigger the next pipelined read up to the internal buffer size. If you want many small reads, this should probably be wrapped in a bufio.Reader. ReaderBuf should be closed when done to make sure the goroutine gets shut down.
func NewReaderBuf ¶
func NewReaderBuf(r io.ReadCloser) *ReaderBuf
type ReaderFunc ¶
type UnframingReader ¶
type UnframingReader struct {
// contains filtered or unexported fields
}
func NewUnframingReader ¶
func NewUnframingReader(r io.Reader) *UnframingReader
Click to show internal directories.
Click to hide internal directories.