ipc

package
v0.40.3 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2022 License: MIT Imports: 7 Imported by: 1

Documentation

Overview

Package ipc provides a way for a process to communicate with a daemon, using a unix domain socket.

Index

Constants

View Source
const (
	StopCommand = "stop"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type UnixSocket

type UnixSocket struct {
	IsServer           bool
	IsActive           bool
	IsListening        bool
	Incoming           chan []byte
	Outgoing           chan []byte
	ServerUp           chan struct{}
	ClientConnected    chan struct{}
	ClientDisconnected chan struct{}

	sync.RWMutex
	// contains filtered or unexported fields
}

UnixSocket is a standalone struct to handle communication between processes, using a unix domain socket.

func NewUnixSocket

func NewUnixSocket(socketFile string, server bool) *UnixSocket

func NewUnixSocketClient

func NewUnixSocketClient(socketFile string) *UnixSocket

func NewUnixSocketServer

func NewUnixSocketServer(socketFile string) *UnixSocket

func (*UnixSocket) RunClient

func (dc *UnixSocket) RunClient() error

func (*UnixSocket) RunServer

func (dc *UnixSocket) RunServer() error

func (*UnixSocket) StopCurrent

func (dc *UnixSocket) StopCurrent()

Jump to

Keyboard shortcuts

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