MCPcopy Index your code
hub / github.com/djherbis/nio

github.com/djherbis/nio @v3.0.1

Chat with this repo
repository ↗ · DeepWiki ↗ · release v3.0.1 ↗ · + Follow
33 symbols 87 edges 3 files 12 documented · 36% 7 cross-repo links
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

nio

GoDoc Release Software License Build Status Coverage Status Go Report Card

Usage

The Buffer interface:

type Buffer interface {
    Len() int64
    Cap() int64
    io.ReadWriter
}

nio's Copy method concurrently copies from an io.Reader to a supplied nio.Buffer, then from the nio.Buffer to an io.Writer. This way, blocking writes don't slow the io.Reader.

import (
  "github.com/djherbis/buffer"
  "github.com/djherbis/nio"
)

buf := buffer.New(32*1024) // 32KB In memory Buffer
nio.Copy(w, r, buf) // Reads and Writes concurrently, buffering using buf.

nio's Pipe method is a buffered version of io.Pipe The writer return once its data has been written to the Buffer. The reader returns with data off the Buffer.

import (
  "gopkg.in/djherbis/buffer.v1"
  "gopkg.in/djherbis/nio.v2"
)

buf := buffer.New(32*1024) // 32KB In memory Buffer
r, w := nio.Pipe(buf)

Installation

go get gopkg.in/djherbis/nio.v2

For some pre-built buffers grab:

go get gopkg.in/djherbis/buffer.v1

Mentions

GopherCon 2017: Peter Bourgon - Evolutionary Optimization with Go

Extension points exported contracts — how you extend this code

Buffer (Interface)
Buffer is used to store bytes. [1 implementers]
nio.go

Core symbols most depended-on inside this repo

Pipe
called by 8
nio.go
Close
called by 7
sync.go
CloseWithError
called by 4
sync.go
Len
called by 2
nio.go
gap
called by 2
sync.go
Cap
called by 1
nio.go
Copy
called by 1
nio.go
NewReader
called by 1
nio.go

Shape

Function 16
Method 12
Struct 4
Interface 1

Languages

Go100%

Modules by API surface

nio_test.go15 symbols
sync.go12 symbols
nio.go6 symbols

For agents

$ claude mcp add nio \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact