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 ¶
- func BuildCockroachPgxPool(cfg *config.CockroachDB) (*pgxpool.Pool, error)
- func BuildKafkaWriter(cfg *config.Kafka) *kafka.Writer
- func BuildPostgrePgxPool(cfg *config.Postgres) (*pgxpool.Pool, error)
- func BuildRedisClient(cfg *config.Redis) (*goredis.Client, error)
- func BuildToggleCommandHandler(dep *Dependency) *handler.ToggleCommand
- func BuildToggleQueryHandler(dep *Dependency) *handler.ToggleQuery
- type Dependency
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 ¶
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 ¶
BuildPostgrePgxPool builds a pool of pgx client.
func BuildRedisClient ¶
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.