caasunitsmanager

package
v0.0.0-...-c325cbb Latest Latest
Warning

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

Go to latest
Published: May 1, 2024 License: AGPL-3.0 Imports: 6 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
	Clock clock.Clock

	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 Logger

type Logger interface {
	Infof(string, ...interface{})
	Errorf(string, ...interface{})
}

Logger for logging messages.

type ManifoldConfig

type ManifoldConfig struct {
	AgentName     string
	APICallerName string

	Logger
	Clock clock.Clock

	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