endpoint

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2025 License: GPL-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package endpoint defines the interface for communication endpoints in the GoBroke system. Endpoints handle the actual message transmission between clients and the broker.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Endpoint

type Endpoint interface {
	// Sender sets up the channel for outgoing messages from the broker to clients.
	// Returns an error if the sender channel cannot be established.
	Sender(chan types.Message) error

	// Receiver sets up the channel for incoming messages from clients to the broker.
	// Returns an error if the receiver channel cannot be established.
	Receiver(chan types.Message) error

	// Disconnect terminates a client's connection to the endpoint.
	// Returns an error if the client cannot be disconnected properly.
	Disconnect(client *clients.Client) error

	// Start begins the endpoint's message processing operations.
	// It runs until the provided context is cancelled.
	Start(ctx context.Context)
}

Endpoint defines the interface that all communication endpoints must implement. An endpoint is responsible for managing client connections and message transmission.

Jump to

Keyboard shortcuts

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