target

package
v0.0.45 Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2025 License: Apache-2.0 Imports: 37 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var LookupError = errors.New("target lookup error")

Functions

This section is empty.

Types

type Collector added in v0.0.44

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

func NewCollector added in v0.0.44

func NewCollector(targetKey storebackend.Key, subscriptions *Subscriptions) *Collector

func (*Collector) GetUpdateChan added in v0.0.44

func (r *Collector) GetUpdateChan() chan struct{}

func (*Collector) IsRunning added in v0.0.44

func (r *Collector) IsRunning() bool

func (*Collector) SetPort added in v0.0.44

func (r *Collector) SetPort(port uint)

func (*Collector) Start added in v0.0.44

func (*Collector) StartSubscription added in v0.0.44

func (r *Collector) StartSubscription(ctx context.Context)

func (*Collector) Stop added in v0.0.44

func (r *Collector) Stop(ctx context.Context)

func (*Collector) StopSubscription added in v0.0.44

func (r *Collector) StopSubscription(ctx context.Context)

type Context

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

func New

func New(targetKey storebackend.Key, client client.Client, dsclient dsclient.Client) *Context

func (*Context) CreateDS

func (r *Context) CreateDS(ctx context.Context, datastoreReq *sdcpb.CreateDataStoreRequest) error

func (*Context) DeleteDS

func (r *Context) DeleteDS(ctx context.Context) error

func (*Context) DeleteIntent

func (r *Context) DeleteIntent(ctx context.Context, key storebackend.Key, config *config.Config, dryRun bool) (*config.Config, error)

func (*Context) DeleteSubscription added in v0.0.44

func (r *Context) DeleteSubscription(ctx context.Context, sub *invv1alpha1.Subscription) error

func (*Context) GetAddress

func (r *Context) GetAddress() string

func (*Context) GetCache added in v0.0.44

func (r *Context) GetCache() cache.Cache

func (*Context) GetData

func (r *Context) GetData(ctx context.Context, key storebackend.Key) (*config.RunningConfig, error)

func (*Context) GetDataStore

func (*Context) GetPrombLabels added in v0.0.44

func (r *Context) GetPrombLabels() []prompb.Label

func (*Context) GetSchema

func (*Context) IsReady

func (r *Context) IsReady() bool

func (*Context) SetIntent

func (r *Context) SetIntent(ctx context.Context, key storebackend.Key, config *config.Config, useSpec, dryRun bool) (*config.Config, error)

func (*Context) SetNotReady added in v0.0.43

func (r *Context) SetNotReady(ctx context.Context)

func (*Context) SetReady

func (r *Context) SetReady(ctx context.Context)

func (*Context) UpsertSubscription added in v0.0.44

func (r *Context) UpsertSubscription(ctx context.Context, sub *invv1alpha1.Subscription) error

type DeviationWatcher

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

func NewDeviationWatcher

func NewDeviationWatcher(targetKey storebackend.Key, client client.Client, dsclient dsclient.Client) *DeviationWatcher

func (*DeviationWatcher) Start

func (r *DeviationWatcher) Start(ctx context.Context)

func (*DeviationWatcher) Stop

func (r *DeviationWatcher) Stop(ctx context.Context)

type Path added in v0.0.44

type Path struct {
	Path     string
	Interval int
}

type PathSubscriptions added in v0.0.44

type PathSubscriptions struct {
	Current *Subscription
	// AllSubscriptions list all the subscriptions that are in the system, the key is name of the subscription CR
	AllSubscriptions map[string]*Subscription
}

type Subscription added in v0.0.44

type Subscription struct {
	NSN         string // namespacedname of the CR that originated this subscription
	Name        string // name of the subscription
	Description *string
	Labels      map[string]string
	Enabled     bool
	Interval    int // 0 = onChange
	Encoding    invv1alpha1.Encoding
}

type Subscriptions added in v0.0.44

type Subscriptions struct {
	Paths store.Storer[*PathSubscriptions]
}

func NewSubscriptions added in v0.0.44

func NewSubscriptions() *Subscriptions

func (*Subscriptions) AddSubscription added in v0.0.44

func (r *Subscriptions) AddSubscription(subscription *invv1alpha1.Subscription) error

Add or update a subscription

func (*Subscriptions) DelSubscription added in v0.0.44

func (r *Subscriptions) DelSubscription(subscription *invv1alpha1.Subscription) error

func (*Subscriptions) GetPaths added in v0.0.44

func (r *Subscriptions) GetPaths() map[invv1alpha1.Encoding][]Path

func (*Subscriptions) HasSubscriptions added in v0.0.44

func (r *Subscriptions) HasSubscriptions() bool

type TargetHandler added in v0.0.27

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

func NewTargetHandler added in v0.0.27

func NewTargetHandler(client client.Client, targetStore storebackend.Storer[*Context]) *TargetHandler

func (*TargetHandler) DeleteIntent added in v0.0.27

func (r *TargetHandler) DeleteIntent(ctx context.Context, targetKey types.NamespacedName, config *config.Config, dryRun bool) (*config.Config, error)

func (*TargetHandler) GetData added in v0.0.27

func (r *TargetHandler) GetData(ctx context.Context, targetKey types.NamespacedName) (*config.RunningConfig, error)

func (*TargetHandler) GetTargetContext added in v0.0.27

func (r *TargetHandler) GetTargetContext(ctx context.Context, targetKey types.NamespacedName) (*invv1alpha1.Target, *Context, error)

GetTargetContext returns a invTarget and targetContext when the target is ready and the ctx is found

func (*TargetHandler) SetIntent added in v0.0.27

func (r *TargetHandler) SetIntent(ctx context.Context, targetKey types.NamespacedName, config *config.Config, useSpec, dryRun bool) (*config.Config, *config.ConfigStatusLastKnownGoodSchema, error)

Jump to

Keyboard shortcuts

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