config

package
v0.0.0-...-9a7d9fe Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2021 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (

	//Version string.
	Version = major + "." + minor + "." + patch
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	//Port contains the port in which the application listens
	Port string
	//AppName for displaying in Monitoring
	AppName string
	//LogLevel - DEBUG or INFO or WARNING or ERROR or PANIC or FATAL
	LogLevel string
	//TestRun state if the current execution is a test execution
	TestRun bool
	//UsePrometheus to enable prometheus metrics endpoint
	UsePrometheus bool
	// DefaultIntegrationName string
	DefaultIntegrationName string
	// SlackToken string
	SlackToken string
	// SlackSigningSecret string
	SlackSigningSecret string
	// SlackChannel string
	SlackChannel string
	// SlackSlashCommand string
	SlackSlashCommand string
	// CACertificate string
	CACertificate string
	// TelegramToken string
	TelegramToken string
	// TelegramURL string
	TelegramURL string
	// TelegramBotName string
	TelegramBotName string
	// SensuAPIToken string
	SensuAPIToken string
	// SensuUser string
	SensuUser string
	// SensuPassword string
	SensuPassword string
	// SensuAPI string
	SensuAPI string
	// SensuAPIScheme string
	SensuAPIScheme string
	// BotTimeout int
	BotTimeout int
	// GoogleChatProjectID string
	GoogleChatProjectID string
	// GoogleChatSAPath string
	GoogleChatSAPath string
	// BlockedVerbs []string splited by comma
	BlockedVerbs []string
	// BlockedResources []string splited by comma
	BlockedResources []string
	// SlackAdminIDList []string splited by comma
	SlackAdminIDList []string
	// TelegramAdminIDList []string splited by comma
	TelegramAdminIDList []string
	// GoogleChatAdminList []string splited by comma
	GoogleChatAdminList []string
	// DeleteAllowedResources []string splited by comma
	DeleteAllowedResources []string
	// AlertManagerEndpoints []string
	AlertManagerEndpoints []string
	// AlertManagerUsername string
	AlertManagerUsername string
	// AlertManagerPassword string
	AlertManagerPassword string
	// OpsgenieAPIKey string
	OpsgenieAPIKey string
	// OpsgenieRegion string
	OpsgenieRegion string
}

Config contains the application's configuration values. Add here your own variables and bind it on init() function

var Values Config

Values stores the current configuration values

type Logger

type Logger interface {
	// Debug uses fmt.Sprint to construct and log a message.
	Debug(args ...interface{})

	// Info uses fmt.Sprint to construct and log a message.
	Info(args ...interface{})

	// Warn uses fmt.Sprint to construct and log a message.
	Warn(args ...interface{})

	// Error uses fmt.Sprint to construct and log a message.
	Error(args ...interface{})

	// DPanic uses fmt.Sprint to construct and log a message. In development, the
	// logger then panics. (See DPanicLevel for details.)
	DPanic(args ...interface{})

	// Panic uses fmt.Sprint to construct and log a message, then panics.
	Panic(args ...interface{})

	// Fatal uses fmt.Sprint to construct and log a message, then calls os.Exit.
	Fatal(args ...interface{})

	// Debugf uses fmt.Sprintf to log a templated message.
	Debugf(template string, args ...interface{})

	// Infof uses fmt.Sprintf to log a templated message.
	Infof(template string, args ...interface{})

	// Warnf uses fmt.Sprintf to log a templated message.
	Warnf(template string, args ...interface{})

	// Errorf uses fmt.Sprintf to log a templated message.
	Errorf(template string, args ...interface{})

	// DPanicf uses fmt.Sprintf to log a templated message. In development, the
	// logger then panics. (See DPanicLevel for details.)
	DPanicf(template string, args ...interface{})

	// Panicf uses fmt.Sprintf to log a templated message, then panics.
	Panicf(template string, args ...interface{})

	// Fatalf uses fmt.Sprintf to log a templated message, then calls os.Exit.
	Fatalf(template string, args ...interface{})

	//Sync flushes the log if needed
	Sync()
}

Logger interface defining expected methods for logging

func GetLogger

func GetLogger() Logger

GetLogger s Current implementation

Jump to

Keyboard shortcuts

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