adapters

package
v0.5.76 Latest Latest
Warning

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

Go to latest
Published: May 16, 2023 License: MIT Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

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 NewTraceProvider added in v0.5.35

func NewTraceProvider(ctx context.Context, cfg Config) *sdktrace.TracerProvider

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 Config added in v0.5.35

type Config struct {
	ExporterConfig      ExporterConfig
	TraceProviderConfig TraceProviderConfig
}

type ExporterConfig added in v0.5.35

type ExporterConfig struct {
	Endpoint    string
	AccessToken string
}

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 LauncherConfig added in v0.5.10

type LauncherConfig struct {
	ServiceName string
	AccessToken string
}

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
}

type TraceProviderConfig added in v0.5.35

type TraceProviderConfig struct {
	ServiceName    string
	ServiceVersion string
	Env            string
}

Jump to

Keyboard shortcuts

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