config

package
v6.0.1 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2024 License: CC0-1.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	URL                string `yaml:"url"`
	MaxOpenConnections int    `yaml:"max_open_connections"`
	MaxIdleConnections int    `yaml:"max_idle_connections"`
	PartitionSize      int64  `yaml:"partition_size"`
	PartitionBatchSize int64  `yaml:"partition_batch"`
	SSLModeEnable      string `yaml:"ssl_mode_enable"`
	SSLRootCert        string `yaml:"ssl_root_cert"`
	SSLCert            string `yaml:"ssl_cert"`
	SSLKey             string `yaml:"ssl_key"`
}

func DefaultDatabaseConfig

func DefaultDatabaseConfig() Config

DefaultDatabaseConfig returns the default instance of Config

func NewDatabaseConfig

func NewDatabaseConfig(
	url, sslModeEnable, sslRootCert, sslCert, sslKey string,
	maxOpenConnections int, maxIdleConnections int,
	partitionSize int64, batchSize int64,
) Config

func (Config) GetHost

func (c Config) GetHost() string

func (Config) GetPassword

func (c Config) GetPassword() string

func (Config) GetPort

func (c Config) GetPort() string

func (Config) GetSSLMode

func (c Config) GetSSLMode() string

func (Config) GetSchema

func (c Config) GetSchema() string

func (Config) GetUser

func (c Config) GetUser() string

func (Config) WithMaxIdleConnections

func (c Config) WithMaxIdleConnections(maxIdleConnections int) Config

func (Config) WithMaxOpenConnections

func (c Config) WithMaxOpenConnections(maxOpenConnections int) Config

func (Config) WithPartitionBatchSize

func (c Config) WithPartitionBatchSize(partitionBatchSize int64) Config

func (Config) WithPartitionSize

func (c Config) WithPartitionSize(partitionSize int64) Config

func (Config) WithSSLCert

func (c Config) WithSSLCert(sslCert string) Config

func (Config) WithSSLKey

func (c Config) WithSSLKey(sslKey string) Config

func (Config) WithSSLModeEnable

func (c Config) WithSSLModeEnable(sslModeEnable string) Config

func (Config) WithSSLRootCert

func (c Config) WithSSLRootCert(sslRootCert string) Config

func (Config) WithURL

func (c Config) WithURL(url string) Config

Jump to

Keyboard shortcuts

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