Documentation
¶
Index ¶
- Constants
- func GetExpBackoffTime(retryNr int) time.Duration
- func GetServiceEndpoint(service string) (url.URL, error)
- func ValidateKeptnEntityName(name string) bool
- func ValidateUnixDirectoryName(dirName string) bool
- type EventProperties
- type EventSender
- type KeptnBase
- type KeptnOpts
- type Logger
- func (l *Logger) Debug(message string)
- func (l *Logger) Debugf(format string, v ...interface{})
- func (l *Logger) Error(message string)
- func (l *Logger) Errorf(format string, v ...interface{})
- func (l *Logger) Info(message string)
- func (l *Logger) Infof(format string, v ...interface{})
- func (l *Logger) Terminate(message string)
- func (l *Logger) Terminatef(format string, v ...interface{})
- type LoggerInterface
- type LoggingOpts
- type SLIConfig
Constants ¶
const ConfigurationServiceURL = "resource-service:8080"
const DatastoreURL = "mongodb-datastore:8080"
const DefaultLoggingServiceName = "keptn"
Variables ¶
This section is empty.
Functions ¶
func GetExpBackoffTime ¶
func GetServiceEndpoint ¶
getServiceEndpoint gets an endpoint stored in an environment variable and sets http as default scheme
func ValidateKeptnEntityName ¶
ValidateKeptnEntityName checks whether the provided name represents a valid project, service, or stage name
func ValidateUnixDirectoryName ¶
ValidateUnixDirectoryName checks whether the provided dirName contains any special character according to https://www.cyberciti.biz/faq/linuxunix-rules-for-naming-file-and-directory-names/
Types ¶
type EventProperties ¶
type EventSender ¶
type EventSender interface {
// SendEvent sends a cloud event
// Deprecated: use EventSender.Send instead
SendEvent(event cloudevents.Event) error
// Send sends a cloud event
Send(ctx context.Context, event cloudevents.Event) error
}
type KeptnBase ¶
type KeptnBase struct {
KeptnContext string
Event EventProperties
CloudEvent *cloudevents.Event
Logger LoggerInterface
// EventSender object that is responsible for sending events
EventSender EventSender
EventBrokerURL string // Deprecated: use EventSender instead
UseLocalFileSystem bool
ResourceHandler *api.ResourceHandler
EventHandler *api.EventHandler
}
func (*KeptnBase) GetKeptnResource ¶
GetKeptnResource returns a resource from the configuration repo based on the incoming cloud events project, service and stage
func (*KeptnBase) GetSLIConfiguration ¶
func (k *KeptnBase) GetSLIConfiguration(project string, stage string, service string, resourceURI string) (map[string]string, error)
GetSLIConfiguration retrieves the SLI configuration for a service considering SLI configuration on stage and project level. First, the configuration of project-level is retrieved, which is then overridden by configuration on stage level, overridden by configuration on service level.
type KeptnOpts ¶
type KeptnOpts struct {
UseLocalFileSystem bool
ConfigurationServiceURL string
EventBrokerURL string // Deprecated: use EventSender instead
DatastoreURL string
IncomingEvent *cloudevents.Event
LoggingOptions *LoggingOpts
EventSender EventSender
}
type Logger ¶
type Logger struct {
KeptnContext string `json:"keptnContext"`
EventID string `json:"eventId"`
ServiceName string `json:"keptnService"`
}
Logger contains data for logging
func (*Logger) Terminatef ¶ added in v0.8.5
Terminatef formats and logs a terminate message
type LoggerInterface ¶
type LoggerInterface interface {
Info(message string)
Infof(format string, v ...interface{})
Error(message string)
Errorf(format string, v ...interface{})
Debug(message string)
Debugf(format string, v ...interface{})
Terminate(message string)
Terminatef(format string, v ...interface{})
}
LoggerInterface collects signatures of the logger