Documentation ¶
Overview ¶
Package systemd provides functions for native systemd integration.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Socket ¶
type Socket struct {
// contains filtered or unexported fields
}
Socket is the abstraction of a socket passed as a file descriptor by systemd.
func Listen ¶
Listen returns sockets passed by the service manager as part of the socket-based activation logic. If no sockets have been received, an empty slice is returned. If more than one socket is received, they will be passed in the same order as configured in the systemd socket unit file.
func ListenWithNames ¶
ListenWithNames is like Listen but also assigns passed names to the sockets. The name can be used to identify a socket. Names can be assigned in the systemd unit files.
func (*Socket) Close ¶
Close closes the Socket, rendering it unusable for I/O. It returns an error, if any.
func (*Socket) Conn ¶
Conn returns a copy of the network connection corresponding to the open socket s. It is the caller's responsibility to close s when finished. Closing c does not affect s, and closing s does not affect c.
func (*Socket) Fd ¶
Fd returns the integer Unix file descriptor referencing the open socket. The file descriptor is valid only until s.Close is called or s is garbage collected.
func (*Socket) File ¶
File returns the underlying os.File of the socket. Closing f does also close s and closing s does also close f.
func (*Socket) Listener ¶
Listener returns a copy of the network listener corresponding to the open socket s. It is the caller's responsibility to close ln when finished. Closing ln does not affect s, and closing s does not affect ln.
func (*Socket) PacketConn ¶
func (s *Socket) PacketConn() (c net.PacketConn, err error)
PacketConn returns a copy of the packet network connection corresponding to the open socket s. It is the caller's responsibility to close s when finished. Closing c does not affect s, and closing s does not affect c.