|
| 1 | +package coreopts |
| 2 | + |
| 3 | +import ( |
| 4 | + "database/sql" |
| 5 | + |
| 6 | + flowcore "github.com/trimble-oss/tierceron-core/v2/flow" |
| 7 | +) |
| 8 | + |
| 9 | +type Option func(*OptionsBuilder) |
| 10 | + |
| 11 | +type OptionsBuilder struct { |
| 12 | + GetFolderPrefix func(custom []string) string |
| 13 | + GetSupportedTemplates func(custom []string) []string |
| 14 | + GetVaultInstallRoot func() string |
| 15 | + IsLocalEndpoint func(addr string) bool |
| 16 | + GetSupportedDomains func(bool) []string |
| 17 | + GetSupportedEndpoints func(bool) [][]string |
| 18 | + GetLocalHost func() string |
| 19 | + GetRegionByHost func(hostName string) string |
| 20 | + GetDefaultRegion func() string |
| 21 | + GetVaultHost func() string |
| 22 | + GetVaultHostPort func() string |
| 23 | + GetUserNameField func() string |
| 24 | + GetUserCodeField func() string |
| 25 | + ActiveSessions func(db *sql.DB) ([]map[string]any, error) |
| 26 | + GetSyncedTables func() []string |
| 27 | + IsSupportedFlow func(flowName string) bool |
| 28 | + GetDatabaseName func(flumeDbType flowcore.FlumeDbType) string |
| 29 | + FindIndexForService func(tfmContext flowcore.FlowMachineContext, project string, service string) (string, []string, string, error) |
| 30 | + DecryptSecretConfig func(map[string]any, map[string]any) (string, error) |
| 31 | + GetDFSPathName func() (string, string) |
| 32 | + CompareLastModified func(dfStatMapA map[string]any, dfStatMapB map[string]any) bool |
| 33 | + PreviousStateCheck func(currentState int) int |
| 34 | + GetMachineID func() string |
| 35 | + InitPluginConfig func(pluginEnvConfig map[string]any) map[string]any |
| 36 | + GetPluginRestrictedMappings func() map[string][][]string |
| 37 | + GetSupportedCertIssuers func() []string |
| 38 | +} |
| 39 | + |
| 40 | +var BuildOptions *OptionsBuilder |
| 41 | + |
| 42 | +func NewOptionsBuilder(opts ...Option) { |
| 43 | + BuildOptions = &OptionsBuilder{} |
| 44 | + for _, opt := range opts { |
| 45 | + opt(BuildOptions) |
| 46 | + } |
| 47 | +} |
0 commit comments