Documentation ¶
Index ¶
- Variables
- func NewAPI() avro.API
- func NewCompatibilityAPI() *avro.SchemaCompatibility
- func NewFSRegistry(f fs.FS, dir string) *avro_registry.Registry
- func NewGlueRegistry(registryName string, client avro_glue.ClientAPI) *avro_registry.Registry
- func UnpackEventSchemas(schema *avro.RecordSchema) ([]*avro.RecordSchema, error)
- type EventSerializer
- func (s *EventSerializer) MarshalEvent(ctx context.Context, evt event.Envelope) (b []byte, err error)
- func (s *EventSerializer) MarshalEventBatch(ctx context.Context, events []event.Envelope) (b []byte, err error)
- func (s *EventSerializer) UnmarshalEvent(ctx context.Context, b []byte) (event.Envelope, error)
- func (s *EventSerializer) UnmarshalEventBatch(ctx context.Context, b []byte) ([]event.Envelope, error)
- type EventSerializerConfig
- type SchemaMap
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrReadOnlyModeEnabled = errors.New("read only mode enabled")
)
Functions ¶
func NewCompatibilityAPI ¶ added in v0.0.3
func NewCompatibilityAPI() *avro.SchemaCompatibility
func NewFSRegistry ¶ added in v0.0.3
func NewFSRegistry(f fs.FS, dir string) *avro_registry.Registry
func NewGlueRegistry ¶ added in v0.0.3
func NewGlueRegistry(registryName string, client avro_glue.ClientAPI) *avro_registry.Registry
func UnpackEventSchemas ¶ added in v0.0.3
func UnpackEventSchemas(schema *avro.RecordSchema) ([]*avro.RecordSchema, error)
UnpackEventSchemas expects to receive the schema of the event envelope and returns the wrapped event types' schemas.
It fails if the given schema type and sub-types are not as expected
Types ¶
type EventSerializer ¶
type EventSerializer struct {
// contains filtered or unexported fields
}
func NewEventSerializer ¶
func NewEventSerializer(ctx context.Context, r *registry.Registry, opts ...func(*EventSerializerConfig)) *EventSerializer
func (*EventSerializer) MarshalEvent ¶
func (s *EventSerializer) MarshalEvent(ctx context.Context, evt event.Envelope) (b []byte, err error)
MarshalEvent implements event.Serializer.
func (*EventSerializer) MarshalEventBatch ¶
func (s *EventSerializer) MarshalEventBatch(ctx context.Context, events []event.Envelope) (b []byte, err error)
MarshalEventBatch implements event.Serializer. Note event size per item n []int is not supported at the moment
func (*EventSerializer) UnmarshalEvent ¶
UnmarshalEvent implements event.Serializer.
func (*EventSerializer) UnmarshalEventBatch ¶
func (s *EventSerializer) UnmarshalEventBatch(ctx context.Context, b []byte) ([]event.Envelope, error)
UnmarshalEventBatch implements event.Serializer.
type EventSerializerConfig ¶
type SchemaMap ¶ added in v0.0.3
type SchemaMap map[string]avro.Schema
func EventSchemas ¶ added in v0.0.3
EventSchemas generate schema for each given namespace or all the registered namespace in the event registry. It returns a map of schemas where the key is the namespace.
Click to show internal directories.
Click to hide internal directories.