presence

package
v0.0.0-...-23dbee4 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2024 License: AGPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Manifold

func Manifold(config ManifoldConfig) dependency.Manifold

Manifold returns a dependency manifold that runs a pubsub worker, using the resource names defined in the supplied config.

func NewWorker

func NewWorker(config WorkerConfig) (worker.Worker, error)

NewWorker creates a new presence worker that responds to pubsub connection messages.

Types

type ManifoldConfig

type ManifoldConfig struct {
	AgentName      string
	CentralHubName string
	Recorder       presence.Recorder
	Logger         logger.Logger

	NewWorker func(WorkerConfig) (worker.Worker, error)
}

ManifoldConfig defines the names of the manifolds on which a Manifold will depend.

func (*ManifoldConfig) Validate

func (c *ManifoldConfig) Validate() error

Validate ensures that the required values are set in the structure.

type WorkerConfig

type WorkerConfig struct {
	Origin   string
	Hub      *pubsub.StructuredHub
	Recorder presence.Recorder
	Logger   logger.Logger
}

WorkerConfig defines the configuration values that the pubsub worker needs to operate.

func (*WorkerConfig) Validate

func (c *WorkerConfig) Validate() error

Validate ensures that the required values are set in the structure.

Jump to

Keyboard shortcuts

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