status

package
v0.0.0-...-88a3487 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2020 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Copyright 2020 IBM Corporation

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

View Source
const (
	MAX_RETAINED_MESSAGES = 100 // maximum number of messages to retain

	/* Operations names */
	OPERATION_VALIDATE_WEBHOOK_SECRET = "validate-webhook-secret"
	OPERATION_RESOLVE_REPOSITORY_TYPE = "resolve-repository-type"
	OPERATION_FIND_MEDIATION          = "find-mediation"
	OPERATION_INITIALIZE_VARIABLES    = "initialize-mediation-variables"
	OPERATION_EVALUATE_MEDIATION      = "evaluate-mediation"
	OPERATION_SEND_EVENT              = "send-event"

	/* Parameter names */
	PARAM_FROM          = "from"
	PARAM_MEDIATION     = "mediation"
	PARAM_FILE          = "file"
	PARAM_DESTINATION   = "destination"
	PARAM_URL           = "url"
	PARAM_URLEXPRESSION = "urlExpression"
	PARAM_REPOSITORY    = "repository"
	PARAM_BRANCH        = "branch"
	PARAM_GITHUB_EVENT  = "github-event"
	PARAM_STACK         = "stack"

	/* Results */
	RESULT_FAILED    = "failed"
	RESULT_COMPLETED = "completed"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type StatusManager

type StatusManager struct {
	// contains filtered or unexported fields
}

func NewStatusManager

func NewStatusManager() *StatusManager

func (*StatusManager) AddEventSummary

func (sm *StatusManager) AddEventSummary(summary *eventsv1alpha1.EventStatusSummary)
Add an EventSummary.

input:

summary: the summary to add. The caller no longer owns the summary after calling.

func (*StatusManager) GetStatusSummary

func (sm *StatusManager) GetStatusSummary() []eventsv1alpha1.EventStatusSummary

func (*StatusManager) SendStatus

func (sm *StatusManager) SendStatus(updater *Updater)

Send status to Status Updater if there is a status change

type StatusParameters

type StatusParameters struct {
	// contains filtered or unexported fields
}

func NewStatusParameters

func NewStatusParameters() *StatusParameters

func (*StatusParameters) AddParameter

func (sp *StatusParameters) AddParameter(name string, value string)

func (*StatusParameters) GetStatusParameters

func (sp *StatusParameters) GetStatusParameters() []eventsv1alpha1.EventStatusParameter

type Updater

type Updater struct {
	// contains filtered or unexported fields
}

The Status Updater is used to update status in a resource efficient manner.

Status changes are not updated immediately. Instead, they are accumulated for up to a configurable time.
In addition, there is no polling thread to check for status updates.

func NewSatusUpdater

func NewSatusUpdater(client client.Client, namespace string, name string, duration time.Duration) *Updater

func (*Updater) SendUpdate

func (updater *Updater) SendUpdate(summary []eventsv1alpha1.EventStatusSummary)

Send Update

Jump to

Keyboard shortcuts

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