Documentation ¶
Index ¶
- Constants
- Variables
- func NewLivenessChecker(cloudSchedulerProbe *CloudSchedulerSourceProbe, ...) *utils.LivenessChecker
- type ApiServerSourceCreateProbe
- type ApiServerSourceDeleteProbe
- type ApiServerSourceProbe
- type ApiServerSourceUpdateProbe
- type BrokerE2EDeliveryProbe
- type CeForwardClient
- type CePubSubClient
- type CeReceiveClient
- type CloudAuditLogsSourceProbe
- type CloudPubSubSourceProbe
- type CloudSchedulerSourceProbe
- type CloudStorageSourceArchiveProbe
- type CloudStorageSourceCreateProbe
- type CloudStorageSourceDeleteProbe
- type CloudStorageSourceProbe
- type CloudStorageSourceUpdateMetadataProbe
- type EventTypeProbe
- type Interface
- type PingSourceProbe
Constants ¶
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" )
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" )
const ( // BrokerE2EDeliveryProbeEventType is the CloudEvent type of broker e2e // delivery probes. BrokerE2EDeliveryProbeEventType = "broker-e2e-delivery-probe" )
const ( // CloudAuditLogsSourceProbeEventType is the CloudEvent type of forward // CloudAuditLogsSource probes. CloudAuditLogsSourceProbeEventType = "cloudauditlogssource-probe" )
const ( // CloudPubSubSourceProbeEventType is the CloudEvent type of forward // CloudPubSubSource probes. CloudPubSubSourceProbeEventType = "cloudpubsubsource-probe" )
const ( // CloudSchedulerSourceProbeEventType is the CloudEvent type of forward // CloudSchedulerSource probes. CloudSchedulerSourceProbeEventType = "cloudschedulersource-probe" )
const ( // PingSourceProbeEventType is the CloudEvent type of forward // PingSource probes. PingSourceProbeEventType = "pingsource-probe" )
Variables ¶
var HandlerSet wire.ProviderSet = wire.NewSet( wire.Bind(new(Interface), new(*EventTypeProbe)), NewEventTypeHandler, utils.NewSyncReceivedEvents, NewBrokerE2EDeliveryProbe, NewCloudAuditLogsSourceProbe, NewApiServerSourceProbe, wire.Struct(new(ApiServerSourceCreateProbe), "*"), wire.Struct(new(ApiServerSourceUpdateProbe), "*"), wire.Struct(new(ApiServerSourceDeleteProbe), "*"), NewCloudPubSubSourceProbe, NewCloudSchedulerSourceProbe, NewPingSourceProbe, NewCloudStorageSourceProbe, wire.Struct(new(CloudStorageSourceCreateProbe), "*"), wire.Struct(new(CloudStorageSourceDeleteProbe), "*"), wire.Struct(new(CloudStorageSourceArchiveProbe), "*"), wire.Struct(new(CloudStorageSourceUpdateMetadataProbe), "*"), NewLivenessChecker, )
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
func (p *ApiServerSourceCreateProbe) Forward(ctx context.Context, event cloudevents.Event) error
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
func (p *ApiServerSourceDeleteProbe) Forward(ctx context.Context, event cloudevents.Event) error
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
func (p *ApiServerSourceUpdateProbe) Forward(ctx context.Context, event cloudevents.Event) error
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 ¶
func (p *BrokerE2EDeliveryProbe) Forward(ctx context.Context, event cloudevents.Event) error
Forward sends an event to a given broker in a given namespace.
func (*BrokerE2EDeliveryProbe) Receive ¶
func (p *BrokerE2EDeliveryProbe) Receive(ctx context.Context, event cloudevents.Event) error
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 ¶
func (p *CloudAuditLogsSourceProbe) Forward(ctx context.Context, event cloudevents.Event) error
Forward creates a Pub/Sub topic in order to generate a Cloud Audit Logs notification event.
func (*CloudAuditLogsSourceProbe) Receive ¶
func (p *CloudAuditLogsSourceProbe) Receive(ctx context.Context, event cloudevents.Event) error
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 ¶
func (p *CloudPubSubSourceProbe) Forward(ctx context.Context, event cloudevents.Event) error
Forward publishes to Pub/Sub in order to generate a notification event.
func (*CloudPubSubSourceProbe) Receive ¶
func (p *CloudPubSubSourceProbe) Receive(ctx context.Context, event cloudevents.Event) error
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 ¶
func (p *CloudSchedulerSourceProbe) Forward(ctx context.Context, event cloudevents.Event) error
Forward tests the delay between the current time and the latest recorded Cloud Scheduler tick in a given scope.
func (*CloudSchedulerSourceProbe) Receive ¶
func (p *CloudSchedulerSourceProbe) Receive(ctx context.Context, event cloudevents.Event) error
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 ¶
func (p *CloudStorageSourceArchiveProbe) Forward(ctx context.Context, event cloudevents.Event) error
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 ¶
func (p *CloudStorageSourceCreateProbe) Forward(ctx context.Context, event cloudevents.Event) error
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 ¶
func (p *CloudStorageSourceDeleteProbe) Forward(ctx context.Context, event cloudevents.Event) error
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 ¶
func (p *CloudStorageSourceProbe) Receive(ctx context.Context, event cloudevents.Event) error
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 ¶
func (p *CloudStorageSourceUpdateMetadataProbe) Forward(ctx context.Context, event cloudevents.Event) error
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.