destregistry

package
v0.1.0-alpha.4 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewErrDestinationPublish

func NewErrDestinationPublish(err error) error

func NewErrDestinationValidation

func NewErrDestinationValidation(errors []ValidationErrorDetail) error

Types

type BaseProvider

type BaseProvider struct {
	// contains filtered or unexported fields
}

BaseProvider provides common functionality for all destination providers

func NewBaseProvider

func NewBaseProvider(loader *metadata.MetadataLoader, providerType string) (*BaseProvider, error)

NewBaseProvider creates a new base provider with loaded metadata

func (*BaseProvider) Metadata

func (p *BaseProvider) Metadata() *metadata.ProviderMetadata

Metadata returns the provider metadata

func (*BaseProvider) Validate

func (p *BaseProvider) Validate(ctx context.Context, destination *models.Destination) error

Validate performs schema validation using the provider's metadata

type Config

type Config struct {
	DestinationMetadataPath string
}

type ErrDestinationPublish

type ErrDestinationPublish struct {
	Err error
}

func (*ErrDestinationPublish) Error

func (e *ErrDestinationPublish) Error() string

type ErrDestinationValidation

type ErrDestinationValidation struct {
	Errors []ValidationErrorDetail `json:"errors"`
}

func (*ErrDestinationValidation) Error

func (e *ErrDestinationValidation) Error() string

type Provider

type Provider interface {
	// Metadata returns the metadata for the provider
	Metadata() *metadata.ProviderMetadata

	// Validate destination configuration and credentials
	Validate(ctx context.Context, destination *models.Destination) error

	// Publish an event to the destination
	Publish(ctx context.Context, destination *models.Destination, event *models.Event) error
}

type Registry

type Registry interface {
	RegisterProvider(destinationType string, provider Provider) error
	GetProvider(destinationType string) (Provider, error)
	RetrieveProviderMetadata(providerType string) (*metadata.ProviderMetadata, error)
	ListProviderMetadata() map[string]*metadata.ProviderMetadata
	MetadataLoader() *metadata.MetadataLoader
}

func NewRegistry

func NewRegistry(cfg *Config) Registry

type ValidationErrorDetail

type ValidationErrorDetail struct {
	Field string `json:"field"`
	Type  string `json:"type"`
}

Directories

Path Synopsis
internal/destregistry/metadata/types.go
internal/destregistry/metadata/types.go

Jump to

Keyboard shortcuts

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