service

package
v1.24.1 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2024 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConsumeEvents

func ConsumeEvents(ctx context.Context, appClient SimplifiedApplicationServiceClient, dispatcher *Dispatcher, hlth *setup.HealthReporter) error

Types

type ArgoEvent

type ArgoEvent struct {
	Environment      string
	Application      string
	SyncStatusCode   v1alpha1.SyncStatusCode
	HealthStatusCode health.HealthStatusCode
	OperationState   *v1alpha1.OperationState
	Version          *versions.VersionInfo
}

type ArgoEventProcessor

type ArgoEventProcessor interface {
	ProcessArgoEvent(ctx context.Context, ev ArgoEvent)
}

type Broadcast

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

func New

func New() *Broadcast

func (*Broadcast) DisconnectAll

func (b *Broadcast) DisconnectAll()

Disconnects all listeners. This is used in tests to check wheter subscribers handle reconnects

func (*Broadcast) GetStatus

func (*Broadcast) ProcessArgoEvent

func (b *Broadcast) ProcessArgoEvent(ctx context.Context, ev ArgoEvent)

ProcessArgoEvent implements service.EventProcessor

func (*Broadcast) ProcessKuberpultEvent

func (b *Broadcast) ProcessKuberpultEvent(ctx context.Context, ev versions.KuberpultEvent)

func (*Broadcast) Start

func (b *Broadcast) Start() ([]*BroadcastEvent, <-chan *BroadcastEvent, unsubscribe)

func (*Broadcast) StreamStatus

type BroadcastEvent

type BroadcastEvent struct {
	Key
	EnvironmentGroup string
	Team             string
	IsProduction     *bool
	ArgocdVersion    *versions.VersionInfo
	KuberpultVersion *versions.VersionInfo
	RolloutStatus    api.RolloutStatus
}

type Dispatcher added in v1.17.0

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

The dispatcher is responsible for enriching argo events with version data from kuberpult. It also maintains a backlog of applications where adding this data failed. The backlog is retried frequently so that missing data eventually can be resolved.

func NewDispatcher added in v1.17.0

func NewDispatcher(sink ArgoEventProcessor, vc versions.VersionClient) *Dispatcher

func (*Dispatcher) Dispatch added in v1.17.0

func (r *Dispatcher) Dispatch(ctx context.Context, k Key, ev *v1alpha1.ApplicationWatchEvent)

func (*Dispatcher) Work added in v1.17.0

func (r *Dispatcher) Work(ctx context.Context, hlth *setup.HealthReporter) error

type Key

type Key struct {
	Application string
	Environment string
}

type SimplifiedApplicationServiceClient

type SimplifiedApplicationServiceClient interface {
	Watch(ctx context.Context, qry *application.ApplicationQuery, opts ...grpc.CallOption) (application.ApplicationService_WatchClient, error)
}

this is a simpler version of ApplicationServiceClient from the application package

Jump to

Keyboard shortcuts

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