builder

package
v0.0.0-...-58ae5d1 Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2022 License: BSD-3-Clause Imports: 15 Imported by: 0

Documentation

Overview

Package builder provides functionality to build the representative flows. Imagine this package as an implementation of builder design pattern. Read more: https://sourcemaking.com/design_patterns/builder.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildCockroachPgxPool

func BuildCockroachPgxPool(cfg *config.CockroachDB) (*pgxpool.Pool, error)

BuildCockroachPgxPool builds a pool of cockroachdb client using pgx.

func BuildKafkaWriter

func BuildKafkaWriter(cfg *config.Kafka) *kafka.Writer

BuildKafkaWriter builds an instance of kafka writer.

Currently, the writer is having issue on auto-creating topic. Follow more on https://github.com/segmentio/kafka-go/issues/683 and https://github.com/segmentio/kafka-go/pull/700. Once the PR is submitted and the package is updated, this configuration should work.

func BuildPostgrePgxPool

func BuildPostgrePgxPool(cfg *config.Postgres) (*pgxpool.Pool, error)

BuildPostgrePgxPool builds a pool of pgx client.

func BuildRedisClient

func BuildRedisClient(cfg *config.Redis) (*goredis.Client, error)

BuildRedisClient builds an instance of redis client.

func BuildToggleCommandHandler

func BuildToggleCommandHandler(dep *Dependency) *handler.ToggleCommand

BuildToggleCommandHandler builds toggle command handler including all of its dependencies.

func BuildToggleQueryHandler

func BuildToggleQueryHandler(dep *Dependency) *handler.ToggleQuery

BuildToggleQueryHandler builds toggle query handler including all of its dependencies.

Types

type Dependency

type Dependency struct {
	PgxPool     *pgxpool.Pool
	RedisClient goredis.Cmdable
	KafkaWriter *kafka.Writer
	Config      *config.Config
}

Dependency holds any dependency to build full use cases.

Jump to

Keyboard shortcuts

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