adapters

package
v0.6.27 Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2024 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateLocalCache added in v0.5.92

func CreateLocalCache(config *ristretto.Config) (*ristretto.Cache, error)

func CreateMongoClient

func CreateMongoClient(ctx context.Context, mongoConfig MongoConfig) *mongo.Client

func CreatePostgresClient

func CreatePostgresClient(ctx context.Context, postgresConfig PostgresConfig) *gorm.DB

func CreateRedisClient added in v0.3.10

func CreateRedisClient(ctx context.Context, redisConfig RedisConfig) *redis.Client

func CreateSentry added in v0.3.0

func CreateSentry(sentryConfig SentryConfig) error

func NewKafkaConn added in v0.3.2

func NewKafkaConn(cfg *config.Config) (*kafka.Conn, error)

func NewReaderWithTLS added in v0.5.17

func NewReaderWithTLS(cfg *KafkaConnectionConfig) *kafka.Reader

func NewWriterWithMechanism added in v0.5.16

func NewWriterWithMechanism(cfg *KafkaWriterWithMechanismConfig) *kafka.Writer

Types

type Adapter

type Adapter interface {
	CreateClient(ctx context.Context, options *models.DBOptions) interface{}
}

type KafkaConnectionConfig added in v0.5.16

type KafkaConnectionConfig struct {
	Brokers []string
}

type KafkaMechanismConfig added in v0.5.16

type KafkaMechanismConfig struct {
	Username string
	Password string
}

type KafkaWriterWithMechanismConfig added in v0.5.16

type KafkaWriterWithMechanismConfig struct {
	MechanismConfig KafkaMechanismConfig
	Addr            []string
	Topic           string
	Balancer        kafka.Balancer
	Async           bool
	MaxAttempts     int
}

type MongoConfig added in v0.5.10

type MongoConfig struct {
	URI         string
	MaxPoolSize uint64
	MinPoolSize uint64
	RetryWrites bool
}

type PostgresConfig added in v0.5.10

type PostgresConfig struct {
	URL      string
	Host     string
	Port     int
	DB       string
	User     string
	Password string
}

type RedisConfig added in v0.5.10

type RedisConfig struct {
	Addr string
	DB   int
	URL  string
}

type SentryConfig added in v0.5.10

type SentryConfig struct {
	DSN                 string
	Env                 string
	TracesSampleRate    float64
	TracesSampler       sentry.TracesSampler
	EnableTracing       bool
	EnableProfiling     bool
	ProfilingSampleRate float64
}

Jump to

Keyboard shortcuts

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