Documentation ¶
Index ¶
Constants ¶
const ( // This is the CloudEvent extension which holds the timeout duration of the forward client. ProbeEventTimeoutExtension = "timeout" // This is the pair of CloudEvent extensions which hold the path of probe requests. // The path of receiver probe requests is injected into the receiverpath extension // by the receiver client. The corresponding forward probe requests should include // the targetpath extension with the same path. For example: // // If a source is configured to sink events to: // http://probe-helper-receiver.cloud-run-events-probe.svc.cluster.local/some-path-goes-here // // then, each event generated by the source and passed to the probe helper // receiver client will include the header 'Ce-Receiverpath: /some-path-goes-here'. // And in order for the probe to succeed, the corresponding forward probe should // be made to include the header 'Ce-Targetpath: /some-path-goes-here'. ProbeEventTargetPathExtension = "targetpath" ProbeEventReceiverPathExtension = "receiverpath" )
Variables ¶
var ( ProbeEventTargetPathHeader = "Ce-" + strings.Title(ProbeEventTargetPathExtension) ProbeEventReceiverPathHeader = "Ce-" + strings.Title(ProbeEventReceiverPathExtension) )
Functions ¶
This section is empty.
Types ¶
type ActionFunc ¶
ActionFunc represents a function which is called during a liveness probe. If it returns a non-nil error, the probe is considered unsuccessful.
type LivenessChecker ¶
type LivenessChecker struct {
ActionFuncs []ActionFunc
}
LivenessChecker executes each of the ActionFuncs upon each liveness probe.
func (*LivenessChecker) AddActionFunc ¶
func (c *LivenessChecker) AddActionFunc(f ActionFunc)
AddActionFunc appends an ActionFunc to the list of functions to be called by the liveness checker during each liveness probe.
func (*LivenessChecker) LivenessHandlerFunc ¶
func (c *LivenessChecker) LivenessHandlerFunc(ctx context.Context) nethttp.HandlerFunc
LivenessHandlerFunc returns the HTTP handler for probe helper liveness checks.
type SyncReceivedEvents ¶
SyncReceivedEvents is a synchronized wrapped around a map of channels.
func NewSyncReceivedEvents ¶
func NewSyncReceivedEvents() *SyncReceivedEvents
func (*SyncReceivedEvents) CreateReceiverChannel ¶
func (r *SyncReceivedEvents) CreateReceiverChannel(channelID string) (func(), error)
CreateReceiverChannel creates a receiver channel at a given index in a map of receiver channels.
func (*SyncReceivedEvents) SignalReceiverChannel ¶
func (r *SyncReceivedEvents) SignalReceiverChannel(channelID string) error
SignalReceiverChannel sends a closing signal to a receiver channel at a given index in a map of receiver channels.
func (*SyncReceivedEvents) WaitOnReceiverChannel ¶
func (r *SyncReceivedEvents) WaitOnReceiverChannel(ctx context.Context, channelID string) error
WaitOnReceiverChannel waits on a receiver channel at a given index until it receives something or until the context expires.