Documentation ¶
Index ¶
Constants ¶
View Source
const (
ProfilingEndpoint = "localhost:9091"
)
View Source
const (
WorkerConcurrency = 1
)
Variables ¶
View Source
var (
ErrAppInit = errors.New("error initializing app")
)
View Source
var (
ErrConfig = errors.New("configuration error")
)
Functions ¶
This section is empty.
Types ¶
type App ¶
type App struct { // Flasher configuration. Config *Configuration // Logger is the app logger Logger *logrus.Logger // Kind is the type of application - worker Kind model.AppKind // contains filtered or unexported fields }
Config holds configuration data when running mctl App holds attributes for the mtl application
func New ¶
func New(appKind model.AppKind, storeKind model.StoreKind, cfgFile, loglevel string, profiling bool) (*App, <-chan os.Signal, error)
New returns returns a new instance of the flasher app
func (*App) LoadConfiguration ¶
LoadConfiguration loads application configuration
Reads in the cfgFile when available and overrides from environment variables.
func (*App) NatsParams ¶ added in v1.0.3
func (a *App) NatsParams() (NatsConfig, error)
type Configuration ¶
type Configuration struct { // LogLevel is the app verbose logging level. // one of - info, debug, trace LogLevel string `mapstructure:"log_level"` // AppKind is the application kind - worker / client AppKind model.AppKind `mapstructure:"app_kind"` // Worker configuration Concurrency int `mapstructure:"concurrency"` // FacilityCode limits this flasher to events in a facility. FacilityCode string `mapstructure:"facility_code"` // The inventory source - one of serverservice OR Yaml InventorySource string `mapstructure:"inventory_source"` StoreKind model.StoreKind `mapstructure:"store_kind"` // FleetDBAPIOptions defines the serverservice client configuration parameters // // This parameter is required when StoreKind is set to serverservice. FleetDBAPIOptions *FleetDBAPIOptions `mapstructure:"serverservice"` }
Config 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 ¶ added in v1.0.3
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"` OutofbandFirmwareNS string `mapstructure:"outofband_firmware_ns"` AssetStateAttributeNS string `mapstructure:"device_state_attribute_ns"` AssetStateAttributeKey string `mapstructure:"device_state_attribute_key"` OidcClientScopes []string `mapstructure:"oidc_client_scopes"` DeviceStates []string `mapstructure:"device_states"` DisableOAuth bool `mapstructure:"disable_oauth"` }
FleetDBAPIOptions defines configuration for the FleetDBAPI client. https://github.com/metal-toolbox/hollow-serverservice
Click to show internal directories.
Click to hide internal directories.