Documentation
¶
Index ¶
- func BuildNativeSystemEnvOverrides(envOverrides ...EnvOverride) func(config *Config) error
- type Config
- type EnvOverride
- type ExternalSystemConfig
- type LayerErrorType
- type LayerServiceConfig
- type Logger
- type Metrics
- type ServiceRunner
- func (serviceRunner *ServiceRunner) Start() error
- func (serviceRunner *ServiceRunner) StartAndWait()
- func (serviceRunner *ServiceRunner) Stop() error
- func (serviceRunner *ServiceRunner) TransformService() TransformService
- func (serviceRunner *ServiceRunner) WithConfigLocation(configLocation string) *ServiceRunner
- func (serviceRunner *ServiceRunner) WithEnrichConfig(enrichConfig func(config *Config) error) *ServiceRunner
- type StatsdMetrics
- type Stoppable
- type TransformError
- type TransformService
- type TransformServiceFactory
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildNativeSystemEnvOverrides ¶
func BuildNativeSystemEnvOverrides(envOverrides ...EnvOverride) func(config *Config) error
BuildNativeSystemEnvOverrides can be plugged into `WithEnrichConfig`
it takes a variadic parameter list, each of which declares an environment variable that the layer will try to look up at start, and add to system_config.
Types ¶
type Config ¶
type Config struct { ConfigFile string // set by service runner ExternalSystemConfig ExternalSystemConfig `json:"external_config"` LayerServiceConfig *LayerServiceConfig `json:"layer_config"` }
type EnvOverride ¶
****************************************************************************
func Env ¶
func Env(key string, specs ...any) EnvOverride
Env function to conveniently construct EnvOverride instances
type ExternalSystemConfig ¶
type LayerErrorType ¶
type LayerErrorType int
const ( LayerErrorBadParameter LayerErrorType = iota LayerErrorInternal LayerNotSupported )
type LayerServiceConfig ¶
type LayerServiceConfig struct { Custom map[string]any `json:"custom"` ServiceName string `json:"service_name"` Port json.Number `json:"port"` ConfigRefreshInterval string `json:"config_refresh_interval"` LogLevel string `json:"log_level"` LogFormat string `json:"log_format"` StatsdAgentAddress string `json:"statsd_agent_address"` StatsdEnabled bool `json:"statsd_enabled"` }
type Logger ¶
type Metrics ¶
type Metrics interface { Incr(s string, tags []string, i int) TransformError Timing(s string, timed time.Duration, tags []string, i int) TransformError Gauge(s string, f float64, tags []string, i int) TransformError }
type ServiceRunner ¶
type ServiceRunner struct {
// contains filtered or unexported fields
}
func NewServiceRunner ¶
func NewServiceRunner(newTransformService func(config *Config, logger Logger, metrics Metrics) (TransformService, error)) *ServiceRunner
func (*ServiceRunner) Start ¶
func (serviceRunner *ServiceRunner) Start() error
func (*ServiceRunner) StartAndWait ¶
func (serviceRunner *ServiceRunner) StartAndWait()
func (*ServiceRunner) Stop ¶
func (serviceRunner *ServiceRunner) Stop() error
func (*ServiceRunner) TransformService ¶
func (serviceRunner *ServiceRunner) TransformService() TransformService
func (*ServiceRunner) WithConfigLocation ¶
func (serviceRunner *ServiceRunner) WithConfigLocation(configLocation string) *ServiceRunner
func (*ServiceRunner) WithEnrichConfig ¶
func (serviceRunner *ServiceRunner) WithEnrichConfig(enrichConfig func(config *Config) error) *ServiceRunner
type StatsdMetrics ¶
type StatsdMetrics struct {
// contains filtered or unexported fields
}
func (StatsdMetrics) Gauge ¶
func (sm StatsdMetrics) Gauge(name string, value float64, tags []string, rate int) TransformError
func (StatsdMetrics) Incr ¶
func (sm StatsdMetrics) Incr(name string, tags []string, rate int) TransformError
func (StatsdMetrics) Timing ¶
func (sm StatsdMetrics) Timing(name string, value time.Duration, tags []string, rate int) TransformError
type TransformError ¶
type TransformError interface { error Underlying() error // contains filtered or unexported methods }
func Err ¶
func Err(err error, errType LayerErrorType) TransformError
func Errorf ¶
func Errorf(errType LayerErrorType, format string, args ...any) TransformError
type TransformService ¶
type TransformService interface { Stoppable Transform(entityCollection *egdm.EntityCollection) (*egdm.EntityCollection, TransformError) UpdateConfiguration(config *Config) TransformError }
type TransformServiceFactory ¶
type TransformServiceFactory interface {
Build(config *Config, logger Logger, metrics Metrics) (TransformService, error)
}
Source Files
¶
Click to show internal directories.
Click to hide internal directories.