common

package
v0.0.0-...-90775a5 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	OpenShiftAPIServerKind = "OpenShiftAPIServer"
	KnativeServingKind     = "Service"
	KnativeEventingKind    = "Broker"
	DicomEventBridgeKind   = "DicomEventBridge"

	AutoDetectTick    = 2 * time.Minute
	RequeueDelay      = 5 * time.Minute
	RequeueDelayError = 5 * time.Second

	EventProcessorServiceImage  = "alvearie/dicom-event-driven-ingestion-postgresql:0.0.1"
	StowServiceImage            = "alvearie/dicomweb-stow-service:0.0.1"
	WadoServiceImage            = "alvearie/dicomweb-wado-service:0.0.1"
	DimseIngestionImage         = "alvearie/dicom-dimse-service:0.0.1"
	StudyBindingServiceImage    = "alvearie/dicomweb-fhir-binding:0.0.1"
	InstanceBindingServiceImage = "alvearie/dicomweb-stow-binding:0.0.1"
	DimseProxyImage             = "alvearie/dicom-dimse-proxy:0.0.1"
	EventBridgeImage            = "alvearie/nats-event-bridge:0.0.1"

	MinScaleAnnotation = "autoscaling.knative.dev/minScale"
	MaxScaleAnnotation = "autoscaling.knative.dev/maxScale"

	ImageStoredEventType    EventType = "ImageStoredEvent"
	DicomAvailableEventType EventType = "DicomAvailableEvent"
	StudyRevisionEventType  EventType = "StudyRevisionEvent"

	BridgeRoleHub  BridgeRole = "hub"
	BridgeRoleEdge BridgeRole = "edge"

	DefaultKServiceMemoryRequest   = "128Mi"
	DefaultKServiceMemoryLimit     = "384Mi"
	DefaultDeploymentMemoryRequest = "64Mi"
	DefaultDeploymentMemoryLimit   = "384Mi"
)
View Source
const (
	ConditionStatusSuccess = "True"
)

Variables

This section is empty.

Functions

func IsBrokerReady

func IsBrokerReady(broker *keventingv1.Broker) (bool, error)

func IsDeploymentReady

func IsDeploymentReady(deployment *appsv1.Deployment) (bool, error)

func IsDicomEventBridgeAvailable

func IsDicomEventBridgeAvailable() bool

func IsKnativeAvailable

func IsKnativeAvailable() bool

func IsResourceFound

func IsResourceFound(client client.Client, ctx context.Context, req ctrl.Request, instance client.Object) (bool, error)

func IsResourceNotReadyError

func IsResourceNotReadyError(err error) bool

func IsServiceReady

func IsServiceReady(service *kservingv1.Service) (bool, error)

func IsSinkBindingReady

func IsSinkBindingReady(binding *ksourcesv1.SinkBinding) (bool, error)

func IsTriggerReady

func IsTriggerReady(trigger *keventingv1.Trigger) (bool, error)

func ResourceExists

func ResourceExists(dc discovery.DiscoveryInterface, apiGroupVersion, kind string) (bool, error)

ResourceExists returns true if the given resource kind exists in the given api groupversion

Types

type ActionRunner

type ActionRunner interface {
	RunAll(desiredState DesiredResourceState) error
	Create(obj client.Object) error
	Update(obj client.Object) error
	Error(err error) error
}

func NewControllerActionRunner

func NewControllerActionRunner(context context.Context, client client.Client, scheme *runtime.Scheme, cr client.Object) ActionRunner

NewControllerActionRunner creates an action runner to run kubernetes actions

type Background

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

Background represents a procedure that runs in the background, periodically auto-detecting features

func NewAutoDetect

func NewAutoDetect(mgr manager.Manager) (*Background, error)

New creates a new auto-detect runner

func (*Background) DetectRequirements

func (b *Background) DetectRequirements()

func (*Background) Start

func (b *Background) Start()

Start initializes the auto-detection process that runs in the background

func (*Background) Stop

func (b *Background) Stop()

Stop causes the background process to stop auto detecting capabilities

type BridgeRole

type BridgeRole string

type ControllerAction

type ControllerAction interface {
	Run(runner ActionRunner) (string, error)
}

type ControllerActionRunner

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

func (*ControllerActionRunner) Create

func (i *ControllerActionRunner) Create(obj client.Object) error

func (*ControllerActionRunner) Error

func (i *ControllerActionRunner) Error(err error) error

func (*ControllerActionRunner) RunAll

func (i *ControllerActionRunner) RunAll(desiredState DesiredResourceState) error

func (*ControllerActionRunner) Update

func (i *ControllerActionRunner) Update(obj client.Object) error

type DesiredResourceState

type DesiredResourceState []ControllerAction

func (*DesiredResourceState) AddAction

func (*DesiredResourceState) AddActions

type EventType

type EventType string

type GenericCreateAction

type GenericCreateAction struct {
	Ref client.Object
	Msg string
}

An action to create generic kubernetes resources (resources that don't require special treatment)

func (GenericCreateAction) Run

func (i GenericCreateAction) Run(runner ActionRunner) (string, error)

type GenericErrorAction

type GenericErrorAction struct {
	Ref error
	Msg string
}

An action to return error

func (GenericErrorAction) Run

func (i GenericErrorAction) Run(runner ActionRunner) (string, error)

type GenericUpdateAction

type GenericUpdateAction struct {
	Ref client.Object
	Msg string
}

An action to update generic kubernetes resources (resources that don't require special treatment)

func (GenericUpdateAction) Run

func (i GenericUpdateAction) Run(runner ActionRunner) (string, error)

type ResourceNotReadyError

type ResourceNotReadyError struct {
	PartialObject client.Object
}

func (*ResourceNotReadyError) Error

func (e *ResourceNotReadyError) Error() string

type StateManager

type StateManager struct {
	*sync.Mutex
	// contains filtered or unexported fields
}

func GetStateManager

func GetStateManager() *StateManager

func (*StateManager) Clear

func (sm *StateManager) Clear()

func (*StateManager) GetState

func (sm *StateManager) GetState(key string) interface{}

func (*StateManager) SetState

func (sm *StateManager) SetState(key string, value interface{})

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳