lib

package
Version: v0.0.15 Latest Latest
Warning

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

Go to latest
Published: Jan 2, 2022 License: Apache-2.0 Imports: 36 Imported by: 157

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
}

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 (*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 NatsConfig

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

func NewNatsConfig

func NewNatsConfig(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{})

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{})

Jump to

Keyboard shortcuts

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