Documentation
¶
Index ¶
- func GetId(manager Manager) (id string)
- func IsShared(manager Manager) bool
- func ManagerFactories() map[string]ManagerFactory
- func Managers() map[string]Manager
- func ReconfigureConnections(connections map[string]*Config) (err error)
- func RegisterManager(connectionId string, manager Manager) error
- func RegisterManagerFactory(factory ManagerFactory) error
- func ReplaceManagerFactory(ref string, factory ManagerFactory) error
- func ResolveConfig(config *Config) error
- type Config
- type Manager
- type ManagerFactory
- type ReconfigurableConnection
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetId ¶ added in v1.6.25
GetId returns the shared-connection id `manager` was registered under, or "" when the manager is not a shared connection (for example an inline connection config). It mirrors IsShared, which already performs the same linear scan; `managers` holds one entry per app connection, so the scan is single-digit.
A map[Manager]string reverse index was deliberately rejected: indexing by a manager panics with "hash of unhashable type" for a value-receiver manager over a struct holding a map or slice, which would be an unrecoverable panic at app startup for every app in the org, including apps that never use a transaction. The recover below closes the same pre-existing hazard IsShared already carries.
func ManagerFactories ¶ added in v0.10.0
func ManagerFactories() map[string]ManagerFactory
func ReconfigureConnections ¶ added in v1.6.4
func RegisterManager ¶
func RegisterManagerFactory ¶
func RegisterManagerFactory(factory ManagerFactory) error
func ReplaceManagerFactory ¶ added in v0.10.2
func ReplaceManagerFactory(ref string, factory ManagerFactory) error
func ResolveConfig ¶ added in v0.9.4
Types ¶
type Config ¶
type Manager ¶
type Manager interface {
Type() string
GetConnection() interface{}
ReleaseConnection(connection interface{})
}
func GetManager ¶
func NewManager ¶
type ManagerFactory ¶
type ManagerFactory interface {
Type() string
NewManager(settings map[string]interface{}) (Manager, error)
}
func GetManagerFactory ¶
func GetManagerFactory(ref string) ManagerFactory
type ReconfigurableConnection ¶ added in v1.6.4
ReconfigurableConnection allows dynamic update for existing connection instance