ipc

package
v1.0.0-rc.3 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package ipc contains the logic to manage the Inter-Process Communication (IPC) between the gateway replicas.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CloseAllGuestsConnections

func CloseAllGuestsConnections(guestsConnections GuestConnections)

CloseAllGuestsConnections closes all connections in the guestsConnections map.

func CloseListenSocket

func CloseListenSocket(socket net.Listener)

CloseListenSocket closes the listen socket.

func Connect

func Connect(path, id string) (net.Conn, error)

Connect connects to the Unix domain socket at the given path and sends the given ID.

func CreateListenSocket

func CreateListenSocket(path string) (net.Listener, error)

CreateListenSocket creates a Unix domain socket and listens for incoming connections.

func ForgeStartMessage

func ForgeStartMessage(id string) string

ForgeStartMessage creates a start message.

func StartAllGuestsConnections

func StartAllGuestsConnections(guestsConnections GuestConnections) error

StartAllGuestsConnections sends a start message to all connections in the guestsConnections map.

func WaitAllGuestsConnections

func WaitAllGuestsConnections(guestsConnections GuestConnections, socket net.Listener) error

WaitAllGuestsConnections waits for all guests to connect to the socket.

func WaitForStart

func WaitForStart(id string, conn net.Conn) error

WaitForStart waits for the start signal from the given ID.

Types

type GuestConnections

type GuestConnections map[string]net.Conn

GuestConnections is a map of guest IDs to connections.

func NewGuestConnections

func NewGuestConnections(guests []string) GuestConnections

NewGuestConnections creates a new GuestConnections map from string slice.

Jump to

Keyboard shortcuts

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