ipcserver

package
v0.0.0-...-8dfc95f Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2024 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AF_UNIX  = "unix"     // UNIX domain sockets
	AF_DGRAM = "unixgram" // UNIX domain datagram sockets as specified in net package
)

CONSTANTS * The following constants are used for the IPC communication between the connector and the other modules.

Variables

View Source
var IPCID []byte
View Source
var MODULEIDENTIFIERS map[string][]byte

IDENTIFIERS * To identify the module, the client will send a 4 byte identifier as part of the header.

View Source
var MSGTYPE map[string]byte
View Source
var SERVERIDENTIFIER [4]byte

Functions

func AddModule

func AddModule(identifier string, id []byte)

Add a new module identifier to the map

func Cleanup

func Cleanup()

func LoadModules

func LoadModules(path string)

func NewIPCID

func NewIPCID(identifier string, id []byte)

func NewIPCMessage

func NewIPCMessage(identifierKey string, messageType byte, data []byte) (*ipc.IPCRequest, error)

Function to create a new IPCMessage based on the identifier key

func SetServerIdentifier

func SetServerIdentifier(id []byte)

Set the server identifier to the SERVERIDENTIFIER variable

Types

type DataSource

type DataSource struct {
}

type IPCServer

type IPCServer struct {
	// contains filtered or unexported fields
}

TYPES * Types for the IPC communication between the connector and the other modules.

func NewIPCServer

func NewIPCServer(name string, identifier string) *IPCServer

NewIPCServer creates a new IPC server and returns it.

func (*IPCServer) InitServerSocket

func (s *IPCServer) InitServerSocket() bool

Write a socket file and add it to the map

func (*IPCServer) Listen

func (s *IPCServer) Listen()

Creates a new listener on the socket path (which should be set in the config in the future)

type ReturnData

type ReturnData struct {
	Metadata ipc.Metadata `json:"metadata"`
	Data     interface{}  `json:"data"`
}

func (*ReturnData) GetLogs

func (d *ReturnData) GetLogs(path string, filter string)

TODO: Where should we tell the server where to get the logs from?

Jump to

Keyboard shortcuts

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