config

package
v5.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2023 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 added in v5.1.0

func (c Config) WithMaxIdleConnections(maxIdleConnections int) Config

func (Config) WithMaxOpenConnections added in v5.1.0

func (c Config) WithMaxOpenConnections(maxOpenConnections int) Config

func (Config) WithPartitionBatchSize added in v5.1.0

func (c Config) WithPartitionBatchSize(partitionBatchSize int64) Config

func (Config) WithPartitionSize added in v5.1.0

func (c Config) WithPartitionSize(partitionSize int64) Config

func (Config) WithSSLCert added in v5.1.0

func (c Config) WithSSLCert(sslCert string) Config

func (Config) WithSSLKey added in v5.1.0

func (c Config) WithSSLKey(sslKey string) Config

func (Config) WithSSLModeEnable added in v5.1.0

func (c Config) WithSSLModeEnable(sslModeEnable string) Config

func (Config) WithSSLRootCert added in v5.1.0

func (c Config) WithSSLRootCert(sslRootCert string) Config

func (Config) WithURL added in v5.1.0

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