buildopts

package
v1.21.3 Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2024 License: MIT Imports: 4 Imported by: 11

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Authorize

func Authorize(db *sql.DB, userIdentifier string, userPassword string) (bool, string, error)

Authorize - override to provide a custom authorization function for use by the web interface. This function should return true and use user name authorized if the user is authorized, false if not, and an error if an error occurs. The web interface is not presently maintained.

func CheckMemLock

func CheckMemLock(bucket string, key string) bool

CheckMemLock - override to provide a custom mem lock check function. Utilizing the bucket (ex: super-secrets/Index/FlumeDatabase) and key (ex: tenantId), decides whether or not to memlock the indicated value retrieved from vault. Returns true if the value should be memlocked, false if not.

func GetExtensionAuthComponents

func GetExtensionAuthComponents(config map[string]interface{}) map[string]interface{}

GetExtensionAuthComponents - obtains an auth components for an identity provider to be used by business logic flows... Fields to be provided by the map include: authDomain, authHeaders, bodyData, and authUrl. This components will by used by a standard http client to authenticate with the authUrl. The response from the query will be provided to the Flow Context in the ExtensionAuthData field That can then be used by business logic flows residing in TrcDb to query additional services requiring authentication.

func GetLocalVaultAddr

func GetLocalVaultAddr() string

Local vault address deprecated

func GetSupportedSourceRegions

func GetSupportedSourceRegions() []string

GetSupportedSourceRegions provide source regions supported by TrcDb.

func GetSyncedTables

func GetSyncedTables() []string

GetSyncedTables - return a list of synced tables from a remote source in TrcDb. Override this function to provide a list of synced tables.

func GetTestConfig

func GetTestConfig(tokenPtr *string, wantPluginPaths bool) map[string]interface{}

Test configurations.

func GetTestDeployConfig

func GetTestDeployConfig(tokenPtr *string) map[string]interface{}

GetTestDeployConfig - returns a list of templates used in defining tables for Trcdb. Supported attributes include templatePath, connectionPath, certifyPath, env, exitOnFailure, pluginNameList, and logNamespace:

func GetTrcDbUrl added in v1.0.1

func GetTrcDbUrl(data map[string]interface{}) string

GetTrcDbUrl - Utilized by speculatio/fenestra to obtain a jdbc compliant connection url to the TrcDb database This can be used to perform direct queries against the TrcDb database using the go sql package. The data map is provided by the caller as convenience to provide things like dbport, etc... The override should return a jdbc compliant connection url to the TrcDb database.

func NewOptionsBuilder added in v1.0.1

func NewOptionsBuilder(opts ...Option)

func ProcessPluginEnvConfig

func ProcessPluginEnvConfig(pluginEnvConfig map[string]interface{}) map[string]interface{}

ProcessPluginEnvConfig - returns a list of templates used in defining tables for Trcdb. Supported attributes include templatePath, connectionPath, certifyPath, env, exitOnFailure, pluginNameList, and logNamespace:

Here is an example expanded templatePath:

 templatePath: []string{
	"trc_templates/DatabaseName/TableNameA/TableNameA.tmpl",
	"trc_templates/DatabaseName/TableNameB/TableNameB.tmpl",
	"trc_templates/FlumeDatabase/TierceronFlow/TierceronFlow.tmpl",
}

func SetErrorLogger

func SetErrorLogger(logger interface{})

SetErrorLogger is called by TrcDb and other utilities to provide the extensions a handle to the error logger for custom libraries that need a hook into the logging infrastructure. In extension implementation, set global variables with type func(string, ...interface{}) assign the globals to the return value of convLogger... You'll have to copy convLogger into your custom library implementation.

func SetLogger

func SetLogger(logger interface{})

SetLogger is called by TrcDb and other utilities to provide the extensions a handle to the error logger for custom libraries that need a hook into the logging infrastructure. In extension implementation, set global variables with type func(string, ...interface{}) assign the globals to the return value of convLogger... You'll have to copy convLogger into your custom library implementation.

Types

type Option added in v1.0.1

type Option func(*OptionsBuilder)

func LoadOptions added in v1.0.1

func LoadOptions() Option

type OptionsBuilder added in v1.0.1

type OptionsBuilder struct {
	SetLogger      func(logger interface{})
	SetErrorLogger func(logger interface{})

	GetLocalVaultAddr          func() string
	GetSupportedSourceRegions  func() []string
	GetTestDeployConfig        func(tokenPtr *string) map[string]interface{}
	ProcessPluginEnvConfig     func(pluginEnvConfig map[string]interface{}) map[string]interface{}
	GetExtensionAuthComponents func(config map[string]interface{}) map[string]interface{}
	GetSyncedTables            func() []string
	Authorize                  func(db *sql.DB, userIdentifier string, userPassword string) (bool, string, error)
	CheckMemLock               func(bucket string, key string) bool
	GetTrcDbUrl                func(data map[string]interface{}) string
}
var BuildOptions *OptionsBuilder

Jump to

Keyboard shortcuts

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