Documentation ¶
Index ¶
Constants ¶
View Source
const ( DefaultCollectInterval = 72 * time.Hour DefaultCollectSplay = 4 * time.Hour )
Variables ¶
View Source
var (
ErrAppInit = errors.New("error initializing app")
)
View Source
var (
ErrConfig = errors.New("configuration error")
)
Functions ¶
Types ¶
type App ¶
type App struct { // App configuration. Config *Configuration // 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 // Kind is the type of application - inband/outofband Kind model.AppKind // contains filtered or unexported fields }
App holds attributes for running alloy.
type Configuration ¶
type Configuration struct { // LogLevel is the app verbose logging level. // one of - info, debug, trace LogLevel string `mapstructure:"log_level"` // AppKind is either inband or outofband AppKind model.AppKind `mapstructure:"app_kind"` // StoreKind declares the type of storage repository that holds asset inventory data. StoreKind model.StoreKind `mapstructure:"store_kind"` // CSV file path when StoreKind is set to csv. CsvFile string `mapstructure:"csv_file"` // FacilityCode limits this alloy to events in a facility. FacilityCode string `mapstructure:"facility_code"` // FleetDBAPIOptions defines the fleetdb API client configuration parameters // // This parameter is required when StoreKind is set to fleetdb. FleetDBAPIOptions *FleetDBAPIOptions `mapstructure:"fleetdb"` // Controller Out of band collector concurrency Concurrency int `mapstructure:"concurrency"` CollectInterval time.Duration `mapstructure:"collect_interval"` CollectIntervalSplay time.Duration `mapstructure:"collect_interval_splay"` // EventsBrokerKind indicates the kind of event broker configuration to enable, // // Supported parameter value - nats EventsBorkerKind string `mapstructure:"events_broker_kind"` // NatsOptions defines the NATs events broker configuration parameters. // // This parameter is required when EventsBrokerKind is set to nats. NatsOptions *events.NatsOptions `mapstructure:"nats"` }
Configuration holds application configuration read from a YAML or set by env variables.
nolint:govet // prefer readability over field alignment optimization for this case.
type FleetDBAPIOptions ¶
type FleetDBAPIOptions struct { EndpointURL *url.URL FacilityCode string `mapstructure:"facility_code"` Endpoint string `mapstructure:"endpoint"` OidcIssuerEndpoint string `mapstructure:"oidc_issuer_endpoint"` OidcAudienceEndpoint string `mapstructure:"oidc_audience_endpoint"` OidcClientSecret string `mapstructure:"oidc_client_secret"` OidcClientID string `mapstructure:"oidc_client_id"` OidcClientScopes []string `mapstructure:"oidc_client_scopes"` DisableOAuth bool `mapstructure:"disable_oauth"` }
FleetDBAPIOptions defines configuration for the fleetdb client. https://github.com/metal-automata/fleetdb
Click to show internal directories.
Click to hide internal directories.