driver

package
v0.0.1-20230504-0001 Latest Latest
Warning

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

Go to latest
Published: May 4, 2023 License: MIT Imports: 4 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 interface {
	GetDbName() string
	GetDbUser() string
	GetDbType() string // mysql, cockroachdb, postgres etc...
	GetLogger() *loggerConfig.Config
	GetIsEnabled() bool
	GetResolvers() []Resolver
	GetOnConnectOptions() ConfigOnConnectOptions
	GetSelf() Config
	GetSkipDefaultTransaction() bool
	GetSearchForAnActiveResolverIfDownPolicy() SearchForAnActiveResolverIfDownPolicy
}

this is the main configuration which involves all the other interfaces

type ConfigOnConnectOptions

type ConfigOnConnectOptions interface {
	GetOnFailedDelayDurationBetweenConnections() time.Duration
	GetRetryOnFailed() bool
	GetMaxNrOfRetries() int8
	GetRetryDelaySeconds() int8
	GetPanicOnFailed() bool
}

This is when first connecting...

type Connection

type Connection interface {
	SetLogger(logger *model.Logger)
	SetMasterConfig(config interface{})
	GetDialector() gorm.Dialector
	GetReconnectOptions() ReconnectOptions
}

type ReconnectOptions

type ReconnectOptions interface {
	GetIsEnabled() bool
	GetReconnectAfterSeconds() uint16
	GetMaxRetries() int16
}

this is the reconnect options for the resolver & connection

type Resolver

type Resolver interface {
	GetSources() []Connection
	GetReplicas() []Connection
	GetPolicyName() string
	GetMaxIdleConnections() int
	GetMaxOpenConnections() int
	GetConnectionMaxLifeTimeSeconds() uint32
	GetConnectionMaxIdleTimeSeconds() uint32
	//GetPolicyOptions() dbresolver.Policy
	GetPolicyOptions() interface{}
	//SetPolicyOptions(policy dbresolver.Policy)
	SetPolicyOptions(policy interface{})
	GetReconnectOptions() ReconnectOptions
	GetTables() []string
}

this is the resolver

type SearchForAnActiveResolverIfDownPolicy

type SearchForAnActiveResolverIfDownPolicy interface {
	GetIsEnabled() bool
	GetDelayMsBetweenSearches() uint16
	GetMaxRetries() int16
}

Directories

Path Synopsis
cockroach
mysql
sqlite

Jump to

Keyboard shortcuts

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