Documentation
¶
Index ¶
- Variables
- func MakePublisherKey(dest *models.Destination) string
- func NewErrDestinationPublishAttempt(err error, provider string, data map[string]interface{}) error
- func NewErrDestinationValidation(errors []ValidationErrorDetail) error
- func ObfuscateValue(value string) string
- type BaseProvider
- func (p *BaseProvider) Metadata() *metadata.ProviderMetadata
- func (p *BaseProvider) ObfuscateDestination(destination *models.Destination) *models.Destination
- func (p *BaseProvider) Preprocess(newDestination *models.Destination, originalDestination *models.Destination, ...) error
- func (p *BaseProvider) Validate(ctx context.Context, destination *models.Destination) error
- type BasePublisher
- type Config
- type Delivery
- type DestinationDisplay
- type ErrDestinationPublishAttempt
- type ErrDestinationValidation
- type PreprocessDestinationOpts
- type Provider
- type Publisher
- type Registry
- type ValidationErrorDetail
Constants ¶
This section is empty.
Variables ¶
var ErrPublisherClosed = errors.New("publisher is closed")
Functions ¶
func MakePublisherKey ¶
func MakePublisherKey(dest *models.Destination) string
MakePublisherKey creates a unique key for a destination that includes type and config
func NewErrDestinationValidation ¶
func NewErrDestinationValidation(errors []ValidationErrorDetail) error
func ObfuscateValue ¶
ObfuscateValue masks a sensitive value with the following rules: - For strings with length >= 10: show first 4 characters + asterisks for the rest - For strings with length < 10: replace each character with an asterisk
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) ObfuscateDestination ¶
func (p *BaseProvider) ObfuscateDestination(destination *models.Destination) *models.Destination
ObfuscateDestination returns a copy of the destination with sensitive fields masked
func (*BaseProvider) Preprocess ¶
func (p *BaseProvider) Preprocess(newDestination *models.Destination, originalDestination *models.Destination, opts *PreprocessDestinationOpts) error
Preprocess is a noop by default
func (*BaseProvider) Validate ¶
func (p *BaseProvider) Validate(ctx context.Context, destination *models.Destination) error
Validate performs field-level validation using the provider's metadata
type BasePublisher ¶
type BasePublisher struct {
// contains filtered or unexported fields
}
BasePublisher provides common publisher functionality
func (*BasePublisher) FinishPublish ¶
func (p *BasePublisher) FinishPublish()
FinishPublish marks a publish operation as complete
func (*BasePublisher) StartClose ¶
func (p *BasePublisher) StartClose()
StartClose marks publisher as closed and waits for active operations
func (*BasePublisher) StartPublish ¶
func (p *BasePublisher) StartPublish() error
StartPublish returns error if publisher is closed, otherwise adds to waitgroup
type DestinationDisplay ¶
type DestinationDisplay struct { *models.Destination Target string `json:"target"` }
DestinationDisplay represents a destination with display-specific fields
type ErrDestinationPublishAttempt ¶
func (*ErrDestinationPublishAttempt) Error ¶
func (e *ErrDestinationPublishAttempt) Error() string
type ErrDestinationValidation ¶
type ErrDestinationValidation struct {
Errors []ValidationErrorDetail `json:"errors"`
}
func (*ErrDestinationValidation) Error ¶
func (e *ErrDestinationValidation) Error() string
type PreprocessDestinationOpts ¶
type PreprocessDestinationOpts struct {
Role string
}
PreprocessDestinationOpts contains options for preprocessing a destination
type Provider ¶
type Provider interface { // Validate destination configuration using metadata Validate(ctx context.Context, destination *models.Destination) error // Create a new publisher instance CreatePublisher(ctx context.Context, destination *models.Destination) (Publisher, error) // Get provider metadata Metadata() *metadata.ProviderMetadata // ObfuscateDestination returns a copy of the destination with sensitive fields masked ObfuscateDestination(destination *models.Destination) *models.Destination // ComputeTarget returns a human-readable target string for the destination ComputeTarget(destination *models.Destination) string // Preprocess modifies the destination before it is stored in the DB Preprocess(newDestination *models.Destination, originalDestination *models.Destination, opts *PreprocessDestinationOpts) error }
Provider interface handles validation and publisher creation
type Registry ¶
type Registry interface { // Operations ValidateDestination(ctx context.Context, destination *models.Destination) error PublishEvent(ctx context.Context, destination *models.Destination, event *models.Event) (*models.Delivery, error) DisplayDestination(destination *models.Destination) (*DestinationDisplay, error) PreprocessDestination(newDestination *models.Destination, originalDestination *models.Destination, opts *PreprocessDestinationOpts) error // Provider management RegisterProvider(destinationType string, provider Provider) error ResolveProvider(destination *models.Destination) (Provider, error) ResolvePublisher(ctx context.Context, destination *models.Destination) (Publisher, error) // Metadata access MetadataLoader() metadata.MetadataLoader RetrieveProviderMetadata(providerType string) (*metadata.ProviderMetadata, error) ListProviderMetadata() []*metadata.ProviderMetadata }
Registry manages providers, their metadata, and publishers
type ValidationErrorDetail ¶
Source Files
¶
Directories
¶
Path | Synopsis |
---|---|
internal/destregistry/metadata/types.go
|
internal/destregistry/metadata/types.go |