Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Advice ¶
type Advice struct { Reconnect string `json:"reconnect,omitempty"` Timeout int `json:"timeout,omitempty"` Interval int `json:"interval,omitempty"` }
Advice reusable structure for Bayeux protocol
type Bayeux ¶
Bayeux client runner
func NewBayeux ¶
func NewBayeux(apiVersion string, url string, subscriptions []Subscription, dispatcher EventDispatcher, client *http.Client, logger *zap.SugaredLogger) Bayeux
NewBayeux creates a Bayeux client for Salesforce Streaming API consumption.
type ChangeDataCapturePayload ¶
type ChangeDataCapturePayload struct { ChangeEventHeader struct { EntityName string ChangeType string } `json:"ChangeEventHeader"` }
ChangeDataCapturePayload is a partial structure of the CDC message that the adapter needs to figure out the subject for the CloudEvent.
type CommonResponse ¶
type CommonResponse struct { Channel string `json:"channel"` ClientID string `json:"clientId"` Successful bool `json:"successful"` Error string `json:"error,omitempty"` }
CommonResponse for all structures at Bayeux protocol.
type ConnectResponse ¶
type ConnectResponse struct { CommonResponse `json:",inline"` Data struct { Event struct { CreatedDate time.Time `json:"createdDate,omitempty"` ReplayID int64 `json:"replayId,omitempty"` Type string `json:"type,omitempty"` } `json:"event,omitempty"` Schema string `json:"schema,omitempty"` SObject json.RawMessage `json:"sobject,omitempty"` Payload json.RawMessage `json:"payload,omitempty"` } `json:"data,omitempty"` Advice Advice `json:"advice,omitempty"` }
ConnectResponse for Bayeux protocol
type ConnectResponseCallback ¶
type ConnectResponseCallback func(msg *ConnectResponse)
ConnectResponseCallback is the signature for callback functions that handle connect responses that contain data.
type EventDispatcher ¶
type EventDispatcher interface { DispatchEvent(context.Context, *ConnectResponse) DispatchError(error) }
EventDispatcher is an object that can dispatch messages and "non managed" errors received through the stream.
type HandshakeResponse ¶
type HandshakeResponse struct { CommonResponse `json:",inline"` Version string MinimumVersion string SupportedConnectionTypes []string Advice Advice `json:"advice,omitempty"` Extension json.RawMessage `json:"ext,omitempty"` }
HandshakeResponse for Bayeux protocol.
type PushTopicSObject ¶
type PushTopicSObject struct {
Name string `json:"entityName"`
}
PushTopicSObject is a partial structure of the PushTopic message that the adapter needs to figure out the subject for the CloudEvent.
type Subscription ¶
Subscription contains data about the channel and replayID for the subscription. For replayID can be:
-2 for all past (stored) and new events. -1 for new events only. replayID for receiving events after that replayID event.
type SubscriptionResponse ¶
type SubscriptionResponse struct { CommonResponse `json:",inline"` Subscription string `json:"subscription,omitempty"` Advice Advice `json:"advice,omitempty"` }
SubscriptionResponse for Bayeux protocol