Documentation ¶
Index ¶
- Constants
- Variables
- func GetConfigBackendURL() string
- func GetWorkspaceIDForSourceID(sourceID string) string
- func GetWorkspaceIDForWriteKey(writeKey string) string
- func Init()
- func Setup(configEnvHandler types.ConfigEnvI) (err error)
- func Subscribe(ctx context.Context, topic Topic) pubsub.DataChannel
- func WaitForConfig(ctx context.Context) error
- type BackendConfig
- type BackendConfigAdmin
- type CommonBackendConfig
- type ConfigT
- type ConnectionFlags
- type DestinationDefinitionT
- type DestinationT
- type DgSourceTrackingPlanConfigT
- type HostedWorkspacesConfig
- func (multiWorkspaceConfig *HostedWorkspacesConfig) AccessToken() string
- func (multiWorkspaceConfig *HostedWorkspacesConfig) Get(_ string) (ConfigT, bool)
- func (multiWorkspaceConfig *HostedWorkspacesConfig) GetWorkspaceIDForSourceID(sourceID string) string
- func (multiWorkspaceConfig *HostedWorkspacesConfig) GetWorkspaceIDForWriteKey(writeKey string) string
- func (multiWorkspaceConfig *HostedWorkspacesConfig) GetWorkspaceLibrariesForWorkspaceID(workspaceID string) LibrariesT
- func (multiWorkspaceConfig *HostedWorkspacesConfig) IsConfigured() bool
- func (multiWorkspaceConfig *HostedWorkspacesConfig) SetUp()
- type LibrariesT
- type LibraryT
- type MultiTenantWorkspacesConfig
- func (workspaceConfig *MultiTenantWorkspacesConfig) AccessToken() string
- func (workspaceConfig *MultiTenantWorkspacesConfig) Get(workspaces string) (ConfigT, bool)
- func (workspaceConfig *MultiTenantWorkspacesConfig) GetWorkspaceIDForSourceID(source string) string
- func (workspaceConfig *MultiTenantWorkspacesConfig) GetWorkspaceIDForWriteKey(writeKey string) string
- func (workspaceConfig *MultiTenantWorkspacesConfig) GetWorkspaceLibrariesForWorkspaceID(workspaceID string) LibrariesT
- func (workspaceConfig *MultiTenantWorkspacesConfig) IsConfigured() bool
- func (workspaceConfig *MultiTenantWorkspacesConfig) SetUp()
- type Regulation
- type SRegulationsT
- type SingleWorkspaceConfig
- func (workspaceConfig *SingleWorkspaceConfig) AccessToken() string
- func (workspaceConfig *SingleWorkspaceConfig) Get(workspace string) (ConfigT, bool)
- func (workspaceConfig *SingleWorkspaceConfig) GetWorkspaceIDForSourceID(_ string) string
- func (workspaceConfig *SingleWorkspaceConfig) GetWorkspaceIDForWriteKey(_ string) string
- func (workspaceConfig *SingleWorkspaceConfig) GetWorkspaceLibrariesForWorkspaceID(workspaceID string) LibrariesT
- func (workspaceConfig *SingleWorkspaceConfig) IsConfigured() bool
- func (workspaceConfig *SingleWorkspaceConfig) SetUp()
- type SourceDefinitionT
- type SourceRegulationT
- type SourceT
- type Topic
- type TrackingPlanT
- type TransformationT
- type WRegulationsT
- type WorkspaceRegulationT
- type WorkspacesT
Constants ¶
const ( /*TopicBackendConfig topic provides updates on full backend config, via Subscribe function */ TopicBackendConfig Topic = "backendConfig" /*TopicProcessConfig topic provides updates on backend config of processor enabled destinations, via Subscribe function */ TopicProcessConfig Topic = "processConfig" /*RegulationSuppress refers to Suppress Regulation */ RegulationSuppress Regulation = "Suppress" //TODO Will add support soon. /*RegulationDelete refers to Suppress and Delete Regulation */ RegulationDelete Regulation = "Delete" /*RegulationSuppressAndDelete refers to Suppress and Delete Regulation */ RegulationSuppressAndDelete Regulation = "Suppress_With_Delete" GlobalEventType = "global" )
Variables ¶
var ( LastSync string LastRegulationSync string //DefaultBackendConfig will be initialized be Setup to either a WorkspaceConfig or MultiWorkspaceConfig. DefaultBackendConfig BackendConfig Http sysUtils.HttpI = sysUtils.NewHttp() IoUtil sysUtils.IoUtilI = sysUtils.NewIoUtil() Diagnostics diagnostics.DiagnosticsI )
Functions ¶
func GetConfigBackendURL ¶ added in v0.1.10
func GetConfigBackendURL() string
func GetWorkspaceIDForSourceID ¶ added in v0.1.10
func Subscribe ¶
func Subscribe(ctx context.Context, topic Topic) pubsub.DataChannel
Subscribe subscribes a channel to a specific topic of backend config updates. Deprecated: Use an instance of BackendConfig instead of static function
func WaitForConfig ¶
WaitForConfig waits until backend config has been initialized Deprecated: Use an instance of BackendConfig instead of static function
Types ¶
type BackendConfig ¶
type BackendConfig interface { SetUp() AccessToken() string Get(string) (ConfigT, bool) GetWorkspaceIDForWriteKey(string) string GetWorkspaceIDForSourceID(string) string GetWorkspaceLibrariesForWorkspaceID(string) LibrariesT WaitForConfig(ctx context.Context) error Subscribe(ctx context.Context, topic Topic) pubsub.DataChannel Stop() StartWithIDs(workspaces string) IsConfigured() bool }
type BackendConfigAdmin ¶ added in v0.1.10
type BackendConfigAdmin struct{}
BackendConfigAdmin is container object to expose admin functions
func (*BackendConfigAdmin) RoutingConfig ¶ added in v0.1.10
func (bca *BackendConfigAdmin) RoutingConfig(filterProcessor bool, reply *string) (err error)
RoutingConfig reports current backend config and process config after masking secret fields
type CommonBackendConfig ¶ added in v0.1.10
type CommonBackendConfig struct {
// contains filtered or unexported fields
}
func (*CommonBackendConfig) StartWithIDs ¶ added in v0.1.10
func (bc *CommonBackendConfig) StartWithIDs(workspaces string)
func (*CommonBackendConfig) Stop ¶ added in v0.1.10
func (bc *CommonBackendConfig) Stop()
func (*CommonBackendConfig) Subscribe ¶ added in v0.1.10
func (bc *CommonBackendConfig) Subscribe(ctx context.Context, topic Topic) pubsub.DataChannel
Subscribe subscribes a channel to a specific topic of backend config updates. Channel will receive a new pubsub.DataEvent each time the backend configuration is updated. Data of the DataEvent should be a backendconfig.ConfigT struct. Available topics are: - TopicBackendConfig: Will receive complete backend configuration - TopicProcessConfig: Will receive only backend configuration of processor enabled destinations - TopicRegulations: Will receeive all regulations
func (*CommonBackendConfig) WaitForConfig ¶ added in v0.1.10
func (bc *CommonBackendConfig) WaitForConfig(ctx context.Context) error
WaitForConfig waits until backend config has been initialized
type ConfigT ¶ added in v0.1.10
type ConfigT struct { EnableMetrics bool `json:"enableMetrics"` WorkspaceID string `json:"workspaceId"` Sources []SourceT `json:"sources"` Libraries LibrariesT `json:"libraries"` ConnectionFlags ConnectionFlags `json:"flags"` }
type ConnectionFlags ¶ added in v0.1.10
type DestinationDefinitionT ¶
type DestinationT ¶
type DestinationT struct { ID string Name string DestinationDefinition DestinationDefinitionT Config map[string]interface{} Enabled bool Transformations []TransformationT IsProcessorEnabled bool }
type DgSourceTrackingPlanConfigT ¶ added in v0.1.10
type DgSourceTrackingPlanConfigT struct { SourceId string `json:"sourceId"` SourceConfigVersion int `json:"version"` Config map[string]map[string]interface{} `json:"config"` MergedConfig map[string]interface{} `json:"mergedConfig"` Deleted bool `json:"deleted"` TrackingPlan TrackingPlanT `json:"trackingPlan"` }
func (*DgSourceTrackingPlanConfigT) GetMergedConfig ¶ added in v0.1.10
func (dgSourceTPConfigT *DgSourceTrackingPlanConfigT) GetMergedConfig(eventType string) map[string]interface{}
type HostedWorkspacesConfig ¶ added in v0.1.10
type HostedWorkspacesConfig struct { CommonBackendConfig Token string // contains filtered or unexported fields }
HostedWorkspacesConfig is a struct to hold variables necessary for supporting multiple workspaces.
func (*HostedWorkspacesConfig) AccessToken ¶ added in v0.1.10
func (multiWorkspaceConfig *HostedWorkspacesConfig) AccessToken() string
func (*HostedWorkspacesConfig) Get ¶ added in v0.1.10
func (multiWorkspaceConfig *HostedWorkspacesConfig) Get(_ string) (ConfigT, bool)
Get returns sources from all hosted workspaces
func (*HostedWorkspacesConfig) GetWorkspaceIDForSourceID ¶ added in v0.1.10
func (multiWorkspaceConfig *HostedWorkspacesConfig) GetWorkspaceIDForSourceID(sourceID string) string
GetWorkspaceIDForWriteKey returns workspaceID for the given writeKey
func (*HostedWorkspacesConfig) GetWorkspaceIDForWriteKey ¶ added in v0.1.10
func (multiWorkspaceConfig *HostedWorkspacesConfig) GetWorkspaceIDForWriteKey(writeKey string) string
GetWorkspaceIDForWriteKey returns workspaceID for the given writeKey
func (*HostedWorkspacesConfig) GetWorkspaceLibrariesForWorkspaceID ¶ added in v0.1.10
func (multiWorkspaceConfig *HostedWorkspacesConfig) GetWorkspaceLibrariesForWorkspaceID(workspaceID string) LibrariesT
GetWorkspaceLibrariesForWorkspaceID returns workspaceLibraries for workspaceID
func (*HostedWorkspacesConfig) IsConfigured ¶ added in v0.1.10
func (multiWorkspaceConfig *HostedWorkspacesConfig) IsConfigured() bool
func (*HostedWorkspacesConfig) SetUp ¶ added in v0.1.10
func (multiWorkspaceConfig *HostedWorkspacesConfig) SetUp()
SetUp sets up MultiWorkspaceConfig
type LibrariesT ¶ added in v0.1.10
type LibrariesT []LibraryT
func GetWorkspaceLibrariesForWorkspaceID ¶ added in v0.1.10
func GetWorkspaceLibrariesForWorkspaceID(workspaceId string) LibrariesT
type MultiTenantWorkspacesConfig ¶ added in v0.1.10
type MultiTenantWorkspacesConfig struct { CommonBackendConfig Token string // contains filtered or unexported fields }
func (*MultiTenantWorkspacesConfig) AccessToken ¶ added in v0.1.10
func (workspaceConfig *MultiTenantWorkspacesConfig) AccessToken() string
func (*MultiTenantWorkspacesConfig) Get ¶ added in v0.1.10
func (workspaceConfig *MultiTenantWorkspacesConfig) Get(workspaces string) (ConfigT, bool)
Get returns sources from the workspace
func (*MultiTenantWorkspacesConfig) GetWorkspaceIDForSourceID ¶ added in v0.1.10
func (workspaceConfig *MultiTenantWorkspacesConfig) GetWorkspaceIDForSourceID(source string) string
func (*MultiTenantWorkspacesConfig) GetWorkspaceIDForWriteKey ¶ added in v0.1.10
func (workspaceConfig *MultiTenantWorkspacesConfig) GetWorkspaceIDForWriteKey(writeKey string) string
func (*MultiTenantWorkspacesConfig) GetWorkspaceLibrariesForWorkspaceID ¶ added in v0.1.10
func (workspaceConfig *MultiTenantWorkspacesConfig) GetWorkspaceLibrariesForWorkspaceID(workspaceID string) LibrariesT
GetWorkspaceLibrariesFromWorkspaceID returns workspaceLibraries for workspaceID
func (*MultiTenantWorkspacesConfig) IsConfigured ¶ added in v0.1.10
func (workspaceConfig *MultiTenantWorkspacesConfig) IsConfigured() bool
func (*MultiTenantWorkspacesConfig) SetUp ¶ added in v0.1.10
func (workspaceConfig *MultiTenantWorkspacesConfig) SetUp()
type Regulation ¶ added in v0.1.10
type Regulation string
type SRegulationsT ¶ added in v0.1.10
type SingleWorkspaceConfig ¶ added in v0.1.10
type SingleWorkspaceConfig struct { CommonBackendConfig Token string // contains filtered or unexported fields }
func (*SingleWorkspaceConfig) AccessToken ¶ added in v0.1.10
func (workspaceConfig *SingleWorkspaceConfig) AccessToken() string
func (*SingleWorkspaceConfig) Get ¶ added in v0.1.10
func (workspaceConfig *SingleWorkspaceConfig) Get(workspace string) (ConfigT, bool)
Get returns sources from the workspace
func (*SingleWorkspaceConfig) GetWorkspaceIDForSourceID ¶ added in v0.1.10
func (workspaceConfig *SingleWorkspaceConfig) GetWorkspaceIDForSourceID(_ string) string
func (*SingleWorkspaceConfig) GetWorkspaceIDForWriteKey ¶ added in v0.1.10
func (workspaceConfig *SingleWorkspaceConfig) GetWorkspaceIDForWriteKey(_ string) string
func (*SingleWorkspaceConfig) GetWorkspaceLibrariesForWorkspaceID ¶ added in v0.1.10
func (workspaceConfig *SingleWorkspaceConfig) GetWorkspaceLibrariesForWorkspaceID(workspaceID string) LibrariesT
GetWorkspaceLibrariesFromWorkspaceID returns workspaceLibraries for workspaceID
func (*SingleWorkspaceConfig) IsConfigured ¶ added in v0.1.10
func (workspaceConfig *SingleWorkspaceConfig) IsConfigured() bool
func (*SingleWorkspaceConfig) SetUp ¶ added in v0.1.10
func (workspaceConfig *SingleWorkspaceConfig) SetUp()
type SourceDefinitionT ¶
type SourceRegulationT ¶ added in v0.1.10
type SourceT ¶
type SourceT struct { ID string Name string SourceDefinition SourceDefinitionT Config map[string]interface{} Enabled bool WorkspaceID string Destinations []DestinationT WriteKey string DgSourceTrackingPlanConfig DgSourceTrackingPlanConfigT Transient bool }
type Topic ¶ added in v0.1.10
type Topic string
Topic refers to a subset of backend config's updates, received after subscribing using the backend config's Subscribe function.
type TrackingPlanT ¶ added in v0.1.10
type TransformationT ¶
type WRegulationsT ¶ added in v0.1.10
type WorkspaceRegulationT ¶ added in v0.1.10
type WorkspacesT ¶
WorkspacesT holds sources of workspaces