Documentation
¶
Index ¶
- Constants
- Variables
- func ErrCouldNotConvertType(from any, to any) error
- func ProcessBitMap(avroSchema map[string]any, bitmapFields []string) ([]string, error)
- func Publish(f *Force, channel string, message map[string]any) error
- func PublishMessages(f *Force, channel string, messages <-chan map[string]any) error
- func Subscribe(f *Force, channel string, replayId string, replayPreset proto.ReplayPreset, ...) error
- type PubSubClient
- func (c *PubSubClient) Close()
- func (c *PubSubClient) GetSchema(schemaId string) (*proto.SchemaInfo, error)
- func (c *PubSubClient) GetTopic(channel string) (*proto.TopicInfo, error)
- func (c *PubSubClient) Publish(channel string, message map[string]any) error
- func (c *PubSubClient) Subscribe(channel string, replayPreset proto.ReplayPreset, replayId []byte, ...) ([]byte, error)
Constants ¶
Variables ¶
var ErrUnexpectedType = fmt.Errorf("unexpected type")
var InvalidReplayIdError = errors.New("Invalid Replay Id")
Functions ¶
func ErrCouldNotConvertType ¶
func ProcessBitMap ¶
ProcessBitMap takes the bitmap-encoded list of changed fields and returns a list of field names. See Salesforce pub-sub docs for more details: https://developer.salesforce.com/docs/platform/pub-sub-api/guide/event-deserialization-considerations.html
func PublishMessages ¶ added in v1.0.7
Types ¶
type PubSubClient ¶
type PubSubClient struct {
// contains filtered or unexported fields
}
func NewGRPCClient ¶
func NewGRPCClient(f *Force) (*PubSubClient, error)
Creates a new connection to the gRPC server and returns the wrapper struct
func (*PubSubClient) Close ¶
func (c *PubSubClient) Close()
Closes the underlying connection to the gRPC server
func (*PubSubClient) GetSchema ¶
func (c *PubSubClient) GetSchema(schemaId string) (*proto.SchemaInfo, error)
Wrapper function around the GetSchema RPC. This will add the OAuth credentials and make a call to fetch data about a specific schema
func (*PubSubClient) GetTopic ¶
func (c *PubSubClient) GetTopic(channel string) (*proto.TopicInfo, error)
Wrapper function around the GetTopic RPC. This will add the OAuth credentials and make a call to fetch data about a specific topic
func (*PubSubClient) Publish ¶ added in v1.0.5
func (c *PubSubClient) Publish(channel string, message map[string]any) error
Wrapper function around the Publish RPC. This will add the OAuth credentials and produce a single hardcoded event to the specified topic.
func (*PubSubClient) Subscribe ¶
func (c *PubSubClient) Subscribe(channel string, replayPreset proto.ReplayPreset, replayId []byte, changesOnly bool) ([]byte, error)
Wrapper function around the Subscribe RPC. This will add the OAuth credentials and create a separate streaming client that will be used to fetch data from the topic. This method will continuously consume messages unless an error occurs; if an error does occur then this method will return the last successfully consumed ReplayId as well as the error message. If no messages were successfully consumed then this method will return the same ReplayId that it originally received as a parameter