Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ComparatorFunc ¶
type Config ¶
type Config struct { Redis RedisConfig `yaml:"redis" env-prefix:"WORKER_REDIS_"` DB DBConfig `yaml:"db" env-prefix:"WORKER_DB_"` PollDelay time.Duration `yaml:"pollDelay" env:"WORKER_POLL_DELAY" env-default:"2s"` Debug bool `yaml:"debug" env:"WORKER_DEBUG" env-default:"false"` BatchSize int `yaml:"batchSize" env:"WORKER_BATCH_SIZE" env-default:"200"` }
type ConvertFunc ¶
type CursorConfig ¶
type CursorConfig struct { Column string `yaml:"column" env:"COLUMN" env-default:"id"` Type string `yaml:"type" env:"TYPE" env-default:"int64"` Default string `yaml:"default" env:"DEFAULT" env-default:"-1"` }
func (*CursorConfig) Info ¶
func (c *CursorConfig) Info() (*CursorInfo, error)
type CursorInfo ¶
type CursorInfo struct { Column string Type string Default any CompareFunc ComparatorFunc ConvertFunc ConvertFunc }
type DBConfig ¶
type DBConfig struct { // ConnectionString is the full connection string to the database. If ConnectionString is provided, the other fields // are ignored. ConnectionString string `yaml:"connectionString" env:"CONNECTION_STRING"` DriverName string `yaml:"driverName" env:"DRIVER_NAME" env-default:"postgres"` SelectQuery string `` //nolint:lll /* 142-byte string literal not displayed */ Cursor CursorConfig `yaml:"cursor" env-prefix:"CURSOR_"` Host string `yaml:"host" env:"HOST" env-default:"localhost"` Port int `yaml:"port" env:"PORT" env-default:"5432"` User string `yaml:"user" env:"USER" env-default:"postgres"` Password string `yaml:"password" env:"PASSWORD" env-default:"postgres"` DBName string `yaml:"dbName" env:"DBNAME" env-default:"postgres"` TLS DBTLSConfig `yaml:"tls" env-prefix:"TLS_"` }
func (*DBConfig) BuildConnectionString ¶
type DBTLSConfig ¶
type RedisConfig ¶
type RedisConfig struct { // URL is the connection string to the redis server. If URL is provided, the other fields are ignored. URL string `yaml:"url" env:"URL"` Host string `yaml:"host" env:"HOST" env-default:"localhost"` Port int `yaml:"port" env:"PORT" env-default:"6379"` User string `yaml:"user" env:"USER"` Password string `yaml:"password" env:"PASSWORD"` TLS RedisTLSConfig `yaml:"tls" env-prefix:"TLS_"` Key string `yaml:"key" env:"KEY" env-default:"my-worker:${partition_key}:key"` Value string `yaml:"value" env:"VALUE" env-default:"${id}"` CursorKey string `yaml:"cursorKey" env:"CURSOR_KEY" env-default:"my-worker:latest"` // TimestampKey is the key to store the timestamp that periodically gets written into redis to mark that the // worker is alive and processing rows (every worker poll). TimestampKey string `yaml:"timestampKey" env:"WRITER_TIMESTAMP_KEY"` }
func (*RedisConfig) ClientOptions ¶
func (c *RedisConfig) ClientOptions() (*redis.Options, error)
type RedisTLSConfig ¶
type RedisTLSConfig struct {
InsecureSkipVerify bool `yaml:"insecureSkipVerify" env:"INSECURE_SKIP_VERIFY" env-default:"false"`
}
Click to show internal directories.
Click to hide internal directories.