Documentation
¶
Index ¶
- func BuildMockSplunkServer(splunkResult float64) *httptest.Server
- func ConfigureLogger(eventID, keptnContext string, logLevel string)
- func ConnectToSplunk(splunkCreds SplunkCredentials, skipSSL bool) *splunk.SplunkClient
- func MultitpleMockRequest(getResponses []string, postResponses []string, paths []string, ...) *httptest.Server
- func RetrieveQueryTimeRange(earliestTime string, latestTime string, searchQuery string) (string, string, string)
- type EnvConfig
- type Formatter
- type SplunkCredentials
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildMockSplunkServer ¶
Build a mock splunk server returning default responses when getting get and post requests
func ConfigureLogger ¶
func ConnectToSplunk ¶
func ConnectToSplunk(splunkCreds SplunkCredentials, skipSSL bool) *splunk.SplunkClient
Creates an authenticated splunk client
func MultitpleMockRequest ¶
Types ¶
type EnvConfig ¶
type EnvConfig struct {
// Port on which to listen for cloudevents
Port int `envconfig:"RCV_PORT" default:"8080"`
// Path to which cloudevents are sent
Path string `envconfig:"RCV_PATH" default:"/"`
// Whether we are running locally (e.g., for testing) or on production
Env string `envconfig:"ENV" default:"local"`
ConfigurationServiceUrl string `envconfig:"CONFIGURATION_SERVICE" default:""`
SplunkApiToken string `envconfig:"SP_API_TOKEN" default:""`
SplunkHost string `envconfig:"SP_HOST" default:""`
SplunkPort string `envconfig:"SP_PORT" default:"8089"`
SplunkUsername string `envconfig:"SP_USERNAME" default:""`
SplunkPassword string `envconfig:"SP_PASSWORD" default:""`
SplunkSessionKey string `envconfig:"SP_SESSION_KEY" default:""`
AlertSuppressPeriod string `envconfig:"ALERT_SUPPRESS_PERIOD" default:"3m"`
CronSchedule string `envconfig:"CRON_SCHEDULE" default:"3m"`
DispatchEarliestTime string `envconfig:"DISPATCH_EARLIEST_TIME" default:"*/1 * * * *"`
DispatchLatestTime string `envconfig:"DISPATCH_LATEST_TIME" default:"now"`
Actions string `envconfig:"ACTIONS" default:""`
WebhookUrl string `envconfig:"WEBHOOK_URL" default:""`
}
type SplunkCredentials ¶
type SplunkCredentials struct {
Host string `json:"host" yaml:"spHost"`
Port string `json:"port" yaml:"spPort"`
Username string `json:"username" yaml:"spUsername"`
Password string `json:"password" yaml:"spPassword"`
Token string `json:"token" yaml:"spApiToken"`
SessionKey string `json:"sessionKey" yaml:"spSessionKey"`
}
func GetSplunkCredentials ¶
func GetSplunkCredentials(env EnvConfig) (*SplunkCredentials, error)
getSplunkCredentials get the splunk host, port and api token from the environment variables set from secret
Click to show internal directories.
Click to hide internal directories.