Documentation ¶
Overview ¶
Package usock implements a wrapper around the unix(7) SCM_RIGHTS API, which allows processes to exchange file handles over a unix(7) control socket.
Index ¶
- Variables
- func FD2Unix(fd int) (*net.UnixConn, error)
- func IsChild() bool
- func ReadJSON(src *net.UnixConn, msg any) error
- func ReadJSONConn(src *net.UnixConn, msg any) (net.Conn, error)
- func ReadJSONFile(src *net.UnixConn, msg any) (*os.File, error)
- func ReadWithFile(src *net.UnixConn, dst []byte) (int, *os.File, error)
- func Setup(ctx context.Context) context.Context
- func SocketPair() (*net.UnixConn, *net.UnixConn, error)
- func StartChild() (*net.UnixConn, error)
- func Sync(ctx context.Context) chan struct{}
- func WithSync(ctx context.Context) (context.Context, func())
- func WriteJSON(dst *net.UnixConn, msg any) error
- func WriteJSONFile(dst *net.UnixConn, msg any, handle *os.File) error
- func WriteWithFile(dst *net.UnixConn, msg []byte, handle *os.File) (int, error)
Constants ¶
This section is empty.
Variables ¶
View Source
var Signal = make(chan struct{})
Functions ¶
func IsChild ¶
func IsChild() bool
IsChild returns true if this executable was launched by StartChild
func ReadWithFile ¶
ReadWithFile reads data from src, and if it includes an out-of-band control message, it will try to turn it into a file handle.
func SocketPair ¶
SocketPair returns a pair of connected unix sockets.
func StartChild ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.