Documentation ¶
Overview ¶
Package pipe contains a cross-device compatable Pipes/NamedPipes connection interface. This package differs from the standard library as it allows for setting permissions on the Pipes without any OS-specific functions.
Index ¶
- Constants
- Variables
- func Dial(path string) (net.Conn, error)
- func DialContext(x context.Context, path string) (net.Conn, error)
- func DialTimeout(path string, t time.Duration) (net.Conn, error)
- func Format(s string) string
- func Listen(path string) (net.Listener, error)
- func ListenContext(x context.Context, path string) (net.Listener, error)
- func ListenPerms(path, perms string) (net.Listener, error)
- func ListenPermsContext(x context.Context, path, perms string) (net.Listener, error)
- type Piper
Constants ¶
const Pipe = Piper(time.Second * 15)
Pipe is the default Connector with the default timeout of 15 seconds.
Variables ¶
var PermEveryone = "0766"
PermEveryone is the Linux permission string used in sockets to allow anyone to write and read to the listening socket. This can be used for socket communication between privilege boundaries. This can be applied to the ListenPerm function.
Functions ¶
func Dial ¶
Dial connects to the specified Pipe path. This function will return a 'net.Conn' instance or any errors that may occur during the connection attempt.
Pipe names are in the form of "/<path>".
This function blocks indefinitely. Use the DialTimeout or DialContext to specify a control method.
func DialContext ¶
DialContext connects to the specified Pipe path. This function will return a net.Conn instance or any errors that may occur during the connection attempt.
Pipe names are in the form of "/<path>".
This function blocks until the supplied context is canceled and will return the context's Err() if the cancel occurs before the connection.
func DialTimeout ¶
DialTimeout connects to the specified Pipe path. This function will return a net.Conn instance or any errors that may occur during the connection attempt.
Pipe names are in the form of "/<path>".
This function blocks for the specified amount of time and will return 'ErrTimeout' if the timeout is reached.
func Format ¶
Format will ensure the path for this Pipe socket fits the proper OS based pathname. Valid path names will be returned without any changes.
func Listen ¶
Listen returns a 'net.Listener' that will listen for new connections on the Named Pipe path specified or any errors that may occur during listener creation.
Pipe names are in the form of "/<path>".
func ListenContext ¶ added in v0.2.0
ListenContext returns a 'net.Listener' that will listen for new connections on the Named Pipe path specified or any errors that may occur during listener creation.
Pipe names are in the form of "/<path>".
The provided Context can be used to cancel the Listener.
func ListenPerms ¶
ListenPerms returns a Listener that will listen for new connections on the Named Pipe path specified or any errors that may occur during listener creation.
Pipe names are in the form of "/<path>".
This function allows for specifying a Linux permissions string used to set the permissions of the listening Pipe.
func ListenPermsContext ¶ added in v0.2.0
ListenPermsContext returns a Listener that will listen for new connections on the Named Pipe path specified or any errors that may occur during listener creation.
Pipe names are in the form of "/".
This function allows for specifying a Linux permissions string used to set the permissions of the listening Pipe.
The provided Context can be used to cancel the Listener.