broadcasts

package
v0.1.13 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2024 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Overview

Package broadcasts contains code for a Fleetspeak server to manage broadcasts. See in particular the Manager.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Manager

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

A Manager keeps tracts of the active broadcasts in a system. It allows a fleetspeak system to deliver broadcasts to client without all of the fleetspeak servers trying to modify the same datastore records at the same time.

func MakeManager

func MakeManager(ctx context.Context, bs db.BroadcastStore, pw time.Duration, clientCache *cache.Clients, dispatcher *notifications.Dispatcher) (*Manager, error)

MakeManager creates a Manager, populates it with the current set of broadcasts, and begins updating the broadcasts in the background, the time between updates is always between pw and 2*pw.

func (*Manager) Close

func (m *Manager) Close(ctx context.Context) error

Close attempts to shut down the Manager gracefully.

func (*Manager) MakeBroadcastMessagesForClient

func (m *Manager) MakeBroadcastMessagesForClient(ctx context.Context, id common.ClientID, labels []*fspb.Label) ([]*fspb.Message, error)

MakeBroadcastMessagesForClient finds broadcasts that the client is eligible to receive.

Jump to

Keyboard shortcuts

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