subscription

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2021 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ClientFactory

type ClientFactory struct{}

ClientFactory generates WatchClients for a pod

func (*ClientFactory) Client

func (f *ClientFactory) Client(ctx context.Context, url string) (Watcher, error)

Client gets a Watch client for an address

type Factory

type Factory interface {
	Client(ctx context.Context, url string) (Watcher, error)
}

Factory returns a watch grpc client

type PodLister

type PodLister interface {
	List(context.Context, metav1.ListOptions) (*corev1.PodList, error)
}

PodLister gets the pods running in the cluster

type Processor

type Processor struct {
	Factory             Factory
	ProcessorRepository ProcessorRepository
	PodLister           PodLister
}

Processor provides processor watches

func (*Processor) WatchProcessor

func (p *Processor) WatchProcessor(ctx context.Context, input *model.WatchProcessorInput) (<-chan *model.Operation, error)

WatchProcessor watches a processor by key

type ProcessorRepository

type ProcessorRepository interface {
	PodsByProcessors(context.Context, []int) ([][]*model.Pod, error)
	ByID(context.Context, int) (*model.Processor, error)
	ComponentByProcessors(context.Context, []int) ([]*model.Component, error)
}

ProcessorRepository is the datastore repository for processors

type Subscribers

type Subscribers struct {
	PodLister           PodLister
	Factory             Factory
	ProcessorRepository ProcessorRepository
}

Subscribers provides real time subscription handlers

func NewSubscribers

func NewSubscribers(podLister PodLister, processorRepository ProcessorRepository) *Subscribers

NewSubscribers creates new subscribers

func (*Subscribers) Processor

func (s *Subscribers) Processor() resolvers.ProcessorWatcher

Processor returns the processor subscriber handler

type Watcher

type Watcher interface {
	Processor(ctx context.Context, in *watchv1.ProcessorRequest, opts ...grpc.CallOption) (watchv1.WatchAPI_ProcessorClient, error)
}

Watcher watches a processor by key

Jump to

Keyboard shortcuts

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