winio

package
v0.7.0-dev.6 Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2016 License: MIT, Apache-2.0 Imports: 9 Imported by: 0

README

go-winio

This repository contains utilities for efficiently performing Win32 IO operations in Go. Currently, this is focused on accessing named pipes and other file handles, and for using named pipes as a net transport.

This code relies on IO completion ports to avoid blocking IO on system threads, allowing Go to reuse the thread to schedule another goroutine. This limits support to Windows Vista and newer operating systems. This is similar to the implementation of network sockets in Go's net package.

Please see the LICENSE file for licensing information.

Thanks to natefinch for the inspiration for this library. See https://github.com/natefinch/npipe for another named pipe implementation.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrFileClosed = errors.New("file has already been closed")
	ErrTimeout    = &timeoutError{}
)
View Source
var (
	// This error should match net.errClosing since docker takes a dependency on its text
	ErrPipeListenerClosed = errors.New("use of closed network connection")
)

Functions

func DialPipe

func DialPipe(path string, timeout *time.Duration) (net.Conn, error)

DialPipe connects to a named pipe by path, timing out if the connection takes longer than the specified duration. If timeout is nil, then the timeout is the default timeout established by the pipe server.

func ListenPipe

func ListenPipe(path, sddl string) (net.Listener, error)

func LookupSidByName

func LookupSidByName(name string) (sid string, err error)

LookupSidByName looks up the SID of an account by name

func MakeOpenFile

func MakeOpenFile(h syscall.Handle) (io.ReadWriteCloser, error)

Types

type AccountLookupError

type AccountLookupError struct {
	Name string
	Err  error
}

func (*AccountLookupError) Error

func (e *AccountLookupError) Error() string

type SddlConversionError

type SddlConversionError struct {
	Sddl string
	Err  error
}

func (*SddlConversionError) Error

func (e *SddlConversionError) Error() string

Jump to

Keyboard shortcuts

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