config

package
v1.0.8 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultConfig = Config{
	Sync: SyncCfg{
		BatchMaxItems:    25000,
		BatchTimeout:     time.Second * 60,
		SkipAcknowledge:  false,
		ProhibitDropSlot: false,
	},
	Postgres: PostgresCfg{
		Connection:             "",
		SlotName:               "mammoth",
		StandbyMessageInterval: time.Second * 10,
	},
	Snowflake: SnowflakeCfg{
		Connection: "",
	},
	Logger: LoggerCfg{
		Level: "info",
		JSON:  false,
	},
}
View Source
var DefaultStreamToFileConfig = Config{
	Sync: SyncCfg{
		BatchMaxItems:    10000,
		BatchTimeout:     time.Second * 20,
		SkipAcknowledge:  true,
		ProhibitDropSlot: true,
	},
	Postgres: PostgresCfg{
		Connection:             "",
		SlotName:               "",
		StandbyMessageInterval: time.Second * 10,
	},
	Logger: LoggerCfg{
		Level: "info",
		JSON:  false,
	},
}

Functions

func WriteExampleConfig

func WriteExampleConfig(path string) error

Types

type Config

type Config struct {
	Sync      SyncCfg
	Postgres  PostgresCfg
	Snowflake SnowflakeCfg
	Logger    LoggerCfg
}

func GetConf

func GetConf(defaultCfg Config, path string) (*Config, error)

func (*Config) Validate

func (c *Config) Validate() error

type LoggerCfg

type LoggerCfg struct {
	Level string
	JSON  bool
}

type PostgresCfg

type PostgresCfg struct {
	Connection             string        `valid:"required"`
	SlotName               string        `valid:"required"`
	StandbyMessageInterval time.Duration `valid:"required"`
}

type SnowflakeCfg

type SnowflakeCfg struct {
	Connection string `valid:"required"`
	Database   string
	Schema     string
}

type SyncCfg

type SyncCfg struct {
	BatchMaxItems    int           `valid:"required"`
	BatchTimeout     time.Duration `valid:"required"`
	SkipAcknowledge  bool
	ProhibitDropSlot bool
	Tables           []string `valid:"required"`
}

Jump to

Keyboard shortcuts

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