caasunitsmanager

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: 8 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 caasunitmanager worker, using the resource names defined in the supplied config.

func NewWorker

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

NewWorker returns a worker that runs on CAAS agent and subscribes and handles unit topics.

Types

type Config

type Config struct {
	Logger logger.Logger
	Clock  clock.Clock

	Hub Hub
}

type Hub

type Hub interface {
	Publish(topic string, data interface{}) func()
	Subscribe(topic string, handler func(string, interface{})) func()
}

Hub is a pubsub hub used for internal messaging.

type ManifoldConfig

type ManifoldConfig struct {
	AgentName     string
	APICallerName string

	Logger logger.Logger
	Clock  clock.Clock

	Hub Hub
}

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

func (*ManifoldConfig) Validate

func (config *ManifoldConfig) Validate() error

Validate ensures all the required values for the config are set.

Directories

Path Synopsis
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.

Jump to

Keyboard shortcuts

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