Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EventOptions ¶
type EventOptions struct { Type SubscriptionType // The name of the subscriptionType, which could be a clusterName or NFDeploy // name. SubscriptionName string }
EventOptions is used for filtering the edge events based on either cluster or parent NfDeploy
type EventPublisher ¶
type EventPublisher interface { // Subscribe returns a channel to receive SubscriptionReq from clients Subscribe() chan *SubscriptionReq // Cancel returns a channel to receive cancellation request in form of // SubscriptionReq from clients. Request should have SubscriptionReq.Ctx, // SubscriptionReq.Error and SubscriptionReq.SubscriberInfo.SubscriberName. Cancel() chan *SubscriptionReq }
EventPublisher publishes k8s events received from the edgeclusters. It allows the clients to subscribe to events using SubscriptionReq.
type Params ¶
type Params struct { GRPCServer *grpc.Server `ignored:"true"` K8sDynamicClient dynamic.Interface `ignored:"true"` PorchClient porch.Client `ignored:"true"` PodIP string `required:"true" envconfig:"POD_IP"` Port string `required:"true" envconfig:"GRPC_PORT"` NephioNamespace string `required:"true" envconfig:"NEPHIO_NAMESPACE"` EdgeClusterNamespace string `required:"true" split_words:"true"` }
type Router ¶
Router maintains subscriptions for receiving events
func NewRouter ¶
NewRouter returns an initialised Router object which can accept subscriptions to get events
func (*Router) Cancel ¶
func (router *Router) Cancel() chan *SubscriptionReq
func (*Router) RouteEvent ¶
func (router *Router) RouteEvent(key preprocessor.RequestKey) ( stream chan *preprocessor.EventMessage)
RouteEvent returns the appropriate channel for sending the events to the router based on the RequestKey
func (*Router) Subscribe ¶
func (router *Router) Subscribe() chan *SubscriptionReq
type SubscriberInfo ¶
type SubscriberInfo struct { // SubscriberName is used for uniquely identifying the subscriber SubscriberName string // Channel is used for sending the preprocessor.Event to the subscriber Channel chan preprocessor.Event // contains filtered or unexported fields }
SubscriberInfo uniquely identifies a subscriber
type SubscriptionReq ¶
type SubscriptionReq struct { Ctx context.Context // Error is used to send any non-retryable error occurred during the // subscription/cancellation process and nil is sent in case of successful // subscription/cancellation. Error chan error EventOptions SubscriberInfo }
type SubscriptionType ¶
type SubscriptionType string
const ( ClusterSubscriber SubscriptionType = "clusterSubscriber" NfDeploySubscriber SubscriptionType = "nfdeploySubscriber" )
Source Files ¶
Click to show internal directories.
Click to hide internal directories.