Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
Driver string
Connection string // Connection string with user, password and connection address
MasterDatabase string // Name of the master database
MasterTable string // Name of the master table in master database
Template string // Database template, works only for postgresql
MasterData MasterResolver // Names of control columns
Mapper FMapper // Mapping functions
}
Config for database manager.
type Dealer ¶
type Dealer struct {
// contains filtered or unexported fields
}
Dealer controls databases manipulation.
type FMapper ¶
type FMapper struct {
IDToField func(string) string // Convert tenant ID to key field in master database
FieldToDatabase func(string) string // Convert dependent field to database name
KeyToValue func(string) string // Convert key field to dependent in master database
}
FMapper is used to convert ids to names
type MasterController ¶
type MasterController interface {
Get(string) (string, error)
Create(string) (string, error)
Delete(string) (string, error)
}
MasterController controls tenant data in master database
type MasterResolver ¶
type MasterResolver interface {
// contains filtered or unexported methods
}
MasterResolver is used to configure key and tenant fields.
func MasterDataResolver ¶
func MasterDataResolver(in interface{}) MasterResolver
MasterDataResolver is used to configure key and tenant fields from given type. Given struct must contain tags: `sw:"key"` for key `sw:"tenant"` for tenant database
func MasterFieldResolver ¶
func MasterFieldResolver(k, t string) MasterResolver
MasterFieldResolver sets key and dependent fields from string.
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
Package builder provides methods for creating simple SQL queries.
|
Package builder provides methods for creating simple SQL queries. |
|
Package mock_swolf is a generated GoMock package.
|
Package mock_swolf is a generated GoMock package. |
Click to show internal directories.
Click to hide internal directories.