reconcile

package
v0.11.21 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2021 License: Apache-2.0 Imports: 17 Imported by: 1

Documentation

Index

Constants

View Source
const DefaultProxyBrokerPrefix = "sm-"

DefaultProxyBrokerPrefix prefix for brokers registered by the proxy

Variables

This section is empty.

Functions

This section is empty.

Types

type Consumer added in v0.4.0

type Consumer interface {
	Consume(ctx context.Context, notification *types.Notification)
}

Consumer provides functionality for consuming notifications

type Reconciler added in v0.4.0

type Reconciler struct {
	Consumer Consumer
	Resyncer Resyncer
}

Reconciler takes care of propagating broker and visibility changes to the platform. TODO if the reg credentials are changed (the ones under cf.reg) we need to update the already registered brokers

func (*Reconciler) Reconcile added in v0.4.0

func (r *Reconciler) Reconcile(ctx context.Context, messages <-chan *notifications.Message, group *sync.WaitGroup)

Reconcile listens for notification messages and either consumes the notification or triggers a resync

type Resyncer added in v0.4.0

type Resyncer interface {
	Resync(ctx context.Context, resyncVisibilities bool)
}

Resyncer provides functionality for triggering a resync on the platform

func NewResyncer added in v0.4.0

func NewResyncer(settings *Settings, platformClient platform.Client, smClient sm.Client, smSettings *sm.Settings, smPath, proxyPathPattern string) Resyncer

NewResyncer returns a resyncer that reconciles the state of the proxy brokers and visibilities in the platform to match the desired state provided by the Service Manager.

type Settings

type Settings struct {
	LegacyURL                 string   `mapstructure:"legacy_url"`
	MaxParallelRequests       int      `mapstructure:"max_parallel_requests"`
	URL                       string   `mapstructure:"url"`
	BrokerPrefix              string   `mapstructure:"broker_prefix"`
	BrokerBlacklist           []string `mapstructure:"broker_blacklist"`
	TakeoverEnabled           bool     `mapstructure:"takeover_enabled"`
	BrokerCredentialsEnabled  bool     `mapstructure:"broker_credentials_enabled"`
	VisibilityBrokerChunkSize int      `mapstructure:"visibility_broker_chunk_size"`
}

Settings type represents the sbproxy settings

func DefaultSettings

func DefaultSettings() *Settings

DefaultSettings creates default proxy settings

func (*Settings) Validate

func (c *Settings) Validate() error

Validate validates that the configuration contains all mandatory properties

type TaskScheduler added in v0.8.1

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

TaskScheduler schedules tasks to be executed in parallel

func NewScheduler added in v0.8.1

func NewScheduler(ctx context.Context, maxParallelTasks int) *TaskScheduler

NewScheduler return a new task scheduler configured to execute a maximum of maxParallelTasks concurrently

func (*TaskScheduler) Await added in v0.8.1

func (state *TaskScheduler) Await() error

Await waits for the completion of all scheduled tasks

func (*TaskScheduler) Schedule added in v0.8.1

func (state *TaskScheduler) Schedule(f func(context.Context) error) error

Schedule schedules the specified task to be executed

type TimestampedError added in v0.7.1

type TimestampedError struct {
	Cause     error
	Timestamp string
}

TimestampedError contains an error and a timestamp in time.RFC3339Nano format

func (TimestampedError) Error added in v0.7.1

func (te TimestampedError) Error() string

Jump to

Keyboard shortcuts

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