Documentation ¶
Index ¶
- Variables
- func Copy(r io.Reader, w io.Writer, c CopyConfig) (e error)
- func RW2Chan(r io.ReadCloser, w io.WriteCloser) (rc, wc chan []byte)
- func ReadAll(r io.Reader, b []byte) ([]byte, error)
- func WithCtxCopy(ctx context.Context, callTree string, copybuf []byte, to time.Duration, ...) error
- func WithCtxTO(ctx context.Context, callTree string, to time.Duration, w io.Writer, ...) io.ReadWriteCloser
- func WriterWithConfig(w io.Writer, c CopyConfig) (wc io.Writer)
- type CopyConfig
- type IOpipe
- type RWC
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func RW2Chan ¶
func RW2Chan(r io.ReadCloser, w io.WriteCloser) (rc, wc chan []byte)
no close rc any time you can close wc, r, w.
func WithCtxCopy ¶ added in v0.28.1
func WithCtxCopy(ctx context.Context, callTree string, copybuf []byte, to time.Duration, w io.Writer, r io.Reader, panicf ...func(s string)) error
close reader by yourself
to avoid writer block after ctx done, you should close writer after ctx done
call Close() after writer fin
func WithCtxTO ¶ added in v0.28.1
func WithCtxTO(ctx context.Context, callTree string, to time.Duration, w io.Writer, r io.Reader, panicf ...func(s string)) io.ReadWriteCloser
close reader by yourself
to avoid writer block after ctx done, you should close writer after ctx done
call Close() after writer fin
func WriterWithConfig ¶ added in v0.28.20241116095044
func WriterWithConfig(w io.Writer, c CopyConfig) (wc io.Writer)
Types ¶
type CopyConfig ¶ added in v0.28.1
type IOpipe ¶ added in v0.28.1
type IOpipe struct { R *io.PipeReader W *io.PipeWriter // contains filtered or unexported fields }
func (*IOpipe) CloseWithError ¶ added in v0.28.1
Click to show internal directories.
Click to hide internal directories.