app

package
v0.3.9 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrAppInit = errors.New("error initializing app")
)

Functions

func NewLogrusEntryFromLogger

func NewLogrusEntryFromLogger(fields logrus.Fields, logger *logrus.Logger) *logrus.Entry

NewLogrusEntryFromLogger returns a logger contextualized with the given logrus fields.

Types

type App

type App struct {
	// AssetGetterPause when set will cause the asset getter to pause sending assets
	// on the asset channel until the flag has been cleared.
	AssetGetterPause *helpers.Pauser
	// App configuration.
	Config *model.Config
	// AssetCh is where the asset getter retrieves assets from the asset store for the inventory collector to consume.
	AssetCh chan *model.Asset
	// CollectorCh is where the asset inventory information is written, for the publisher to consume.
	CollectorCh chan *model.Asset
	// TermCh is the channel to terminate the app based on a signal
	TermCh chan os.Signal
	// Sync waitgroup to wait for running go routines on termination.
	SyncWg *sync.WaitGroup
	// Logger is the app logger
	Logger *logrus.Logger
}

App holds attributes for running alloy.

func New

func New(_ context.Context, kind, cfgFile string, loglevel int) (app *App, err error)

New returns a new alloy application object with the configuration loaded

func (*App) InitAssetCollectorChannels

func (a *App) InitAssetCollectorChannels()

InitAssetCollectorChannels is a helper method to initialize the asset and collector channels.

Jump to

Keyboard shortcuts

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