lib

package
v0.0.33 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2024 License: Apache-2.0 Imports: 41 Imported by: 164

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewConnection

func NewConnection(natscred NatsCredential) (nc *nats.Conn, err error)

NewConnection creates a new NATS connection

Types

type AuditEventCreator

type AuditEventCreator struct {
	Mapper discovery.ResourceMapper
}

func (*AuditEventCreator) CreateEvent

func (p *AuditEventCreator) CreateEvent(obj client.Object) (*api.Event, error)

type BillingEventCreator

type BillingEventCreator struct {
	Mapper          discovery.ResourceMapper
	ClusterMetadata *kmapi.ClusterMetadata
}

func (*BillingEventCreator) CreateEvent

func (p *BillingEventCreator) CreateEvent(obj client.Object) (*api.Event, error)

type EventCreator

type EventCreator func(obj client.Object) (*api.Event, error)

type EventPublisher

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

func NewEventPublisher

func NewEventPublisher(
	nats *NatsConfig,
	mapper discovery.ResourceMapper,
	fn EventCreator,
) *EventPublisher

func NewResilientEventPublisher added in v0.0.3

func NewResilientEventPublisher(
	fnConnect func() (*NatsConfig, error),
	mapper discovery.ResourceMapper,
	fnCreateEvent EventCreator,
) *EventPublisher

func (*EventPublisher) ForGVK added in v0.0.3

func (p *EventPublisher) ForGVK(informer Informer, gvk schema.GroupVersionKind)

func (*EventPublisher) NatsClient added in v0.0.12

func (p *EventPublisher) NatsClient() (*nats.Conn, error)

func (*EventPublisher) Publish

func (p *EventPublisher) Publish(ev *api.Event, et api.EventType) error

func (*EventPublisher) SetupSiteInfoPublisher added in v0.0.8

func (p *EventPublisher) SetupSiteInfoPublisher(cfg *rest.Config, kc kubernetes.Interface, factory informers.SharedInformerFactory) error

func (*EventPublisher) SetupSiteInfoPublisherWithManager added in v0.0.11

func (p *EventPublisher) SetupSiteInfoPublisherWithManager(mgr manager.Manager) error

func (*EventPublisher) SetupWithManager

func (p *EventPublisher) SetupWithManager(ctx context.Context, mgr manager.Manager, obj client.Object) error

func (*EventPublisher) SetupWithManagerForKind

func (p *EventPublisher) SetupWithManagerForKind(ctx context.Context, mgr manager.Manager, gvk schema.GroupVersionKind) error

type Informer added in v0.0.28

type Informer interface {
	// AddEventHandlerWithResyncPeriod adds an event handler to the shared informer using the
	// specified resync period.  Events to a single handler are delivered sequentially, but there is
	// no coordination between different handlers.
	AddEventHandlerWithResyncPeriod(handler cache.ResourceEventHandler, resyncPeriod time.Duration) (cache.ResourceEventHandlerRegistration, error)
}

Informer - informer allows you interact with the underlying informer.

type NatsConfig

type NatsConfig struct {
	LicenseID string     `json:"licenseID"`
	Subject   string     `json:"natsSubject"`
	Server    string     `json:"natsServer"`
	Client    *nats.Conn `json:"-"`
}

func NewNatsConfig

func NewNatsConfig(cfg *rest.Config, clusterID string, LicenseFile string) (*NatsConfig, error)

type NatsCredential

type NatsCredential struct {
	NatsConfig `json:",inline,omitempty"`
	Credential []byte `json:"credential"`
}

NatsCredential represents the api response of the register licensed user api

type ResourceEventPublisher added in v0.0.3

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

func (*ResourceEventPublisher) OnAdd added in v0.0.3

func (p *ResourceEventPublisher) OnAdd(o interface{}, isInInitialList bool)

func (*ResourceEventPublisher) OnDelete added in v0.0.3

func (p *ResourceEventPublisher) OnDelete(obj interface{})

func (*ResourceEventPublisher) OnUpdate added in v0.0.3

func (p *ResourceEventPublisher) OnUpdate(oldObj, newObj interface{})

type SiteInfoPublisher added in v0.0.31

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

func (*SiteInfoPublisher) OnAdd added in v0.0.31

func (p *SiteInfoPublisher) OnAdd(o interface{}, isInInitialList bool)

func (*SiteInfoPublisher) OnDelete added in v0.0.31

func (p *SiteInfoPublisher) OnDelete(obj interface{})

func (*SiteInfoPublisher) OnUpdate added in v0.0.31

func (p *SiteInfoPublisher) OnUpdate(oldObj, newObj interface{})

Jump to

Keyboard shortcuts

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