Documentation
¶
Overview ¶
Wrapper around net package to make it convinient to use for UNIX domain sockets.
Index ¶
- type Socket
- func (s *Socket) Accept() (net.Conn, error)
- func (s *Socket) Close() error
- func (s *Socket) CloseConnection() error
- func (s *Socket) Connect() error
- func (s *Socket) Create() error
- func (s *Socket) Exists() bool
- func (s *Socket) Listen(cb func())
- func (s *Socket) Reader() (io.Reader, error)
- func (s *Socket) Receive() ([]byte, error)
- func (s *Socket) ReceiveJSON(v any) error
- func (s *Socket) Send(msg string) (int, error)
- func (s *Socket) SendJSON(v any) (int, error)
- func (s *Socket) Writer() (io.Writer, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Socket ¶
func (*Socket) CloseConnection ¶
Only closes the connection.
func (*Socket) Listen ¶
func (s *Socket) Listen(cb func())
Waits for a connection. When a connection is made, it will run the callback function with the connection as argument.
func (*Socket) ReceiveJSON ¶
Receives JSON from the socket. Returns an unmarshaled JSON object using the provided interface.
Click to show internal directories.
Click to hide internal directories.