config

package
v0.0.0-...-a8b8e24 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2024 License: Apache-2.0 Imports: 7 Imported by: 5

Documentation

Index

Constants

View Source
const (
	ComplianceEventName     = "compliance_ingest"
	ConfigMgmtEventName     = "cfgingest"
	EventFeedEventName      = "event_feed"
	ScanJobCreatedEventName = "scanJobCreated"
	ScanJobUpdatedEventName = "scanJobUpdated"
	ScanJobDeletedEventName = "scanJobDeleted"
	ProfileCreatedEventName = "profileCreated"
	ProfileUpdatedEventName = "profileUpdate"
	ProfileDeletedEventName = "profileDeleted"
	NodeTerminatedEventName = "nodeTerminated"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type EventConfig

type EventConfig struct {
	ServiceConfig     ServiceConfig   `mapstructure:"service"`
	InternalMessaging Nats            `mapstructure:"internal_messaging"`
	StreamService     StreamService   `mapstructure:"stream_service"`
	LogConfig         LogConfig       `mapstructure:"log"`
	TLSConfig         certs.TLSConfig `mapstructure:"tls"`
	ServiceCerts      *certs.ServiceCerts
	HandlerEndpoints  HandlerConfig `mapstructure:"handlers"` // use to get an instance of a service's event handler
}

Configuration for the Event Service

func Configure

func Configure() (*EventConfig, error)

Configure marshals configuration from the event-service configuration file that has been read in by Viper during the root command's initConfig(). Settings are parsed by Viper into the EventConfig struct.

func (*EventConfig) GetCerts

func (c *EventConfig) GetCerts() *certs.ServiceCerts

func (*EventConfig) ListenAddress

func (c *EventConfig) ListenAddress() string

ListenAddress is the address where gRPC server will bind and listen

func (*EventConfig) SetLogLevel

func (c *EventConfig) SetLogLevel()

SetLogLevel sets the log level for the service

type HandlerConfig

type HandlerConfig struct {
	Compliance string `mapstructure:"feed"`
	CfgIngest  string `mapstructure:"cfgingest"`
	EventFeed  string `mapstructure:"event_feed"`
}

type LogConfig

type LogConfig struct {
	LogLevel  string `mapstructure:"log_level"`
	LogFormat string `mapstructure:"log_format"`
}

type Nats

type Nats struct {
	Port        int `mapstructure:"port"`
	GatewayPort int `mapstructure:"gateway_port"`
}

Nats holds the configuration for the NATs Streaming Server

type ServiceConfig

type ServiceConfig struct {
	Host          string `mapstructure:"host"`
	Port          uint16 `mapstructure:"port"`
	EventLimit    int    `mapstructure:"event_limit"`    // service's input channel size
	ListenerLimit int    `mapstructure:"listener_limit"` // number of concurrent listeners supported
}

type StreamService

type StreamService struct {
	ClusterID string `mapstructure:"cluster_id"`
	Store     string `mapstructure:"store"`
}

Jump to

Keyboard shortcuts

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