v.io: v.io/x/ref/examples/tunnel/internal Index | Files

package internal

import "v.io/x/ref/examples/tunnel/internal"

Package internal defines common types and functions used by both tunnel clients and servers.

Index

Package Files

forward.go terminal.go

func EnterRawTerminalMode Uses

func EnterRawTerminalMode(ctx *context.T) string

EnterRawTerminalMode uses stty to enter the terminal into raw mode; stdin is unbuffered, local echo of input characters is disabled, and special signal characters are disabled. Returns a string which may be passed to RestoreTerminalSettings to restore to the original terminal settings.

func Forward Uses

func Forward(conn net.Conn, s sender, r receiver) error

Forward forwards data read from net.Conn to a TunnelForwardClientStream or a TunnelForwardServerStream.

func RestoreTerminalSettings Uses

func RestoreTerminalSettings(ctx *context.T, saved string)

RestoreTerminalSettings uses stty to restore the terminal to the original settings, taking the saved settings returned by EnterRawTerminalMode.

func SetWindowSize Uses

func SetWindowSize(fd uintptr, ws Winsize) error

SetWindowSize sets the terminal's window size.

type Winsize Uses

type Winsize struct {
    Row    uint16
    Col    uint16
    Xpixel uint16
}

Winsize defines the window size used by ioctl TIOCGWINSZ and TIOCSWINSZ.

func GetWindowSize Uses

func GetWindowSize() (*Winsize, error)

GetWindowSize gets the terminal's window size.

Package internal imports 9 packages (graph) and is imported by 6 packages. Updated 2018-08-31. Refresh now. Tools for package owners.