Documentation
¶
Index ¶
- Constants
- type Cache
- type ChangeDetectorService
- type CompatibilityFn
- type Metadata
- type NamespaceService
- type NotificationEventRepository
- type ParsedSchema
- type Producer
- type Provider
- type Repository
- type Schema
- type SchemaFile
- type SchemaInfo
- type Service
- func (s *Service) CheckCompatibility(ctx context.Context, nsName, schemaName, compatibility string, data []byte) error
- func (s *Service) Create(ctx context.Context, nsName string, schemaName string, metadata *Metadata, ...) (SchemaInfo, error)
- func (s *Service) Delete(ctx context.Context, namespace string, schemaName string) error
- func (s *Service) DeleteVersion(ctx context.Context, namespace string, schemaName string, version int32) error
- func (s *Service) DetectSchemaChange(namespace string, schemaName string, fromVersion string, toVersion string, ...) (*stencilv1beta1.SchemaChangedEvent, error)
- func (s *Service) Get(ctx context.Context, namespace string, schemaName string, version int32) (*Metadata, []byte, error)
- func (s *Service) GetLatest(ctx context.Context, namespace string, schemaName string) (*Metadata, []byte, error)
- func (s *Service) GetMetadata(ctx context.Context, namespace, schemaName string) (*Metadata, error)
- func (s *Service) List(ctx context.Context, namespaceID string) ([]Schema, error)
- func (s *Service) ListVersions(ctx context.Context, namespaceID string, schemaName string) ([]int32, error)
- func (s *Service) UpdateMetadata(ctx context.Context, namespace, schemaName string, meta *Metadata) (*Metadata, error)
- func (s *Service) ValidateVersions(ctx context.Context, namespace string, schemaName string, fromVersion string, ...) (int32, int32, error)
- type UpdateSchemaRequest
- type ValidationStrategy
Constants ¶
View Source
const EventTypeSchemaChange = "SCHEMA_CHANGE_EVENT"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ChangeDetectorService ¶ added in v0.8.0
type ChangeDetectorService interface {
IdentifySchemaChange(ctx context.Context, request *changedetector.ChangeRequest) (*stencilv1beta1.SchemaChangedEvent, error)
}
type CompatibilityFn ¶
type CompatibilityFn func(ParsedSchema, []ParsedSchema) error
type NamespaceService ¶
type NotificationEventRepository ¶ added in v0.8.0
type NotificationEventRepository interface {
Create(ctx context.Context, event changedetector.NotificationEvent) (changedetector.NotificationEvent, error)
Update(ctx context.Context, Id string, success bool) (changedetector.NotificationEvent, error)
GetByNameSpaceSchemaVersionAndSuccess(ctx context.Context, namespace string, schemaID int32, versionID string, success bool) (changedetector.NotificationEvent, error)
}
type ParsedSchema ¶
type ParsedSchema interface {
IsBackwardCompatible(ParsedSchema) error
IsForwardCompatible(ParsedSchema) error
IsFullCompatible(ParsedSchema) error
Format() string
GetCanonicalValue() *SchemaFile
}
type Provider ¶
type Provider interface {
ParseSchema(format string, data []byte) (ParsedSchema, error)
}
type Repository ¶
type Repository interface {
Create(ctx context.Context, request *UpdateSchemaRequest, versionID string, commitSHA string) (version int32, err error)
List(context.Context, string) ([]Schema, error)
ListVersions(context.Context, string, string) ([]int32, error)
Get(context.Context, string, string, int32) ([]byte, error)
GetLatestVersion(context.Context, string, string) (int32, error)
GetMetadata(context.Context, string, string) (*Metadata, error)
UpdateMetadata(context.Context, string, string, *Metadata) (*Metadata, error)
Delete(context.Context, string, string) error
DeleteVersion(context.Context, string, string, int32) error
GetSchemaID(ctx context.Context, ns string, sc string) (int32, error)
GetVersionCommitSHA(ctx context.Context, schemaID int32, version int32) (string, error)
}
type SchemaInfo ¶
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func NewService ¶
func NewService(repo Repository, provider Provider, nsSvc NamespaceService, cache Cache, nr newrelic.Service, cds ChangeDetectorService, producer Producer, config *config.Config, notificationEventRepo NotificationEventRepository) *Service
func (*Service) CheckCompatibility ¶
func (*Service) DeleteVersion ¶
func (*Service) DetectSchemaChange ¶ added in v0.8.5
func (s *Service) DetectSchemaChange(namespace string, schemaName string, fromVersion string, toVersion string, depth string) (*stencilv1beta1.SchemaChangedEvent, error)
func (*Service) GetMetadata ¶
func (*Service) ListVersions ¶
func (*Service) UpdateMetadata ¶
type UpdateSchemaRequest ¶ added in v0.8.4
type UpdateSchemaRequest struct {
Namespace string
Schema string
Metadata *Metadata
SchemaFile *SchemaFile
}
type ValidationStrategy ¶
type ValidationStrategy func(ParsedSchema, ParsedSchema) error
Click to show internal directories.
Click to hide internal directories.