grpcclient

package
v0.0.0-...-1c23eef Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 11, 2024 License: CC0-1.0 Imports: 15 Imported by: 0

Documentation

Index

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL