servercfg

package
v0.14.1 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LogLevel_Trace   = "trace"
	LogLevel_Debug   = "debug"
	LogLevel_Info    = "info"
	LogLevel_Warning = "warn"
	LogLevel_Error   = "error"
	LogLevel_Fatal   = "fatal"
	LogLevel_Panic   = "panic"
)
View Source
const (
	DefaultHost                       = "localhost"
	DefaultPort                       = 5432
	DefaultUser                       = "postgres"
	DefaultPass                       = "password"
	DefaultTimeout                    = 8 * 60 * 60 * 1000 // 8 hours, same as MySQL
	DefaultReadOnly                   = false
	DefaultLogLevel                   = LogLevel_Info
	DefaultDoltTransactionCommit      = false
	DefaultMaxConnections             = 100
	DefaultQueryParallelism           = 0
	DefaultPersistenceBahavior        = LoadPerisistentGlobals
	DefaultDataDir                    = "."
	DefaultCfgDir                     = ".doltcfg"
	DefaultPrivilegeFilePath          = "privileges.db"
	DefaultBranchControlFilePath      = "branch_control.db"
	DefaultMetricsHost                = ""
	DefaultMetricsPort                = -1
	DefaultAllowCleartextPasswords    = false
	DefaultPostgresUnixSocketFilePath = "/tmp/.s.PGSQL.5432"
	DefaultMaxLoggedQueryLen          = 0
	DefaultEncodeLoggedQuery          = false
)
View Source
const (
	IgnorePeristentGlobals = "ignore"
	LoadPerisistentGlobals = "load"
)
View Source
const DOLTGRES_DATA_DIR = "DOLTGRES_DATA_DIR"

DOLTGRES_DATA_DIR is an environment variable that defines the location of DoltgreSQL databases

View Source
const DOLTGRES_DATA_DIR_DEFAULT = "doltgres/databases"

DOLTGRES_DATA_DIR_DEFAULT is the portion to append to the user's home directory if DOLTGRES_DATA_DIR has not been specified

View Source
const (
	OverrideDataDirKey = "data_dir"
)

Variables

View Source
var ConfigHelp = "Supported fields in the config.yaml file, and their default values, " +
	"are as follows:\n\n" + DefaultServerConfig().String()

Functions

func Ptr

func Ptr[T any](v T) *T

Ptr is a helper function that returns a pointer to the value passed in. This is necessary to e.g. get a pointer to a const value without assigning to an intermediate variable.

Types

type DoltgesMetricsConfig

type DoltgesMetricsConfig struct {
	Labels map[string]string `yaml:"labels,omitempty" minver:"0.7.4"`
	Host   *string           `yaml:"host,omitempty" minver:"0.7.4"`
	Port   *int              `yaml:"port,omitempty" minver:"0.7.4"`
}

type DoltgresBehaviorConfig

type DoltgresBehaviorConfig struct {
	ReadOnly *bool `yaml:"read_only,omitempty" minver:"0.7.4"`
	// Disable processing CLIENT_MULTI_STATEMENTS support on the
	// sql server.  Dolt's handling of CLIENT_MULTI_STATEMENTS is currently
	// broken. If a client advertises to support it (mysql cli client
	// does), and then sends statements that contain embedded unquoted ';'s
	// (such as a CREATE TRIGGER), then those incoming queries will be
	// misprocessed.
	DisableClientMultiStatements *bool `yaml:"disable_client_multi_statements,omitempty" minver:"0.7.4"`
	// DoltTransactionCommit enables the @@dolt_transaction_commit system variable, which
	// automatically creates a Dolt commit when any SQL transaction is committed.
	DoltTransactionCommit *bool `yaml:"dolt_transaction_commit,omitempty" minver:"0.7.4"`
}

BehaviorYAMLConfig contains server configuration regarding how the server should behave

type DoltgresConfig

type DoltgresConfig struct {
	LogLevelStr       *string                    `yaml:"log_level,omitempty" minver:"0.7.4"`
	MaxLenInLogs      *int                       `yaml:"max_query_len_in_logs,omitempty" minver:"0.7.4"`
	EncodeLoggedQuery *bool                      `yaml:"encode_logged_query,omitempty" minver:"0.7.4"`
	BehaviorConfig    *DoltgresBehaviorConfig    `yaml:"behavior,omitempty" minver:"0.7.4"`
	UserConfig        *DoltgresUserConfig        `yaml:"user,omitempty" minver:"0.7.4"`
	ListenerConfig    *DoltgresListenerConfig    `yaml:"listener,omitempty" minver:"0.7.4"`
	PerformanceConfig *DoltgresPerformanceConfig `yaml:"performance,omitempty" minver:"0.7.4"`
	DataDirStr        *string                    `yaml:"data_dir,omitempty" minver:"0.7.4"`
	CfgDirStr         *string                    `yaml:"cfg_dir,omitempty" minver:"0.7.4"`
	MetricsConfig     *DoltgesMetricsConfig      `yaml:"metrics,omitempty" minver:"0.7.4"`
	RemotesapiConfig  *DoltgresRemotesapiConfig  `yaml:"remotesapi,omitempty" minver:"0.7.4"`
	PrivilegeFile     *string                    `yaml:"privilege_file,omitempty" minver:"0.7.4"`
	BranchControlFile *string                    `yaml:"branch_control_file,omitempty" minver:"0.7.4"`

	// TODO: Rename to UserVars_
	Vars            []DoltgresUserSessionVars `yaml:"user_session_vars,omitempty" minver:"0.7.4"`
	SystemVariables map[string]interface{}    `yaml:"system_variables,omitempty" minver:"0.7.4"`
	Jwks            []servercfg.JwksConfig    `yaml:"jwks,omitempty" minver:"0.7.4"`
	GoldenMysqlConn *string                   `yaml:"golden_mysql_conn,omitempty" minver:"0.7.4"`

	PostgresReplicationConfig *PostgresReplicationConfig `yaml:"postgres_replication,omitempty" minver:"0.7.4"`
}

func ConfigFromYamlData

func ConfigFromYamlData(configFileData []byte) (*DoltgresConfig, error)

func DefaultServerConfig added in v0.9.0

func DefaultServerConfig() *DoltgresConfig

DefaultServerConfig creates a `*DoltgresConfig` that has all of the options set to their default values. Used when no config.yaml file is provided.

func ReadConfigFromYamlFile

func ReadConfigFromYamlFile(fs filesys.Filesys, configFilePath string) (*DoltgresConfig, error)

func (*DoltgresConfig) AllowCleartextPasswords

func (cfg *DoltgresConfig) AllowCleartextPasswords() bool

func (*DoltgresConfig) AutoCommit

func (cfg *DoltgresConfig) AutoCommit() bool

func (*DoltgresConfig) BranchControlFilePath

func (cfg *DoltgresConfig) BranchControlFilePath() string

func (*DoltgresConfig) CfgDir

func (cfg *DoltgresConfig) CfgDir() string

func (*DoltgresConfig) ClusterConfig

func (cfg *DoltgresConfig) ClusterConfig() servercfg.ClusterConfig

func (*DoltgresConfig) DataDir

func (cfg *DoltgresConfig) DataDir() string

func (*DoltgresConfig) DisableClientMultiStatements

func (cfg *DoltgresConfig) DisableClientMultiStatements() bool

func (*DoltgresConfig) DoltTransactionCommit

func (cfg *DoltgresConfig) DoltTransactionCommit() bool

func (*DoltgresConfig) EventSchedulerStatus

func (cfg *DoltgresConfig) EventSchedulerStatus() string

func (*DoltgresConfig) Host

func (cfg *DoltgresConfig) Host() string

func (*DoltgresConfig) JwksConfig

func (cfg *DoltgresConfig) JwksConfig() []servercfg.JwksConfig

func (*DoltgresConfig) LogLevel

func (cfg *DoltgresConfig) LogLevel() servercfg.LogLevel

func (*DoltgresConfig) MaxConnections

func (cfg *DoltgresConfig) MaxConnections() uint64

func (*DoltgresConfig) MaxLoggedQueryLen

func (cfg *DoltgresConfig) MaxLoggedQueryLen() int

func (*DoltgresConfig) MetricsHost

func (cfg *DoltgresConfig) MetricsHost() string

func (*DoltgresConfig) MetricsLabels

func (cfg *DoltgresConfig) MetricsLabels() map[string]string

func (*DoltgresConfig) MetricsPort

func (cfg *DoltgresConfig) MetricsPort() int

func (*DoltgresConfig) Password

func (cfg *DoltgresConfig) Password() string

func (*DoltgresConfig) PersistenceBehavior

func (cfg *DoltgresConfig) PersistenceBehavior() string

func (*DoltgresConfig) Port

func (cfg *DoltgresConfig) Port() int

func (*DoltgresConfig) PrivilegeFilePath

func (cfg *DoltgresConfig) PrivilegeFilePath() string

func (*DoltgresConfig) QueryParallelism

func (cfg *DoltgresConfig) QueryParallelism() int

func (*DoltgresConfig) ReadOnly

func (cfg *DoltgresConfig) ReadOnly() bool

func (*DoltgresConfig) ReadTimeout

func (cfg *DoltgresConfig) ReadTimeout() uint64

func (*DoltgresConfig) RemotesapiPort

func (cfg *DoltgresConfig) RemotesapiPort() *int

func (*DoltgresConfig) RemotesapiReadOnly

func (cfg *DoltgresConfig) RemotesapiReadOnly() *bool

func (*DoltgresConfig) RequireSecureTransport

func (cfg *DoltgresConfig) RequireSecureTransport() bool

func (*DoltgresConfig) ShouldEncodeLoggedQuery

func (cfg *DoltgresConfig) ShouldEncodeLoggedQuery() bool

func (*DoltgresConfig) Socket

func (cfg *DoltgresConfig) Socket() string

func (*DoltgresConfig) String added in v0.9.0

func (cfg *DoltgresConfig) String() string

func (*DoltgresConfig) SystemVars

func (cfg *DoltgresConfig) SystemVars() map[string]interface{}

func (*DoltgresConfig) TLSCert

func (cfg *DoltgresConfig) TLSCert() string

func (*DoltgresConfig) TLSKey

func (cfg *DoltgresConfig) TLSKey() string

func (*DoltgresConfig) ToSqlServerConfig

func (cfg *DoltgresConfig) ToSqlServerConfig() servercfg.ServerConfig

func (*DoltgresConfig) User

func (cfg *DoltgresConfig) User() string

func (*DoltgresConfig) UserVars

func (cfg *DoltgresConfig) UserVars() []servercfg.UserSessionVars

func (*DoltgresConfig) ValueSet

func (cfg *DoltgresConfig) ValueSet(value string) bool

func (*DoltgresConfig) WriteTimeout

func (cfg *DoltgresConfig) WriteTimeout() uint64

type DoltgresListenerConfig

type DoltgresListenerConfig struct {
	HostStr            *string `yaml:"host,omitempty" minver:"0.7.4"`
	PortNumber         *int    `yaml:"port,omitempty" minver:"0.7.4"`
	ReadTimeoutMillis  *uint64 `yaml:"read_timeout_millis,omitempty" minver:"0.7.4"`
	WriteTimeoutMillis *uint64 `yaml:"write_timeout_millis,omitempty" minver:"0.7.4"`
	// TLSKey is a file system path to an unencrypted private TLS key in PEM format.
	TLSKey *string `yaml:"tls_key,omitempty" minver:"0.7.4"`
	// TLSCert is a file system path to a TLS certificate chain in PEM format.
	TLSCert *string `yaml:"tls_cert,omitempty" minver:"0.7.4"`
	// RequireSecureTransport can enable a mode where non-TLS connections are turned away.
	RequireSecureTransport *bool `yaml:"require_secure_transport,omitempty" minver:"0.7.4"`
	// AllowCleartextPasswords enables use of cleartext passwords.
	AllowCleartextPasswords *bool `yaml:"allow_cleartext_passwords,omitempty" minver:"0.7.4"`
	// Socket is unix socket file path
	Socket *string `yaml:"socket,omitempty" minver:"0.7.4"`
}

DoltgresListenerConfig contains information on the network connection that the server will open

type DoltgresPerformanceConfig

type DoltgresPerformanceConfig struct {
	QueryParallelism *int `yaml:"query_parallelism,omitempty" minver:"0.7.4"`
}

DoltgresPerformanceConfig contains configuration parameters for performance tweaking

type DoltgresRemotesapiConfig

type DoltgresRemotesapiConfig struct {
	Port     *int  `yaml:"port,omitempty" minver:"0.7.4"`
	ReadOnly *bool `yaml:"read_only,omitempty" minver:"0.7.4"`
}

type DoltgresUserConfig

type DoltgresUserConfig struct {
	Name     *string `yaml:"name,omitempty" minver:"0.7.4"`
	Password *string `yaml:"password,omitempty" minver:"0.7.4"`
}

type DoltgresUserSessionVars

type DoltgresUserSessionVars struct {
	Name string            `yaml:"name"`
	Vars map[string]string `yaml:"vars,omitempty"`
}

type PostgresReplicationConfig

type PostgresReplicationConfig struct {
	PostgresServerAddress *string `yaml:"postgres_server_address,omitempty" minver:"0.7.4"`
	PostgresUser          *string `yaml:"postgres_user,omitempty" minver:"0.7.4"`
	PostgresPassword      *string `yaml:"postgres_password,omitempty" minver:"0.7.4"`
	PostgresDatabase      *string `yaml:"postgres_database,omitempty" minver:"0.7.4"`
	PostgresPort          *int    `yaml:"postgres_port,omitempty" minver:"0.7.4"`
	SlotName              *string `yaml:"slot_name,omitempty" minver:"0.7.4"`
}

Jump to

Keyboard shortcuts

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