Skip to content

net.Conn wrapper for debugging network communication issues

License

Notifications You must be signed in to change notification settings

starboard-nz/echo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

I/O wrapper for debugging

net.Conn wrapper

import (
        "net"
        "github.com/starboard-nz/echo"
)

...

        conn, err := net.Dial("tcp", "golang.org:80")

        // wrap conn in echo.Conn and use econn instead of conn
        econn := echo.Conn{Conn: conn}
        
        econn.AddFileWrite("/path/to/file.log")
        w := econn.AddFileWrite("/path/to/file.go")
        // format read/write buffers as Go slices
        w.Go = true

        // also write to stderr
        econn.AddConsoleWriter()

About

net.Conn wrapper for debugging network communication issues

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages