connectors

package
v0.0.0-...-9f3355a Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2025 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ElasticsearchConnector

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

func (*ElasticsearchConnector) GetClient

func (*ElasticsearchConnector) Healthcheck

func (e *ElasticsearchConnector) Healthcheck() error

func (*ElasticsearchConnector) Shutdown

func (e *ElasticsearchConnector) Shutdown()

The Elasticsearch Go client is stateless by nature, hence why, we don't need to do anything. Still, if you want, you can use your own HTTP transport while constructing the Elasticseach client, and then close the HTTP transport's idle connections in Shutdown( ). REFERENCE : https://discuss.elastic.co/t/how-to-close-the-connection-using-go-client/350123.

type KafkaConnector

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

func NewKafkaConnector

func NewKafkaConnector(ctx context.Context, args *NewKafkaConnectorArgs) *KafkaConnector

func (*KafkaConnector) GetClient

func (k *KafkaConnector) GetClient() *kgo.Client

func (*KafkaConnector) Healthcheck

func (k *KafkaConnector) Healthcheck() error

func (*KafkaConnector) Shutdown

func (k *KafkaConnector) Shutdown()

type NewElasticsearchConnectorArgs

type NewElasticsearchConnectorArgs struct {
	NodeAddresses []string `yaml:"nodeAddresses" validate:"required,gt=0,dive,notblank"`

	Username string `yaml:"username" validate:"required,notblank"`
	Password string `yaml:"password" validate:"required,notblank"`

	DebugLoggingEnabled,
	DevModeEnabled bool
}

type NewKafkaConnectorArgs

type NewKafkaConnectorArgs struct {
	SeedBrokerURLs []string `yaml:"seedBrokerURLs" validate:"required,gt=0,dive,notblank"`
	Group          string   `yaml:"group" validate:"required,notblank"`
	Topics         []string `yaml:"topics" validate:"required,gt=0,dive,notblank"`
}

type NewPostgresConnectorArgs

type NewPostgresConnectorArgs struct {
	URL string `yaml:"url" validate:"required,notblank"`
}

type NewRedisConnectorArgs

type NewRedisConnectorArgs struct {
	NodeAddresses []string `yaml:"nodeAddresses" validate:"required,gt=0,dive,notblank"`

	Username string `yaml:"username" validate:"required,notblank"`
	Password string `yaml:"password" validate:"required,notblank"`
}

type PostgresConnector

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

func (*PostgresConnector) GetConnection

func (p *PostgresConnector) GetConnection() *sql.DB

func (*PostgresConnector) Healthcheck

func (p *PostgresConnector) Healthcheck() error

func (*PostgresConnector) Shutdown

func (p *PostgresConnector) Shutdown()

type RedisConnector

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

func NewRedisConnector

func NewRedisConnector(ctx context.Context, args *NewRedisConnectorArgs) *RedisConnector

func (*RedisConnector) Del

func (r *RedisConnector) Del(ctx context.Context, keys ...string) error

func (*RedisConnector) Get

func (r *RedisConnector) Get(ctx context.Context, key string) (string, error)

func (*RedisConnector) Healthcheck

func (r *RedisConnector) Healthcheck() error

func (*RedisConnector) LLen

func (r *RedisConnector) LLen(ctx context.Context, key string) (int64, error)

func (*RedisConnector) LRange

func (r *RedisConnector) LRange(ctx context.Context, key string, start, stop int64) ([]string, error)

func (*RedisConnector) Set

func (r *RedisConnector) Set(ctx context.Context,
	key string,
	value any,
	expiration time.Duration,
) error

func (*RedisConnector) Shutdown

func (r *RedisConnector) Shutdown()

Jump to

Keyboard shortcuts

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