Documentation ¶
Index ¶
- Constants
- func CreateErrorEvent(source string, parentEvent models.KeptnContextExtendedCE, ...) (*models.KeptnContextExtendedCE, error)
- func CreateErrorLogEvent(source string, parentEvent models.KeptnContextExtendedCE, ...) (*models.KeptnContextExtendedCE, error)
- func CreateFinishedEvent(source string, parentEvent models.KeptnContextExtendedCE, ...) (*models.KeptnContextExtendedCE, error)
- func CreateFinishedEventWithError(source string, parentEvent models.KeptnContextExtendedCE, ...) (*models.KeptnContextExtendedCE, error)
- func CreateStartedEvent(source string, parentEvent models.KeptnContextExtendedCE, ...) (*models.KeptnContextExtendedCE, error)
- func Decode(in, out interface{}) error
- func EventDataAs(in models.KeptnContextExtendedCE, out interface{}) error
- func GetEventTypeForTriggeredEvent(baseTriggeredEventType, newEventTypeSuffix string) (string, error)
- func GetFinishedEventType(task string) string
- func GetInvalidatedEventType(task string) string
- func GetStartedEventType(task string) string
- func GetStatusChangedEventType(task string) string
- func GetTriggeredEventType(task string) string
- func IsFinishedEventType(eventType string) bool
- func IsSequenceEventType(eventType string) bool
- func IsStartedEventType(eventType string) bool
- func IsTaskEventType(eventType string) bool
- func IsTriggeredEventType(eventType string) bool
- func IsValidEventType(eventType string) bool
- func ParseEventKind(eventType string) (string, error)
- func ParseEventTypeWithoutKind(eventType string) (string, error)
- func ParseSequenceEventType(sequenceTriggeredEventType string) (string, string, string, error)
- func ParseTaskEventType(taskEventType string) (string, string, error)
- func ReplaceEventTypeKind(eventType, newKind string) (string, error)
- func ToCloudEvent(keptnEvent models.KeptnContextExtendedCE) cloudevents.Event
- func ToKeptnEvent(event cloudevents.Event) (models.KeptnContextExtendedCE, error)
- type ActionFinishedEventData
- type ActionInfo
- type ActionStartedEventData
- type ActionTriggeredEventData
- type Approval
- type ApprovalFinishedEventData
- type ApprovalStartedEventData
- type ApprovalStatusChangedEventData
- type ApprovalTriggeredEventData
- type ConfigurationChange
- type ConfigureMonitoringFinishedEventData
- type ConfigureMonitoringStartedEventData
- type ConfigureMonitoringTriggeredEventData
- type ConfigureMonitoringTriggeredParams
- type Deployment
- type DeploymentFinishedData
- type DeploymentFinishedEventData
- type DeploymentStartedEventData
- type DeploymentStatusChangedEventData
- type DeploymentTriggeredData
- type DeploymentTriggeredEventData
- type Endpoints
- type EnvFrom
- type Error
- type ErrorLogEvent
- type Evaluation
- type EvaluationDetails
- type EvaluationFinishedEventData
- type EvaluationStartedEventData
- type EvaluationStatusChangedEventData
- type EvaluationTriggeredEventData
- type EventData
- func (e *EventData) GetLabels() map[string]string
- func (e *EventData) GetProject() string
- func (e *EventData) GetService() string
- func (e *EventData) GetStage() string
- func (e *EventData) SetLabels(labels map[string]string)
- func (e *EventData) SetProject(project string)
- func (e *EventData) SetService(service string)
- func (e *EventData) SetStage(stage string)
- type GetActionData
- type GetActionFinishedEventData
- type GetActionStartedEventData
- type GetActionTriggeredEventData
- type GetSLI
- type GetSLIFinished
- type GetSLIFinishedEventData
- type GetSLIStartedEventData
- type GetSLITriggeredEventData
- type HTTPEventSender
- type HTTPSenderOption
- type Helm
- type Keptn
- func (k *Keptn) GetShipyard() (*Shipyard, error)
- func (k *Keptn) SendCloudEvent(event cloudevents.Event) error
- func (k *Keptn) SendTaskFinishedEvent(data keptn.EventProperties, source string) (string, error)
- func (k *Keptn) SendTaskStartedEvent(data keptn.EventProperties, source string) (string, error)
- func (k *Keptn) SendTaskStatusChangedEvent(data keptn.EventProperties, source string) (string, error)
- type KeptnEventBuilder
- func (eb *KeptnEventBuilder) Build() (models.KeptnContextExtendedCE, error)
- func (eb *KeptnEventBuilder) WithGitCommitID(gitCommitID string) *KeptnEventBuilder
- func (eb *KeptnEventBuilder) WithID(id string) *KeptnEventBuilder
- func (eb *KeptnEventBuilder) WithKeptnContext(keptnContext string) *KeptnEventBuilder
- func (eb *KeptnEventBuilder) WithKeptnSpecVersion(keptnSpecVersion string) *KeptnEventBuilder
- func (eb *KeptnEventBuilder) WithTriggeredID(triggeredID string) *KeptnEventBuilder
- type Metadata
- type ProblemDetails
- type ProjectCreateData
- type ProjectCreateFinishedEventData
- type ProjectCreateStartedEventData
- type ProjectDeleteData
- type ProjectDeleteFinishedEventData
- type ProjectDeleteStartedEventData
- type ReleaseFinishedEventData
- type ReleaseStartedEventData
- type ReleaseStatusChangedEventData
- type ReleaseTriggeredEventData
- type ResultType
- type RollbackData
- type RollbackFinishedEventData
- type RollbackStartedEventData
- type RollbackTriggeredEventData
- type SLIEvaluationResult
- type SLIFilter
- type SLIResult
- type SLITarget
- type Selector
- type Sequence
- type ServiceCreateFinishedEventData
- type ServiceCreateStartedEventData
- type ServiceCreateStatusChangedEventData
- type ServiceDeleteFinishedEventData
- type ServiceDeleteStartedEventData
- type ServiceDeleteStatusChangedEventData
- type Shipyard
- type ShipyardSpec
- type Stage
- type StatusType
- type Task
- type Test
- type TestFinishedDetails
- type TestFinishedEventData
- type TestSender
- func (s *TestSender) AddReactor(eventTypeSelector string, reactor func(event cloudevents.Event) error)
- func (s *TestSender) AssertSentEventTypes(eventTypes []string) error
- func (s *TestSender) Send(ctx context.Context, event cloudevents.Event) error
- func (s *TestSender) SendEvent(event cloudevents.Event) error
- type TestStartedEventData
- type TestStatusChangedEventData
- type TestTriggeredDeploymentDetails
- type TestTriggeredDetails
- type TestTriggeredEventData
- type Trigger
- type WebHookConfig
- type WebHookConfigSpec
- type WebHookSecretRef
- type Webhook
Constants ¶
const ActionTaskName = "action"
const ApprovalAutomatic = "automatic"
ApprovalAutomatic indicates an automatic approval strategy
const ApprovalManual = "manual"
ApprovalManual indicates a manual approval strategy
const ApprovalTaskName = "approval"
const ConfigureMonitoringTaskName = "configure-monitoring"
const DefaultHTTPEventEndpoint = "http://localhost:8081/event"
const DeploymentTaskName = "deployment"
const ErrorLogEventName = "sh.keptn.log.error"
const EvaluationTaskName = "evaluation"
const GetActionTaskName = "get-action"
const GetSLITaskName = "get-sli"
const MAX_SEND_RETRIES = 3
const ProjectCreateTaskName = "project.create"
const ProjectDeleteTaskName = "project.delete"
const ReleaseTaskName = "release"
const RollbackTaskName = "rollback"
const ServiceCreateTaskName = "service.create"
const ServiceDeleteTaskName = "service.delete"
const TestTaskName = "test"
const UnableGetContextMsg = "unable to get keptn context from parent event %s"
const UnableGetTypeMsg = "unable to get keptn event type from parent event %s"
Variables ¶
This section is empty.
Functions ¶
func CreateErrorEvent ¶
func CreateErrorEvent(source string, parentEvent models.KeptnContextExtendedCE, eventData interface{}, errVal *Error) (*models.KeptnContextExtendedCE, error)
CreateErrorEvent takes a parent event (e.g. .triggered event) and creates a corresponding errored event
func CreateErrorLogEvent ¶
func CreateErrorLogEvent(source string, parentEvent models.KeptnContextExtendedCE, eventData interface{}, errVal *Error) (*models.KeptnContextExtendedCE, error)
CreateErrorLogEvent takes a parent event (e.g. .triggered event) and creates a corresponding errored .log event
func CreateFinishedEvent ¶
func CreateFinishedEvent(source string, parentEvent models.KeptnContextExtendedCE, eventData interface{}) (*models.KeptnContextExtendedCE, error)
CreateFinishedEvent takes a parent event (e.g. .triggered event) and creates a corresponding .finished event
func CreateFinishedEventWithError ¶
func CreateFinishedEventWithError(source string, parentEvent models.KeptnContextExtendedCE, eventData interface{}, errVal *Error) (*models.KeptnContextExtendedCE, error)
CreateFinishedEventWithError takes a parent event (e.g. .triggered event) and creates a corresponding errored .finished event
func CreateStartedEvent ¶
func CreateStartedEvent(source string, parentEvent models.KeptnContextExtendedCE, eventData interface{}) (*models.KeptnContextExtendedCE, error)
CreateStartedEvent takes a parent event (e.g. .triggered event) and creates a corresponding .started event
func Decode ¶
func Decode(in, out interface{}) error
Decode decodes the given raw interface to the target pointer specified by the out parameter
func EventDataAs ¶
func EventDataAs(in models.KeptnContextExtendedCE, out interface{}) error
EventDataAs decodes the event data of the given keptn cloud event to the target pointer specified by the out parameter
func GetFinishedEventType ¶
GetFinishedEventType returns for the given task the name of the finished event type
func GetInvalidatedEventType ¶
GetInvalidatedEventType returns for the given task the name of the finished event type
func GetStartedEventType ¶
GetStartedEventType returns for the given task the name of the started event type
func GetStatusChangedEventType ¶
GetStatusChangedEventType returns for the given task the name of the status.changed event type
func GetTriggeredEventType ¶
GetTriggeredEventType returns for the given task the name of the triggered event type
func IsFinishedEventType ¶
func IsSequenceEventType ¶
IsSequenceEventType checks whether the given event type is a sequence event type like e.g. "sh.keptn.event.stage.sequence.triggered"
func IsStartedEventType ¶
func IsTaskEventType ¶
IsTaskEventType checks whether the given eventType is a task event type like e.g. "sh.keptn.event.task.triggered"
func IsTriggeredEventType ¶
func IsValidEventType ¶
IsValidEventType checks whether the given event type is a valid event type, i.e. a valid task event type or sequence event type
func ParseEventKind ¶
ParseEventKind parses the given event type and returns the last element which is the "kind" of the event (e.g. triggered, finished, ...)
func ParseEventTypeWithoutKind ¶
ParseEventTypeWithoutKind parses the given event type and trims away the last element of the event which is the "kind" of the event (e.g. triggered, finished, ...)
func ParseSequenceEventType ¶
ParseSequenceEventType parses the given sequence event type and returns the stage name, sequence name, event type as well as an error which is eventually nil
func ParseTaskEventType ¶
ParseTaskEventType parses the given task event type and returns the task name, event type as well as an error which is eventually nil
func ReplaceEventTypeKind ¶
ReplaceEventTypeKind replaces the last element of the event which is the "kind" of the event (e.g. triggered, finished, ...) with a new value This is useful e.g. to transform a .started event type into a .finished event type
func ToCloudEvent ¶
func ToCloudEvent(keptnEvent models.KeptnContextExtendedCE) cloudevents.Event
ToCloudEvent takes a KeptnContextExtendedCE and converts it to an ordinary CloudEvent
func ToKeptnEvent ¶
func ToKeptnEvent(event cloudevents.Event) (models.KeptnContextExtendedCE, error)
ToKeptnEvent takes a CloudEvent and converts it into a KeptnContextExtendedCE
Types ¶
type ActionFinishedEventData ¶
type ActionFinishedEventData struct {
EventData
}
ActionFinishedEventData contains information about the execution of an action
type ActionInfo ¶
type ActionInfo struct { // Name is the name of the action Name string `json:"name"` // Action determines the type of action to be executed Action string `json:"action"` // Description contains the description of the action Description string `json:"description,omitempty"` // Value contains the value of the action Value interface{} `json:"value,omitempty"` }
ActionInfo contains information about the action to be performed
type ActionStartedEventData ¶
type ActionStartedEventData struct {
EventData
}
ActionStartedEventData contains information about an action.started event
type ActionTriggeredEventData ¶
type ActionTriggeredEventData struct { EventData // Action describes the type of action Action ActionInfo `json:"action"` // Problem contains details about the problem Problem ProblemDetails `json:"problem"` }
ActionTriggeredEventData contains information about an action.triggered event
type ApprovalFinishedEventData ¶
type ApprovalFinishedEventData struct {
EventData
}
type ApprovalStartedEventData ¶
type ApprovalStartedEventData struct {
EventData
}
type ApprovalStatusChangedEventData ¶
type ApprovalStatusChangedEventData struct {
EventData
}
type ConfigurationChange ¶
type ConfigurationChange struct {
Values map[string]interface{} `json:"values"`
}
type ConfigureMonitoringFinishedEventData ¶
type ConfigureMonitoringFinishedEventData struct {
EventData
}
ConfigureMonitoringFinishedEventData godoc
type ConfigureMonitoringStartedEventData ¶
type ConfigureMonitoringStartedEventData struct {
EventData
}
ConfigureMonitoringStartedEventData godoc
type ConfigureMonitoringTriggeredEventData ¶
type ConfigureMonitoringTriggeredEventData struct { EventData ConfigureMonitoring ConfigureMonitoringTriggeredParams `json:"configureMonitoring"` }
ConfigureMonitoringTriggeredEventData godoc
type ConfigureMonitoringTriggeredParams ¶
type ConfigureMonitoringTriggeredParams struct {
Type string `json:"type"`
}
ConfigureMonitoringTriggeredParams godoc
type Deployment ¶
type Deployment struct { // DeploymentNames gives the names of the deployments DeploymentNames []string `json:"deploymentNames"` }
type DeploymentFinishedData ¶
type DeploymentFinishedData struct { // DeploymentStrategy defines the used deployment strategy DeploymentStrategy string `json:"deploymentstrategy" jsonschema:"enum=direct,enum=blue_green_service,enum=user_managed"` // DeploymentURILocal contains the local URL DeploymentURIsLocal []string `json:"deploymentURIsLocal"` // DeploymentURIPublic contains the public URL DeploymentURIsPublic []string `json:"deploymentURIsPublic,omitempty"` // DeploymentNames gives the names of the deployments DeploymentNames []string `json:"deploymentNames"` }
DeploymentFinishedData contains the data associated with a .deployment.finished event
type DeploymentFinishedEventData ¶
type DeploymentFinishedEventData struct { EventData Deployment DeploymentFinishedData `json:"deployment"` }
type DeploymentStartedEventData ¶
type DeploymentStartedEventData struct {
EventData
}
type DeploymentStatusChangedEventData ¶
type DeploymentStatusChangedEventData struct {
EventData
}
type DeploymentTriggeredData ¶
type DeploymentTriggeredData struct { // DeploymentURILocal contains the local URL DeploymentURIsLocal []string `json:"deploymentURIsLocal"` // DeploymentURIPublic contains the public URL DeploymentURIsPublic []string `json:"deploymentURIsPublic,omitempty"` // DeploymentStrategy defines the used deployment strategy DeploymentStrategy string `json:"deploymentstrategy" jsonschema:"enum=direct,enum=blue_green_service,enum=user_managed"` }
DeploymentTriggeredData contains the data associated with a .deployment.triggered event
type DeploymentTriggeredEventData ¶
type DeploymentTriggeredEventData struct { EventData ConfigurationChange ConfigurationChange `json:"configurationChange"` Deployment DeploymentTriggeredData `json:"deployment"` }
type EnvFrom ¶
type EnvFrom struct { SecretRef WebHookSecretRef `yaml:"secretRef"` Name string `yaml:"name"` }
type Error ¶
type Error struct { StatusType StatusType ResultType ResultType Message string Err error }
type ErrorLogEvent ¶
type Evaluation ¶
type EvaluationDetails ¶
type EvaluationDetails struct { TimeStart string `json:"timeStart"` TimeEnd string `json:"timeEnd"` Result string `json:"result"` Score float64 `json:"score"` SLOFileContent string `json:"sloFileContent"` IndicatorResults []*SLIEvaluationResult `json:"indicatorResults"` ComparedEvents []string `json:"comparedEvents,omitempty"` }
type EvaluationFinishedEventData ¶
type EvaluationFinishedEventData struct { EventData Evaluation EvaluationDetails `json:"evaluation,omitempty"` }
type EvaluationStartedEventData ¶
type EvaluationStartedEventData struct {
EventData
}
type EvaluationStatusChangedEventData ¶
type EvaluationStatusChangedEventData struct {
EventData
}
type EvaluationTriggeredEventData ¶
type EvaluationTriggeredEventData struct { EventData Test Test `json:"test"` Evaluation Evaluation `json:"evaluation"` Deployment Deployment `json:"deployment"` }
type EventData ¶
type EventData struct { Project string `json:"project,omitempty"` Stage string `json:"stage,omitempty"` Service string `json:"service,omitempty"` Labels map[string]string `json:"labels,omitempty"` Status StatusType `json:"status,omitempty" jsonschema:"enum=succeeded,enum=errored,enum=unknown"` Result ResultType `json:"result,omitempty" jsonschema:"enum=pass,enum=warning,enum=fail"` Message string `json:"message,omitempty"` }
EventData contains mandatory fields of all Keptn CloudEvents
func (*EventData) GetProject ¶
func (*EventData) GetService ¶
func (*EventData) SetProject ¶
func (*EventData) SetService ¶
type GetActionData ¶
type GetActionData struct {
ActionIndex int `json:"actionIndex"`
}
type GetActionFinishedEventData ¶
type GetActionFinishedEventData struct { EventData Action ActionInfo `json:"action"` GetAction GetActionData `json:"get-action"` }
type GetActionStartedEventData ¶
type GetActionStartedEventData struct {
EventData
}
type GetActionTriggeredEventData ¶
type GetActionTriggeredEventData struct { EventData Problem ProblemDetails `json:"problem"` GetAction GetActionData `json:"get-action"` }
type GetSLI ¶
type GetSLI struct { // SLIProvider defines the name of the monitoring solution that provides the SLIs SLIProvider string `json:"sliProvider"` // Start defines the start timestamp Start string `json:"start"` // End defines the end timestamp End string `json:"end"` // Indicators defines the SLI names Indicators []string `json:"indicators,omitempty"` // CustomFilters defines filters on the SLIs CustomFilters []*SLIFilter `json:"customFilters,omitempty"` }
type GetSLIFinished ¶
type GetSLIFinishedEventData ¶
type GetSLIFinishedEventData struct { EventData GetSLI GetSLIFinished `json:"get-sli"` }
type GetSLIStartedEventData ¶
type GetSLIStartedEventData struct {
EventData
}
type HTTPEventSender ¶
type HTTPEventSender struct { // EventsEndpoint is the http endpoint the events are sent to EventsEndpoint string // Client is an implementation of the cloudevents.Client interface Client cloudevents.Client // contains filtered or unexported fields }
HTTPEventSender sends CloudEvents via HTTP
func NewHTTPEventSender ¶
func NewHTTPEventSender(endpoint string, opts ...HTTPSenderOption) (*HTTPEventSender, error)
NewHTTPEventSender creates a new HTTPSender
func (HTTPEventSender) Send ¶
func (httpSender HTTPEventSender) Send(ctx context.Context, event cloudevents.Event) error
func (HTTPEventSender) SendEvent ¶
func (httpSender HTTPEventSender) SendEvent(event cloudevents.Event) error
SendEvent sends a CloudEvent
type HTTPSenderOption ¶
type HTTPSenderOption func(httpSender *HTTPEventSender)
func WithSendRetries ¶
func WithSendRetries(retries int) HTTPSenderOption
WithSendRetries allows to specify the number of retries that are performed if the receiver of an event returns a HTTP error code
type Keptn ¶
func (*Keptn) GetShipyard ¶
GetShipyard returns the shipyard definition of a project
func (*Keptn) SendCloudEvent ¶
func (k *Keptn) SendCloudEvent(event cloudevents.Event) error
SendCloudEvent sends a cloudevent to the event broker
func (*Keptn) SendTaskFinishedEvent ¶
SendTaskFinishedEvent sends a .finished event for the incoming .triggered event the KeptnHandler was initialized with. It returns the ID of the sent CloudEvent or an error
func (*Keptn) SendTaskStartedEvent ¶
SendTaskStartedEvent sends a .started event for the incoming .triggered event the KeptnHandler was initialized with. It returns the ID of the sent CloudEvent or an error
func (*Keptn) SendTaskStatusChangedEvent ¶
func (k *Keptn) SendTaskStatusChangedEvent(data keptn.EventProperties, source string) (string, error)
SendTaskStartedEvent sends a .status.changed event for the incoming .triggered event the KeptnHandler was initialized with. It returns the ID of the sent CloudEvent or an error
type KeptnEventBuilder ¶
type KeptnEventBuilder struct {
models.KeptnContextExtendedCE
}
KeptnEventBuilder is used for constructing a new KeptnContextExtendedCE
func KeptnEvent ¶
func KeptnEvent(eventType string, source string, payload interface{}) *KeptnEventBuilder
KeptnEvent creates a builder for a new KeptnContextExtendedCE
func (*KeptnEventBuilder) Build ¶
func (eb *KeptnEventBuilder) Build() (models.KeptnContextExtendedCE, error)
Build creates a value of KeptnContextExtendedCE from the current builder It also does basic validation like the presence of project, service and stage in the event data
func (*KeptnEventBuilder) WithGitCommitID ¶
func (eb *KeptnEventBuilder) WithGitCommitID(gitCommitID string) *KeptnEventBuilder
WithGitCommitID can be used to set the git commit ID
func (*KeptnEventBuilder) WithID ¶
func (eb *KeptnEventBuilder) WithID(id string) *KeptnEventBuilder
WithID can be used to override the ID, which is auto generated by default
func (*KeptnEventBuilder) WithKeptnContext ¶
func (eb *KeptnEventBuilder) WithKeptnContext(keptnContext string) *KeptnEventBuilder
WithKeptnContext can be used to set a keptn context
func (*KeptnEventBuilder) WithKeptnSpecVersion ¶
func (eb *KeptnEventBuilder) WithKeptnSpecVersion(keptnSpecVersion string) *KeptnEventBuilder
WithKeptnSpecVersion can be used to override the keptn spec version
func (*KeptnEventBuilder) WithTriggeredID ¶
func (eb *KeptnEventBuilder) WithTriggeredID(triggeredID string) *KeptnEventBuilder
WithTriggeredID can be used to set the triggered ID
type Metadata ¶
type Metadata struct {
Name string `json:"name" yaml:"name"`
}
Metadata contains meta-data of a resource
type ProblemDetails ¶
type ProblemDetails struct { // ProblemTitle is the display number of the reported problem. ProblemTitle string `json:"problemTitle"` // RootCause is the root cause of the problem RootCause string `json:"rootCause"` }
ProblemDetails contains information about a problem
type ProjectCreateData ¶
type ProjectCreateFinishedEventData ¶
type ProjectCreateFinishedEventData struct { EventData CreatedProject ProjectCreateData `json:"createdProject"` }
type ProjectCreateStartedEventData ¶
type ProjectCreateStartedEventData struct {
EventData
}
type ProjectDeleteData ¶
type ProjectDeleteData struct { }
type ProjectDeleteFinishedEventData ¶
type ProjectDeleteFinishedEventData struct {
EventData
}
type ProjectDeleteStartedEventData ¶
type ProjectDeleteStartedEventData struct {
EventData
}
type ReleaseFinishedEventData ¶
type ReleaseFinishedEventData struct {
EventData
}
type ReleaseStartedEventData ¶
type ReleaseStartedEventData struct {
EventData
}
type ReleaseStatusChangedEventData ¶
type ReleaseStatusChangedEventData struct {
EventData
}
type ReleaseTriggeredEventData ¶
type ReleaseTriggeredEventData struct { EventData Deployment DeploymentFinishedData `json:"deployment"` }
type ResultType ¶
type ResultType string
const ( ResultPass ResultType = "pass" ResultWarning ResultType = "warning" ResultFailed ResultType = "fail" )
type RollbackData ¶
type RollbackData struct { }
type RollbackFinishedEventData ¶
type RollbackFinishedEventData struct {
EventData
}
type RollbackStartedEventData ¶
type RollbackStartedEventData struct {
EventData
}
type RollbackTriggeredEventData ¶
type RollbackTriggeredEventData struct {
EventData
}
type SLIEvaluationResult ¶
type SLIEvaluationResult struct { Score float64 `json:"score"` Value *SLIResult `json:"value"` DisplayName string `json:"displayName"` PassTargets []*SLITarget `json:"passTargets"` WarningTargets []*SLITarget `json:"warningTargets"` KeySLI bool `json:"keySli"` Status string `json:"status" jsonschema:"enum=pass,enum=warning,enum=fail"` }
type Sequence ¶
type Sequence struct { Name string `json:"name" yaml:"name"` TriggeredOn []Trigger `json:"triggeredOn,omitempty" yaml:"triggeredOn,omitempty"` Tasks []Task `json:"tasks" yaml:"tasks"` }
Sequence defines a task sequence by its name and tasks. The triggers property is optional
type ServiceCreateFinishedEventData ¶
type ServiceCreateFinishedEventData struct {
EventData
}
type ServiceCreateStartedEventData ¶
type ServiceCreateStartedEventData struct {
EventData
}
type ServiceCreateStatusChangedEventData ¶
type ServiceCreateStatusChangedEventData struct {
EventData
}
type ServiceDeleteFinishedEventData ¶
type ServiceDeleteFinishedEventData struct {
EventData
}
type ServiceDeleteStartedEventData ¶
type ServiceDeleteStartedEventData struct {
EventData
}
type ServiceDeleteStatusChangedEventData ¶
type ServiceDeleteStatusChangedEventData struct {
EventData
}
type Shipyard ¶
type Shipyard struct { ApiVersion string `json:"apiVersion" yaml:"apiVersion"` Kind string `json:"kind" yaml:"kind"` Metadata Metadata `json:"metadata" yaml:"metadata"` Spec ShipyardSpec `json:"spec" yaml:"spec"` }
Shipyard describes a shipyard specification according to Keptn spec 0.2.0
func DecodeShipyardYAML ¶
DecodeShipyardYAML takes a shipyard string formatted as YAML and decodes it to Shipyard value
type ShipyardSpec ¶
type ShipyardSpec struct {
Stages []Stage `json:"stages" yaml:"stages"`
}
ShipyardSpec consists of any number of stages
type Stage ¶
type Stage struct { Name string `json:"name" yaml:"name"` Sequences []Sequence `json:"sequences" yaml:"sequences"` }
Stage defines a stage by its name and list of task sequences
type StatusType ¶
type StatusType string
const ( StatusSucceeded StatusType = "succeeded" StatusErrored StatusType = "errored" StatusUnknown StatusType = "unknown" StatusAborted StatusType = "aborted" )
type Task ¶
type Task struct { Name string `json:"name" yaml:"name"` TriggeredAfter string `json:"triggeredAfter,omitempty" yaml:"triggeredAfter,omitempty"` Properties interface{} `json:"properties" yaml:"properties"` }
Task defines a task by its name and optional properties
type TestFinishedDetails ¶
type TestFinishedEventData ¶
type TestFinishedEventData struct { EventData Test TestFinishedDetails `json:"test"` }
type TestSender ¶
type TestSender struct { SentEvents []cloudevents.Event Reactors map[string]func(event cloudevents.Event) error }
EventSender fakes the sending of CloudEvents
func (*TestSender) AddReactor ¶
func (s *TestSender) AddReactor(eventTypeSelector string, reactor func(event cloudevents.Event) error)
AddReactor adds custom logic that should be applied when SendEvent is called for the given event type
func (*TestSender) AssertSentEventTypes ¶
func (s *TestSender) AssertSentEventTypes(eventTypes []string) error
AssertSentEventTypes checks if the given event types have been passed to the SendEvent function
func (*TestSender) Send ¶
func (s *TestSender) Send(ctx context.Context, event cloudevents.Event) error
func (*TestSender) SendEvent ¶
func (s *TestSender) SendEvent(event cloudevents.Event) error
SendEvent fakes the sending of CloudEvents
type TestStartedEventData ¶
type TestStartedEventData struct {
EventData
}
type TestStatusChangedEventData ¶
type TestStatusChangedEventData struct {
EventData
}
type TestTriggeredDetails ¶
type TestTriggeredDetails struct { // TestStrategy is the testing strategy and is defined in the shipyard TestStrategy string `json:"teststrategy" jsonschema:"enum=real-user,enum=functional,enum=performance,enum=healthcheck"` }
type TestTriggeredEventData ¶
type TestTriggeredEventData struct { EventData Test TestTriggeredDetails `json:"test"` Deployment TestTriggeredDeploymentDetails `json:"deployment"` }
type Trigger ¶
type Trigger struct { Event string `json:"event" yaml:"event"` Selector Selector `json:"selector,omitempty" yaml:"selector,omitempty"` }
Trigger defines a trigger which causes a sequence to get activated
type WebHookConfig ¶
type WebHookConfig struct { ApiVersion string `yaml:"apiVersion"` Kind string `yaml:"kind"` Metadata Metadata `yaml:"metadata"` Spec WebHookConfigSpec `yaml:"spec"` }
func DecodeWebHookConfigYAML ¶
func DecodeWebHookConfigYAML(webhookConfigYaml []byte) (*WebHookConfig, error)
DecodeWebHookConfigYAML takes a webhook config string formatted as YAML and decodes it to Shipyard value
type WebHookConfigSpec ¶
type WebHookConfigSpec struct {
Webhooks []Webhook `yaml:"webhooks"`
}
type WebHookSecretRef ¶
Source Files ¶
- action.go
- approval.go
- configuration_change.go
- configure_monitoring.go
- deployment.go
- endpoints.go
- error.go
- evaluation.go
- events.go
- getaction.go
- getsli.go
- keptn.go
- log.go
- problemdetails.go
- project_create.go
- project_delete.go
- release.go
- result.go
- rollback.go
- service_create.go
- service_delete.go
- shipyard.go
- status.go
- test.go
- webhook_config.go