Documentation ¶
Index ¶
- Constants
- Variables
- func GetWorkspaceIDForWriteKey(writeKey string) string
- func Setup(pollRegulations bool, configEnvHandler types.ConfigEnvI)
- func Subscribe(channel chan utils.DataEvent, topic Topic)
- func WaitForConfig()
- type BackendConfig
- type BackendConfigAdmin
- type CommonBackendConfig
- type ConfigT
- type ConnectionFlags
- type DestinationDefinitionT
- type DestinationT
- type HostedWorkspacesT
- type LibrariesT
- type LibraryT
- type MultiWorkspaceConfig
- func (multiWorkspaceConfig *MultiWorkspaceConfig) Get() (ConfigT, bool)
- func (multiWorkspaceConfig *MultiWorkspaceConfig) GetRegulations() (RegulationsT, bool)
- func (multiWorkspaceConfig *MultiWorkspaceConfig) GetWorkspaceIDForWriteKey(writeKey string) string
- func (multiWorkspaceConfig *MultiWorkspaceConfig) GetWorkspaceLibrariesForWorkspaceID(workspaceID string) LibrariesT
- func (multiWorkspaceConfig *MultiWorkspaceConfig) SetUp()
- type Regulation
- type RegulationsT
- type SRegulationsT
- type SourceDefinitionT
- type SourceRegulationT
- type SourceT
- type Topic
- type TransformationT
- type WRegulationsT
- type WorkspaceConfig
- func (workspaceConfig *WorkspaceConfig) Get() (ConfigT, bool)
- func (workspaceConfig *WorkspaceConfig) GetRegulations() (RegulationsT, bool)
- func (workspaceConfig *WorkspaceConfig) GetWorkspaceIDForWriteKey(writeKey string) string
- func (workspaceConfig *WorkspaceConfig) GetWorkspaceLibrariesForWorkspaceID(workspaceID string) LibrariesT
- func (workspaceConfig *WorkspaceConfig) SetUp()
- type WorkspaceRegulationT
- type WorkspaceRegulationsT
- type WorkspaceT
- 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" /*TopicRegulations topic provides updates on regulations, via Subscribe function */ TopicRegulations Topic = "regulations" /*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" )
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 = diagnostics.Diagnostics )
var Eb utils.PublishSubscriber = new(utils.EventBus)
Functions ¶
func Setup ¶
func Setup(pollRegulations bool, configEnvHandler types.ConfigEnvI)
Setup backend config
func Subscribe ¶
Subscribe subscribes a channel to a specific topic of backend config updates. Deprecated: Use an instance of BackendConfig instead of static function
func WaitForConfig ¶
func WaitForConfig()
WaitForConfig waits until backend config has been initialized Deprecated: Use an instance of BackendConfig instead of static function
Types ¶
type BackendConfig ¶
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) Subscribe ¶ added in v0.1.10
func (bc *CommonBackendConfig) Subscribe(channel chan utils.DataEvent, topic Topic)
Subscribe subscribes a channel to a specific topic of backend config updates. Channel will receive a new utils.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()
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 HostedWorkspacesT ¶ added in v1.0.0
type HostedWorkspacesT struct {
HostedWorkspaces []WorkspaceT `json:"workspaces"`
}
type LibrariesT ¶ added in v0.1.10
type LibrariesT []LibraryT
func GetWorkspaceLibrariesForWorkspaceID ¶ added in v0.1.10
func GetWorkspaceLibrariesForWorkspaceID(workspaceId string) LibrariesT
type MultiWorkspaceConfig ¶
type MultiWorkspaceConfig struct { CommonBackendConfig // contains filtered or unexported fields }
MultiWorkspaceConfig is a struct to hold variables necessary for supporting multiple workspaces.
func (*MultiWorkspaceConfig) Get ¶
func (multiWorkspaceConfig *MultiWorkspaceConfig) Get() (ConfigT, bool)
Get returns sources from all hosted workspaces
func (*MultiWorkspaceConfig) GetRegulations ¶ added in v1.0.0
func (multiWorkspaceConfig *MultiWorkspaceConfig) GetRegulations() (RegulationsT, bool)
GetRegulations returns regulations from all hosted workspaces
func (*MultiWorkspaceConfig) GetWorkspaceIDForWriteKey ¶
func (multiWorkspaceConfig *MultiWorkspaceConfig) GetWorkspaceIDForWriteKey(writeKey string) string
GetWorkspaceIDForWriteKey returns workspaceID for the given writeKey
func (*MultiWorkspaceConfig) GetWorkspaceLibrariesForWorkspaceID ¶ added in v1.0.0
func (multiWorkspaceConfig *MultiWorkspaceConfig) GetWorkspaceLibrariesForWorkspaceID(workspaceID string) LibrariesT
GetWorkspaceLibrariesForWorkspaceID returns workspaceLibraries for workspaceID
func (*MultiWorkspaceConfig) SetUp ¶
func (multiWorkspaceConfig *MultiWorkspaceConfig) SetUp()
SetUp sets up MultiWorkspaceConfig
type Regulation ¶ added in v0.1.10
type Regulation string
type RegulationsT ¶ added in v1.0.0
type RegulationsT struct { WorkspaceRegulations []WorkspaceRegulationT `json:"workspaceRegulations"` SourceRegulations []SourceRegulationT `json:"sourceRegulations"` }
type SRegulationsT ¶ added in v0.1.10
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 }
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 TransformationT ¶
type WRegulationsT ¶ added in v0.1.10
type WorkspaceConfig ¶
type WorkspaceConfig struct { CommonBackendConfig // contains filtered or unexported fields }
func (*WorkspaceConfig) Get ¶
func (workspaceConfig *WorkspaceConfig) Get() (ConfigT, bool)
Get returns sources from the workspace
func (*WorkspaceConfig) GetRegulations ¶ added in v1.0.0
func (workspaceConfig *WorkspaceConfig) GetRegulations() (RegulationsT, bool)
GetRegulations returns sources from the workspace
func (*WorkspaceConfig) GetWorkspaceIDForWriteKey ¶
func (workspaceConfig *WorkspaceConfig) GetWorkspaceIDForWriteKey(writeKey string) string
func (*WorkspaceConfig) GetWorkspaceLibrariesForWorkspaceID ¶ added in v1.0.0
func (workspaceConfig *WorkspaceConfig) GetWorkspaceLibrariesForWorkspaceID(workspaceID string) LibrariesT
GetWorkspaceLibrariesFromWorkspaceID returns workspaceLibraries for workspaceID
func (*WorkspaceConfig) SetUp ¶
func (workspaceConfig *WorkspaceConfig) SetUp()
type WorkspaceRegulationT ¶ added in v0.1.10
type WorkspaceRegulationsT ¶ added in v1.0.0
type WorkspaceRegulationsT struct {
WorkspaceRegulationsMap map[string]RegulationsT `json:"-"`
}
WorkspaceRegulationsT holds regulations of workspaces
type WorkspaceT ¶ added in v1.0.0
type WorkspaceT struct {
WorkspaceID string `json:"id"`
}
type WorkspacesT ¶
WorkspacesT holds sources of workspaces