contextio

package
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 17, 2026 License: Apache-2.0 Imports: 3 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package contextio 在读写边界检查取消,不负责中断底层已经阻塞的 I/O。

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Reader

func Reader(ctx context.Context, input io.Reader) io.Reader

Reader 在每次读取前后检查 ctx,取消时原样返回 ctx.Err()。 不可取消的上下文直接复用 input;同一上下文不会重复包装。

func Writer

func Writer(ctx context.Context, output io.Writer) io.Writer

Writer 在每次写入前后检查 ctx,取消时原样返回 ctx.Err()。 保留字符串写入快速路径;同一上下文不会重复包装。

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL