namingstrategy

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterNamingStrategy

func RegisterNamingStrategy(name config.NamingStrategyType, provider Provider) bool

RegisterNamingStrategy registers a NamingRegistryType to a Provider implementation which creates the NamingStrategy when requested

func SanitizeTopicName

func SanitizeTopicName(topicName string) (topic string, changed bool)

SanitizeTopicName is a helper to sanitize topic names to be as compatible as possible

Types

type NamingStrategy

type NamingStrategy interface {
	// EventTopicName generates a event topic name for the given hypertable
	EventTopicName(topicPrefix string, hypertable schema.TableAlike) string
	// SchemaTopicName generates a schema topic name for the given hypertable
	SchemaTopicName(topicPrefix string, hypertable schema.TableAlike) string
	// MessageTopicName generates a message topic name for a replication message
	MessageTopicName(topicPrefix string) string
}

NamingStrategy represents a strategy to generate topic names for event topics, schema topics, as well as message topics

func NewNamingStrategy

func NewNamingStrategy(name config.NamingStrategyType, config *config.Config) (NamingStrategy, error)

NewNamingStrategy instantiates a new instance of the requested NamingStrategy when available, otherwise returns an error.

type Provider

type Provider = func(config *config.Config) (NamingStrategy, error)

Jump to

Keyboard shortcuts

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