Versions in this module Expand all Collapse all v2 v2.0.1 Nov 20, 2024 Changes in this version + const DisableValidation + const EnableValidation + const KeySerde + const MagicByte + const TypeArray + const TypeBoolean + const TypeBytes + const TypeCombined + const TypeDouble + const TypeEnum + const TypeFixed + const TypeFloat + const TypeInt + const TypeLong + const TypeMap + const TypeNull + const TypeRecord + const TypeString + const ValueSerde + func Expect(actual, expected interface{}) error + func RegisterRuleAction(ruleAction RuleAction) + func RegisterRuleExecutor(ruleExecutor RuleExecutor) + func ResolveReferences(c schemaregistry.Client, schema schemaregistry.SchemaInfo, ...) error + type AbstractFieldRuleExecutor struct + func (a *AbstractFieldRuleExecutor) Transform(ctx RuleContext, msg interface{}) (interface{}, error) + type BaseDeserializer struct + Conf *DeserializerConfig + func (s *BaseDeserializer) ConfigureDeserializer(client schemaregistry.Client, subjectNameStrategy SubjectNameStrategy, ...) error + func (s *BaseDeserializer) GetReaderSchema(subject string) (*schemaregistry.SchemaMetadata, error) + func (s *BaseDeserializer) GetSchema(topic string, payload []byte, schemaType string) (schemaregistry.SchemaInfo, error) + type BaseSerializer struct + Conf *SerializerConfig + func (s *BaseSerializer) ConfigureSerializer(client schemaregistry.Client, subjectNameStrategy SubjectNameStrategy, ...) error + func (s *BaseSerializer) GetID(topic string, msg interface{}, info *schemaregistry.SchemaInfo) (int, error) + func (s *BaseSerializer) WriteBytes(id int, msgBytes []byte) ([]byte, error) + type Deserializer interface + Close func() error + ConfigureDeserializer func(client schemaregistry.Client, subjectNameStrategy SubjectNameStrategy, ...) error + Deserialize func(topic string, payload []byte) (interface{}, error) + DeserializeInto func(topic string, payload []byte, msg interface{}) error + type DeserializerConfig struct + RuleConfig map[string]string + UseLatestVersion bool + UseLatestWithMetadata map[string]string + func NewDeserializerConfig() *DeserializerConfig + type ErrorAction struct + func (a ErrorAction) Close() error + func (a ErrorAction) Configure(clientConfig *schemaregistry.Config, config map[string]string) error + func (a ErrorAction) Run(ctx RuleContext, msg interface{}, err error) error + func (a ErrorAction) Type() string + type FailFunc func(string, ...error) + var MaybeFail FailFunc + func InitFailFunc(t *testing.T) FailFunc + func InitFailFuncBenchmark(b *testing.B) FailFunc + type FieldContext struct + ContainingMessage interface{} + FullName string + Name string + Tags map[string]bool + Type FieldType + func (f *FieldContext) IsPrimitive() bool + func (f *FieldContext) TypeName() string + type FieldRuleExecutor interface + NewTransform func(ctx RuleContext) (FieldTransform, error) + type FieldTransform interface + Transform func(ctx RuleContext, fieldCtx FieldContext, fieldValue interface{}) (interface{}, error) + type FieldTransformer func(ctx RuleContext, fieldTransform FieldTransform, msg interface{}) (interface{}, error) + type FieldType = int + type MessageFactory func(subject string, name string) (interface{}, error) + type Migration struct + RuleMode schemaregistry.RuleMode + Source *schemaregistry.SchemaMetadata + Target *schemaregistry.SchemaMetadata + type NoneAction struct + func (a NoneAction) Close() error + func (a NoneAction) Configure(clientConfig *schemaregistry.Config, config map[string]string) error + func (a NoneAction) Run(ctx RuleContext, msg interface{}, err error) error + func (a NoneAction) Type() string + type RuleAction interface + Run func(ctx RuleContext, msg interface{}, err error) error + type RuleBase interface + Close func() error + Configure func(clientConfig *schemaregistry.Config, config map[string]string) error + Type func() string + type RuleConditionErr struct + Err error + Rule *schemaregistry.Rule + func (re RuleConditionErr) Error() string + type RuleContext struct + FieldTransformer FieldTransformer + Index int + IsKey bool + Rule *schemaregistry.Rule + RuleMode schemaregistry.RuleMode + Rules []schemaregistry.Rule + Source *schemaregistry.SchemaInfo + Subject string + Target *schemaregistry.SchemaInfo + Topic string + func (r *RuleContext) CurrentField() *FieldContext + func (r *RuleContext) EnterField(containingMessage interface{}, fullName string, name string, ...) (FieldContext, bool) + func (r *RuleContext) GetParameter(name string) *string + func (r *RuleContext) GetTags(fullName string) map[string]bool + func (r *RuleContext) LeaveField() + type RuleExecutor interface + Transform func(ctx RuleContext, msg interface{}) (interface{}, error) + type RuleRegistry struct + func GlobalRuleRegistry() *RuleRegistry + func (r *RuleRegistry) Clear() + func (r *RuleRegistry) GetAction(name string) RuleAction + func (r *RuleRegistry) GetActions() []RuleAction + func (r *RuleRegistry) GetExecutor(name string) RuleExecutor + func (r *RuleRegistry) GetExecutors() []RuleExecutor + func (r *RuleRegistry) RegisterAction(ruleAction RuleAction) + func (r *RuleRegistry) RegisterExecutor(ruleExecutor RuleExecutor) + type Serde struct + Client schemaregistry.Client + FieldTransformer FieldTransformer + MessageFactory MessageFactory + RuleRegistry *RuleRegistry + SubjectNameStrategy SubjectNameStrategy + func (s *Serde) Close() error + func (s *Serde) ExecuteMigrations(migrations []Migration, subject string, topic string, msg interface{}) (interface{}, error) + func (s *Serde) ExecuteRules(subject string, topic string, ruleMode schemaregistry.RuleMode, ...) (interface{}, error) + func (s *Serde) GetMigrations(subject string, topic string, sourceInfo *schemaregistry.SchemaInfo, ...) ([]Migration, error) + func (s *Serde) SetRuleRegistry(registry *RuleRegistry, ruleConfig map[string]string) error + type Serializer interface + Close func() error + ConfigureSerializer func(client schemaregistry.Client, subjectNameStrategy SubjectNameStrategy, ...) error + Serialize func(topic string, msg interface{}) ([]byte, error) + type SerializerConfig struct + AutoRegisterSchemas bool + NormalizeSchemas bool + RuleConfig map[string]string + UseLatestVersion bool + UseLatestWithMetadata map[string]string + UseSchemaID int + func NewSerializerConfig() *SerializerConfig + type SubjectNameStrategy interface + GetSubject func(topic string, info schemaregistry.SchemaInfo) (string, error) + IsKey func() bool + type TopicNameStrategyFunc struct + SerdeType Type + func (t TopicNameStrategyFunc) GetSubject(topic string, _ schemaregistry.SchemaInfo) (string, error) + func (t TopicNameStrategyFunc) IsKey() bool + type TopicRecordNameStrategyFunc struct + func (t TopicRecordNameStrategyFunc) GetSubject(topic string, info schemaregistry.SchemaInfo) (string, error) + func (t TopicRecordNameStrategyFunc) IsKey() bool + type Type = int