logger

package
v0.0.0-...-4308112 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2024 License: AGPL-3.0 Imports: 11 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 logger worker, using the resource names defined in the supplied config.

func NewLogger

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

NewLogger returns a worker.Worker that uses the notify watcher returned from the setup.

Types

type LoggerAPI

type LoggerAPI interface {
	LoggingConfig(ctx context.Context, agentTag names.Tag) (string, error)
	WatchLoggingConfig(ctx context.Context, agentTag names.Tag) (watcher.NotifyWatcher, error)
}

LoggerAPI represents the API calls the logger makes.

type ManifoldConfig

type ManifoldConfig struct {
	AgentName       string
	APICallerName   string
	LoggerContext   corelogger.LoggerContext
	Logger          corelogger.Logger
	UpdateAgentFunc func(string) error
}

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

type WorkerConfig

type WorkerConfig struct {
	Context  logger.LoggerContext
	API      LoggerAPI
	Tag      names.Tag
	Logger   logger.Logger
	Override string

	Callback func(string) error
}

WorkerConfig contains the information required for the Logger worker to operate.

func (*WorkerConfig) Validate

func (c *WorkerConfig) Validate() error

Validate ensures all the necessary fields have values.

Jump to

Keyboard shortcuts

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