Documentation ¶
Index ¶
- type PubSubClient
- func (c *PubSubClient) Authenticate() error
- func (c *PubSubClient) Close()
- func (c *PubSubClient) FetchUserInfo() error
- func (c *PubSubClient) GetSchema(schemaId string) (*proto.SchemaInfo, error)
- func (c *PubSubClient) GetTopic() (*proto.TopicInfo, error)
- func (c *PubSubClient) Publish(schema *proto.SchemaInfo) error
- func (c *PubSubClient) PublishStream(schema *proto.SchemaInfo) error
- func (c *PubSubClient) Subscribe(replayPreset proto.ReplayPreset, replayId []byte) ([]byte, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PubSubClient ¶
type PubSubClient struct {
// contains filtered or unexported fields
}
func NewGRPCClient ¶
func NewGRPCClient() (*PubSubClient, error)
Creates a new connection to the gRPC server and returns the wrapper struct
func (*PubSubClient) Authenticate ¶
func (c *PubSubClient) Authenticate() error
Makes a call to the OAuth server to fetch credentials. Credentials are stored as part of the PubSubClient object so that they can be referenced later in other methods
func (*PubSubClient) Close ¶
func (c *PubSubClient) Close()
Closes the underlying connection to the gRPC server
func (*PubSubClient) FetchUserInfo ¶
func (c *PubSubClient) FetchUserInfo() error
Makes a call to the OAuth server to fetch user info. User info is stored as part of the PubSubClient object so that it can be referenced later in other methods
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() (*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 ¶
func (c *PubSubClient) Publish(schema *proto.SchemaInfo) 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) PublishStream ¶
func (c *PubSubClient) PublishStream(schema *proto.SchemaInfo) error
Wrapper function around the PublishStream RPC. This will add the OAuth credentials and produce an event to the topic every five seconds
func (*PubSubClient) Subscribe ¶
func (c *PubSubClient) Subscribe(replayPreset proto.ReplayPreset, replayId []byte) ([]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