Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DecodeAvroFromBytes ¶ added in v0.1.0
DecodeAvroFromBytes convert bytes to interface{} datum
func EncodeAvroToBytes ¶ added in v0.1.0
EncodeAvroToBytes convert interface{} datum to bytes
Types ¶
type AvroConsumer ¶ added in v0.1.1
AvroConsumer is a basic consumer to interact with schema registry, avro and pulsar
func NewAvroConsumer ¶
func NewAvroConsumer(client pulsar.Client, consumerOptions pulsar.ConsumerOptions, schemaRegistryUrls []string) (*AvroConsumer, error)
func (*AvroConsumer) Close ¶ added in v0.1.1
func (ac *AvroConsumer) Close()
func (*AvroConsumer) DecodeAvroMessage ¶ added in v0.1.1
func (ac *AvroConsumer) DecodeAvroMessage(msg pulsar.Message) (interface{}, error)
func (*AvroConsumer) GetSchemaByTopic ¶ added in v0.1.1
func (ac *AvroConsumer) GetSchemaByTopic(topic string) (*goavro.Codec, error)
type AvroProducer ¶
type AvroProducer struct {
// contains filtered or unexported fields
}
func NewAvroProducer ¶
func NewAvroProducer(client pulsar.Client, producerOptions pulsar.ProducerOptions, schemaRegistryUrls []string, schema string) (*AvroProducer, error)
NewAvroProducer is a basic producer to interact with schema registry, avro and pulsar
func (*AvroProducer) Close ¶
func (ap *AvroProducer) Close()
func (*AvroProducer) EncodeAvroMessage ¶ added in v0.1.0
func (ap *AvroProducer) EncodeAvroMessage(value interface{}) ([]byte, error)
func (*AvroProducer) Send ¶
func (ap *AvroProducer) Send(message *pulsar.ProducerMessage) (pulsar.MessageID, error)
type CachedSchemaRegistryClient ¶
type CachedSchemaRegistryClient struct { SchemaRegistryClient *SchemaRegistryClient // contains filtered or unexported fields }
CachedSchemaRegistryClient is a schema registry client that will cache some data to improve performance
func NewCachedSchemaRegistryClient ¶
func NewCachedSchemaRegistryClient(connect []string) *CachedSchemaRegistryClient
func NewCachedSchemaRegistryClientWithRetries ¶
func NewCachedSchemaRegistryClientWithRetries(connect []string, retries int) *CachedSchemaRegistryClient
func (*CachedSchemaRegistryClient) CreateSchemaByTopic ¶
func (client *CachedSchemaRegistryClient) CreateSchemaByTopic(topic string, schema string) error
CreateSchemaByTopic will create a schema for the specified topic
func (*CachedSchemaRegistryClient) GetSchemaCodecByTopic ¶
func (client *CachedSchemaRegistryClient) GetSchemaCodecByTopic(topic string) (*goavro.Codec, error)
GetSchemaCodecByTopic will return and cache the codec with the given topic information
type SchemaRegistryClient ¶
type SchemaRegistryClient struct { SchemaRegistryConnect []string // contains filtered or unexported fields }
SchemaRegistryClient is a basic http client to interact with schema registry
func NewSchemaRegistryClient ¶
func NewSchemaRegistryClient(connect []string) *SchemaRegistryClient
NewSchemaRegistryClient creates a client to talk with the schema registry at the connect string By default it will retry failed requests (5XX responses and http errors) len(connect) number of times
func NewSchemaRegistryClientWithRetries ¶
func NewSchemaRegistryClientWithRetries(connect []string, retries int) *SchemaRegistryClient
NewSchemaRegistryClientWithRetries creates an http client with a configurable amount of retries on 5XX responses
func (*SchemaRegistryClient) CreateSchemaByTopic ¶
func (client *SchemaRegistryClient) CreateSchemaByTopic(topic string, schema string) error
CreateSchemaByTopic creates a schema for the specified topic
func (*SchemaRegistryClient) GetSchemaCodecByTopic ¶
func (client *SchemaRegistryClient) GetSchemaCodecByTopic(topic string) (*goavro.Codec, error)
GetSchemaCodecByTopic returns a goavro.Codec by topic