handlers

package
v0.23.0 Latest Latest
Warning

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

Go to latest
Published: May 25, 2021 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ApiServerSourceCreateProbeEventType is the CloudEvent type of forward
	// ApiServerSource create probes.
	ApiServerSourceCreateProbeEventType = "apiserversource-probe-create"

	// ApiServerSourceUpdateProbeEventType is the CloudEvent type of forward
	// ApiServerSource update probes.
	ApiServerSourceUpdateProbeEventType = "apiserversource-probe-update"

	// ApiServerSourceDeleteProbeEventType is the CloudEvent type of forward
	// ApiServerSource delete probes.
	ApiServerSourceDeleteProbeEventType = "apiserversource-probe-delete"
)
View Source
const (
	// CloudStorageSourceCreateProbeEventType is the CloudEvent type of forward
	// CloudStorageSource create probes.
	CloudStorageSourceCreateProbeEventType = "cloudstoragesource-probe-create"

	// CloudStorageSourceUpdateMetadataProbeEventType is the CloudEvent type of forward
	// CloudStorageSource update-metadata probes.
	CloudStorageSourceUpdateMetadataProbeEventType = "cloudstoragesource-probe-update-metadata"

	// CloudStorageSourceArchiveProbeEventType is the CloudEvent type of forward
	// CloudStorageSource archive probes.
	CloudStorageSourceArchiveProbeEventType = "cloudstoragesource-probe-archive"

	// CloudStorageSourceDeleteProbeEventType is the CloudEvent type of forward
	// CloudStorageSource delete probes.
	CloudStorageSourceDeleteProbeEventType = "cloudstoragesource-probe-delete"
)
View Source
const (
	// BrokerE2EDeliveryProbeEventType is the CloudEvent type of broker e2e
	// delivery probes.
	BrokerE2EDeliveryProbeEventType = "broker-e2e-delivery-probe"
)
View Source
const (
	// CloudAuditLogsSourceProbeEventType is the CloudEvent type of forward
	// CloudAuditLogsSource probes.
	CloudAuditLogsSourceProbeEventType = "cloudauditlogssource-probe"
)
View Source
const (
	// CloudPubSubSourceProbeEventType is the CloudEvent type of forward
	// CloudPubSubSource probes.
	CloudPubSubSourceProbeEventType = "cloudpubsubsource-probe"
)
View Source
const (
	// CloudSchedulerSourceProbeEventType is the CloudEvent type of forward
	// CloudSchedulerSource probes.
	CloudSchedulerSourceProbeEventType = "cloudschedulersource-probe"
)
View Source
const (
	// PingSourceProbeEventType is the CloudEvent type of forward
	// PingSource probes.
	PingSourceProbeEventType = "pingsource-probe"
)

Variables

Functions

func NewLivenessChecker

func NewLivenessChecker(cloudSchedulerProbe *CloudSchedulerSourceProbe, pingSourceProbe *PingSourceProbe) *utils.LivenessChecker

Types

type ApiServerSourceCreateProbe added in v0.21.0

type ApiServerSourceCreateProbe struct {
	*ApiServerSourceProbe
}

func (*ApiServerSourceCreateProbe) Forward added in v0.21.0

Forward creates a pod in order to generate an ApiServerSource notification event.

type ApiServerSourceDeleteProbe added in v0.21.0

type ApiServerSourceDeleteProbe struct {
	*ApiServerSourceProbe
}

func (*ApiServerSourceDeleteProbe) Forward added in v0.21.0

Forward deletes a pod in order to generate an ApiServerSource notification event.

type ApiServerSourceProbe added in v0.21.0

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

ApiServerSourceProbe is the probe handler for probe requests in the ApiServerSource probe.

func NewApiServerSourceProbe added in v0.21.0

func NewApiServerSourceProbe(projectID clients.ProjectID, k8sClient kubernetes.Interface) *ApiServerSourceProbe

func (*ApiServerSourceProbe) Receive added in v0.21.0

func (p *ApiServerSourceProbe) Receive(ctx context.Context, event cloudevents.Event) error

Receive closes the receiver channel associated with an ApiServerSource notification event.

type ApiServerSourceUpdateProbe added in v0.21.0

type ApiServerSourceUpdateProbe struct {
	*ApiServerSourceProbe
}

func (*ApiServerSourceUpdateProbe) Forward added in v0.21.0

Forward updates a pod in order to generate an ApiServerSource notification event.

type BrokerE2EDeliveryProbe

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

BrokerE2EDeliveryProbe is the probe handler for probe requests in the broker e2e delivery probe.

func NewBrokerE2EDeliveryProbe

func NewBrokerE2EDeliveryProbe(brokerCellIngressBaseURL string, client CeForwardClient) *BrokerE2EDeliveryProbe

func (*BrokerE2EDeliveryProbe) Forward

Forward sends an event to a given broker in a given namespace.

func (*BrokerE2EDeliveryProbe) Receive

Receive closes the receiver channel associated with a particular event.

type CeForwardClient

type CeForwardClient cloudevents.Client

type CePubSubClient

type CePubSubClient cloudevents.Client

type CeReceiveClient

type CeReceiveClient cloudevents.Client

type CloudAuditLogsSourceProbe

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

CloudAuditLogsSourceProbe is the probe handler for probe requests in the CloudAuditLogsSource probe.

func NewCloudAuditLogsSourceProbe

func NewCloudAuditLogsSourceProbe(projectID clients.ProjectID, pubsubClient *pubsub.Client) *CloudAuditLogsSourceProbe

func (*CloudAuditLogsSourceProbe) Forward

Forward creates a Pub/Sub topic in order to generate a Cloud Audit Logs notification event.

func (*CloudAuditLogsSourceProbe) Receive

Receive closes the receiver channel associated with a Cloud Audit Logs notification event.

type CloudPubSubSourceProbe

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

CloudPubSubSourceProbe is the probe handler for probe requests in the CloudPubSubSource probe.

func NewCloudPubSubSourceProbe

func NewCloudPubSubSourceProbe(cePubsubClient CePubSubClient) *CloudPubSubSourceProbe

func (*CloudPubSubSourceProbe) Forward

Forward publishes to Pub/Sub in order to generate a notification event.

func (*CloudPubSubSourceProbe) Receive

Receive closes the receiver channel associated with a Pub/Sub notification event.

type CloudSchedulerSourceProbe

type CloudSchedulerSourceProbe struct {
	// The map of times of observed ticks in the CloudSchedulerSource probe
	EventTimes utils.SyncTimesMap

	// StaleDuration is the duration after which entries in the EventTimes map are
	// considered stale and should be cleaned up in the liveness probe.
	StaleDuration time.Duration
}

CloudSchedulerSourceProbe is the probe handler for probe requests in the CloudSchedulerSource probe.

func NewCloudSchedulerSourceProbe

func NewCloudSchedulerSourceProbe(staleDuration time.Duration) *CloudSchedulerSourceProbe

func (*CloudSchedulerSourceProbe) CleanupStaleSchedulerTimes

func (p *CloudSchedulerSourceProbe) CleanupStaleSchedulerTimes() utils.ActionFunc

CleanupStaleSchedulerTimes returns a handler which loops through each scheduler event time and clears the stale entries from the EventTimes map.

func (*CloudSchedulerSourceProbe) Forward

Forward tests the delay between the current time and the latest recorded Cloud Scheduler tick in a given scope.

func (*CloudSchedulerSourceProbe) Receive

Receive refreshes the latest timestamp for a Cloud Scheduler tick in a given scope.

type CloudStorageSourceArchiveProbe

type CloudStorageSourceArchiveProbe struct {
	*CloudStorageSourceProbe
}

CloudStorageSourceArchiveProbe is the probe handler for probe requests in the CloudStorageSource archive probe.

func (*CloudStorageSourceArchiveProbe) Forward

Forward archives a Cloud Storage object in order to generate a notification event.

type CloudStorageSourceCreateProbe

type CloudStorageSourceCreateProbe struct {
	*CloudStorageSourceProbe
}

CloudStorageSourceCreateProbe is the probe handler for probe requests in the CloudStorageSource create probe.

func (*CloudStorageSourceCreateProbe) Forward

Forward writes an object to Cloud Storage in order to generate a notification event.

type CloudStorageSourceDeleteProbe

type CloudStorageSourceDeleteProbe struct {
	*CloudStorageSourceProbe
}

CloudStorageSourceDeleteProbe is the probe handler for probe requests in the CloudStorageSource delete probe.

func (*CloudStorageSourceDeleteProbe) Forward

Forward deletes a Cloud Storage object in order to generate a notification event.

type CloudStorageSourceProbe

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

CloudStorageSourceProbe is the base probe type for probe requests in the CloudStorageSource probes. Since all of the CloudStorageSource probes share the same Receive logic, they all inherit it from this object.

func NewCloudStorageSourceProbe

func NewCloudStorageSourceProbe(storageClient *storage.Client) *CloudStorageSourceProbe

func (*CloudStorageSourceProbe) Receive

Receive closes the receiver channel associated with the Cloud Storage notification event.

type CloudStorageSourceUpdateMetadataProbe

type CloudStorageSourceUpdateMetadataProbe struct {
	*CloudStorageSourceProbe
}

CloudStorageSourceUpdateMetadataProbe is the probe handler for probe requests in the CloudStorageSource update-metadata probe.

func (*CloudStorageSourceUpdateMetadataProbe) Forward

Forward modifies a Cloud Storage object's metadata in order to generate a notification event.

type EventTypeProbe

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

EventTypeProbe is a handler that maps an event types to its corresponding underlying handler.

func NewEventTypeHandler

func NewEventTypeHandler(brokerE2EDeliveryProbe *BrokerE2EDeliveryProbe, cloudPubSubSourceProbe *CloudPubSubSourceProbe,
	cloudStorageSourceCreateProbe *CloudStorageSourceCreateProbe, cloudStorageSourceUpdateMetadataProbe *CloudStorageSourceUpdateMetadataProbe,
	cloudStorageSourceArchiveProbe *CloudStorageSourceArchiveProbe, cloudStorageSourceDeleteProbe *CloudStorageSourceDeleteProbe,
	cloudAuditLogsSourceProbe *CloudAuditLogsSourceProbe, apiServerSourceCreateProbe *ApiServerSourceCreateProbe, apiServerSourceUpdateProbe *ApiServerSourceUpdateProbe, apiServerSourceDeleteProbe *ApiServerSourceDeleteProbe, cloudSchedulerSourceProbe *CloudSchedulerSourceProbe, pingSourceProbe *PingSourceProbe) *EventTypeProbe

func (*EventTypeProbe) Forward

func (p *EventTypeProbe) Forward(ctx context.Context, event cloudevents.Event) error

func (*EventTypeProbe) Receive

func (p *EventTypeProbe) Receive(ctx context.Context, event cloudevents.Event) error

type Interface

type Interface interface {
	// Forward is the handler function which is called for probe requests which come
	// from PROBE_PORT.
	Forward(context.Context, cloudevents.Event) error
	// Receive is the handler function which is called for probe requests which come
	// from RECEIVER_PORT.
	Receive(context.Context, cloudevents.Event) error
}

Interface is the interface which static probe objects should implement.

type PingSourceProbe added in v0.21.0

type PingSourceProbe struct {
	// The map of times of observed ticks in the PingSource probe
	EventTimes utils.SyncTimesMap

	// StaleDuration is the duration after which entries in the EventTimes map are
	// considered stale and should be cleaned up in the liveness probe.
	StaleDuration time.Duration
}

PingSourceProbe is the probe handler for probe requests in the PingSource probe.

func NewPingSourceProbe added in v0.21.0

func NewPingSourceProbe(staleDuration time.Duration) *PingSourceProbe

func (*PingSourceProbe) CleanupStalePingSourceTimes added in v0.21.0

func (p *PingSourceProbe) CleanupStalePingSourceTimes() utils.ActionFunc

CleanupStalePingSourceTimes returns a handler which loops through each PingSource event time and clears the stale entries from the EventTimes map.

func (*PingSourceProbe) Forward added in v0.21.0

func (p *PingSourceProbe) Forward(ctx context.Context, event cloudevents.Event) error

Forward tests the delay between the current time and the latest recorded PingSource tick in a given scope.

func (*PingSourceProbe) Receive added in v0.21.0

func (p *PingSourceProbe) Receive(ctx context.Context, event cloudevents.Event) error

Receive refreshes the latest timestamp for a PingSource tick in a given scope.

Jump to

Keyboard shortcuts

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