Documentation
¶
Index ¶
- Constants
- func GetDefaultAwsSdkConfig() (aws.Config, error)
- func GetDefaultStaticCredentials() credentials.StaticCredentialsProvider
- func UnmarshalSettings(config cfg.Config, settings any, typ string, name string) error
- type AutoDetectSettings
- type ChannelRecords
- type Component
- type ComponentAddressAware
- type ComponentBaseSettings
- type ComponentBaseSettingsAware
- type ComponentCfgOptionAware
- type ComponentContainerDescription
- type ComponentContainerDescriptions
- type ComponentContainerSettings
- type ComponentHealthCheck
- type ComponentOption
- type ComponentShutdownCallback
- type ComponentsConfigManager
- func (m *ComponentsConfigManager) Add(settings any) error
- func (m *ComponentsConfigManager) GetAllSettings() ([]ComponentBaseSettingsAware, error)
- func (m *ComponentsConfigManager) Has(typ string, name string) (bool, error)
- func (m *ComponentsConfigManager) HasType(typ string) (bool, error)
- func (m *ComponentsConfigManager) List() (map[string]map[string]any, error)
- func (m *ComponentsConfigManager) ShouldAutoDetect(typ string) bool
- type ComponentsContainer
- type ConfigOption
- type Container
- type ContainerBinding
- type ContainerBindingSettings
- type ContainerConfig
- type ContainerImageSettings
- type ContainerManager
- type ContainerManagerSettings
- type ContainerRefreshInput
- type ContainerRequest
- type ContainerRunner
- func NewContainerRunnerExternal(_ cfg.Config, logger log.Logger, _ *ContainerManagerSettings) (ContainerRunner, error)
- func NewContainerRunnerLocal(config cfg.Config, logger log.Logger, ...) (ContainerRunner, error)
- func NewContainerRunnerRemote(config cfg.Config, logger log.Logger, ...) (ContainerRunner, error)
- type ContainerRunnerLocalSettings
- type ContainerRunnerRemoteHttpClientSettings
- type ContainerRunnerRemoteSettings
- type ContainerSpec
- type ContainerStartInput
- type ContainerStopInput
- type Environment
- func (e *Environment) Clock() clock.Clock
- func (e *Environment) Component(typ string, name string) Component
- func (e *Environment) Config() cfg.GosoConf
- func (e *Environment) Context() context.Context
- func (e *Environment) Filesystem() *filesystem
- func (e *Environment) Kafka(name string) *KafkaComponent
- func (e *Environment) LifeCyleCreate() error
- func (e *Environment) LoadFixtureSet(factory fixtures.FixtureSetsFactory, ...) error
- func (e *Environment) LoadFixtureSets(factories []fixtures.FixtureSetsFactory, ...) error
- func (e *Environment) Localstack(name string) *localstackComponent
- func (e *Environment) Logger() log.GosoLogger
- func (e *Environment) Logs() LogRecords
- func (e *Environment) Mailpit(name string) *mailpitComponent
- func (e *Environment) MySql(name string) *mysqlComponent
- func (e *Environment) Redis(name string) *RedisComponent
- func (e *Environment) ResetLogs()
- func (e *Environment) Stop() error
- func (e *Environment) StreamInput(name string) *StreamInputComponent
- func (e *Environment) StreamOutput(name string) *streamOutputComponent
- func (e *Environment) Wiremock(name string) *wiremockComponent
- type HealthCheckSettings
- type KafkaComponent
- func (c KafkaComponent) AdminClient() admin.Client
- func (c KafkaComponent) BrokerAddress() string
- func (c KafkaComponent) CfgOptions() []cfg.Option
- func (c KafkaComponent) SchemaRegistryAddress() string
- func (c KafkaComponent) SchemaRegistryClient() schemaRegistry.Client
- func (c *KafkaComponent) SetT(t *testing.T)
- type LogRecord
- type LogRecords
- type LoggerOption
- type LoggerSettings
- type Option
- func WithComponent(settings ComponentBaseSettingsAware) Option
- func WithConfigEnvKeyReplacer(replacer *strings.Replacer) Option
- func WithConfigFile(file string) Option
- func WithConfigMap(settings map[string]any) Option
- func WithConfigSetting(key string, settings any) Option
- func WithContainerExpireAfter(expireAfter time.Duration) Option
- func WithLogRecording() Option
- func WithLoggerLevel(level string) Option
- func WithoutAutoDetectedComponents(components ...string) Option
- type PortBinding
- type PortBindings
- type RecordingLogger
- type RedisComponent
- type StreamInputComponent
- func (s *StreamInputComponent) CfgOptions() []cfg.Option
- func (s *StreamInputComponent) Publish(body any, attributes map[string]string)
- func (s *StreamInputComponent) PublishAndStop(body any, attributes map[string]string)
- func (s *StreamInputComponent) PublishFromJsonFile(fileName string)
- func (c *StreamInputComponent) SetT(t *testing.T)
- func (s *StreamInputComponent) Stop()
- type TmpfsSettings
Constants ¶
View Source
const ( DefaultAccessKeyID = "gosoline" DefaultSecretAccessKey = "gosoline" DefaultToken = "" )
View Source
const ( RunnerTypeLocal = "local" RunnerTypeRemote = "remote" )
View Source
const (
ComponentLocalstack = "localstack"
)
View Source
const RunnerTypeExternal = "external"
Variables ¶
This section is empty.
Functions ¶
func GetDefaultAwsSdkConfig ¶
func GetDefaultStaticCredentials ¶
func GetDefaultStaticCredentials() credentials.StaticCredentialsProvider
Types ¶
type AutoDetectSettings ¶
type ChannelRecords ¶ added in v0.26.1
type ChannelRecords []LogRecord
func (ChannelRecords) Filter ¶ added in v0.26.1
func (logs ChannelRecords) Filter(condition func(LogRecord) bool) ChannelRecords
type ComponentAddressAware ¶
type ComponentAddressAware interface {
Address() string
}
type ComponentBaseSettings ¶
type ComponentBaseSettings struct {
Name string `cfg:"name" default:"default"`
Type string `cfg:"type" validate:"required"`
}
func (*ComponentBaseSettings) GetName ¶
func (c *ComponentBaseSettings) GetName() string
func (*ComponentBaseSettings) GetType ¶
func (c *ComponentBaseSettings) GetType() string
func (*ComponentBaseSettings) SetName ¶
func (c *ComponentBaseSettings) SetName(name string)
func (*ComponentBaseSettings) SetType ¶
func (c *ComponentBaseSettings) SetType(typ string)
type ComponentCfgOptionAware ¶
type ComponentContainerDescription ¶ added in v0.52.0
type ComponentContainerDescription struct {
ContainerConfig *ContainerConfig
HealthCheck ComponentHealthCheck
ShutdownCallback ComponentShutdownCallback
}
type ComponentContainerDescriptions ¶ added in v0.52.0
type ComponentContainerDescriptions map[string]*ComponentContainerDescription
type ComponentContainerSettings ¶
type ComponentContainerSettings struct {
Image ContainerImageSettings `cfg:"image"`
Tmpfs []TmpfsSettings `cfg:"tmpfs"`
}
type ComponentHealthCheck ¶
type ComponentOption ¶
type ComponentOption func(componentConfigManger *ComponentsConfigManager) error
type ComponentsConfigManager ¶
type ComponentsConfigManager struct {
// contains filtered or unexported fields
}
func NewComponentsConfigManager ¶
func NewComponentsConfigManager(config cfg.GosoConf) (*ComponentsConfigManager, error)
func (*ComponentsConfigManager) Add ¶
func (m *ComponentsConfigManager) Add(settings any) error
func (*ComponentsConfigManager) GetAllSettings ¶
func (m *ComponentsConfigManager) GetAllSettings() ([]ComponentBaseSettingsAware, error)
func (*ComponentsConfigManager) Has ¶
func (m *ComponentsConfigManager) Has(typ string, name string) (bool, error)
func (*ComponentsConfigManager) HasType ¶
func (m *ComponentsConfigManager) HasType(typ string) (bool, error)
func (*ComponentsConfigManager) List ¶
func (m *ComponentsConfigManager) List() (map[string]map[string]any, error)
func (*ComponentsConfigManager) ShouldAutoDetect ¶
func (m *ComponentsConfigManager) ShouldAutoDetect(typ string) bool
type ComponentsContainer ¶
type ComponentsContainer struct {
// contains filtered or unexported fields
}
func NewComponentsContainer ¶
func NewComponentsContainer() *ComponentsContainer
func (*ComponentsContainer) Add ¶
func (c *ComponentsContainer) Add(typ string, name string, component Component)
func (*ComponentsContainer) Get ¶
func (c *ComponentsContainer) Get(componentType string, name string) (Component, error)
func (*ComponentsContainer) GetAll ¶
func (c *ComponentsContainer) GetAll() []Component
func (*ComponentsContainer) GetCfgOptions ¶
func (c *ComponentsContainer) GetCfgOptions() []cfg.Option
type ConfigOption ¶
type Container ¶ added in v0.52.0
type Container struct {
// contains filtered or unexported fields
}
type ContainerBinding ¶ added in v0.52.0
type ContainerBinding struct {
// contains filtered or unexported fields
}
type ContainerConfig ¶ added in v0.52.0
type ContainerConfig struct {
RunnerType string
Hostname string
ExternalHost string // Host address for external containers (used by external runner)
Auth authSettings
Repository string
Tmpfs []TmpfsSettings
Tag string
Env map[string]string
Cmd []string
PortBindings PortBindings
ExposedPorts []string
}
func (ContainerConfig) String ¶ added in v0.52.0
func (c ContainerConfig) String() string
type ContainerImageSettings ¶ added in v0.15.4
type ContainerManager ¶ added in v0.52.0
type ContainerManager interface {
RunContainers(ctx context.Context, skeletons []*componentSkeleton) error
Stop(ctx context.Context) error
}
func NewContainerManager ¶ added in v0.52.0
type ContainerManagerSettings ¶ added in v0.52.0
type ContainerManagerSettings struct {
RunnerType string `cfg:"runner_type" default:"local"`
NamePrefix string `cfg:"name_prefix" default:"goso"`
HealthCheck HealthCheckSettings `cfg:"health_check"`
ExpireAfter time.Duration `cfg:"expire_after" default:"5m"`
}
type ContainerRefreshInput ¶ added in v0.52.0
type ContainerRequest ¶ added in v0.52.0
type ContainerRunner ¶ added in v0.52.0
type ContainerRunner interface {
RunContainer(ctx context.Context, request ContainerRequest) (*Container, error)
Stop(ctx context.Context) error
}
func NewContainerRunnerExternal ¶ added in v0.53.2
func NewContainerRunnerExternal(_ cfg.Config, logger log.Logger, _ *ContainerManagerSettings) (ContainerRunner, error)
NewContainerRunnerExternal creates a runner that connects to external (pre-existing) containers rather than starting new ones. This is useful for CI environments where containers are provided as external services.
func NewContainerRunnerLocal ¶ added in v0.52.0
func NewContainerRunnerLocal(config cfg.Config, logger log.Logger, managerSettings *ContainerManagerSettings) (ContainerRunner, error)
func NewContainerRunnerRemote ¶ added in v0.52.0
func NewContainerRunnerRemote(config cfg.Config, logger log.Logger, managerSettings *ContainerManagerSettings) (ContainerRunner, error)
type ContainerRunnerLocalSettings ¶ added in v0.52.0
type ContainerRunnerLocalSettings struct {
Endpoint string `cfg:"endpoint"`
Auth authSettings `cfg:"auth"`
}
type ContainerRunnerRemoteHttpClientSettings ¶ added in v0.52.0
type ContainerRunnerRemoteSettings ¶ added in v0.52.0
type ContainerRunnerRemoteSettings struct {
Endpoint string `cfg:"endpoint" default:"http://localhost:8890"`
PoolId string `cfg:"pool_id"`
HttpClient ContainerRunnerRemoteHttpClientSettings `cfg:"http_client"`
}
type ContainerSpec ¶ added in v0.52.0
type ContainerStartInput ¶ added in v0.52.0
type ContainerStartInput struct {
PoolId string `json:"pool_id"`
TestId string `json:"test_id"`
TestName string `json:"test_name"`
ComponentType string `json:"component_type"`
ComponentName string `json:"component_name"`
ContainerName string `json:"container_name"`
Spec ContainerSpec `json:"spec"`
ExpireAfter time.Duration `json:"expire_after"`
}
type ContainerStopInput ¶ added in v0.52.0
type Environment ¶
type Environment struct {
// contains filtered or unexported fields
}
func NewEnvironment ¶
func NewEnvironment(t *testing.T, options ...Option) (*Environment, error)
func (*Environment) Clock ¶
func (e *Environment) Clock() clock.Clock
func (*Environment) Config ¶
func (e *Environment) Config() cfg.GosoConf
func (*Environment) Context ¶
func (e *Environment) Context() context.Context
func (*Environment) Filesystem ¶
func (e *Environment) Filesystem() *filesystem
func (*Environment) Kafka ¶ added in v0.51.0
func (e *Environment) Kafka(name string) *KafkaComponent
func (*Environment) LifeCyleCreate ¶ added in v0.37.0
func (e *Environment) LifeCyleCreate() error
func (*Environment) LoadFixtureSet ¶ added in v0.36.0
func (e *Environment) LoadFixtureSet(factory fixtures.FixtureSetsFactory, postProcessorFactories ...fixtures.PostProcessorFactory) error
func (*Environment) LoadFixtureSets ¶ added in v0.24.0
func (e *Environment) LoadFixtureSets(factories []fixtures.FixtureSetsFactory, postProcessorFactories ...fixtures.PostProcessorFactory) error
func (*Environment) Localstack ¶
func (e *Environment) Localstack(name string) *localstackComponent
func (*Environment) Logger ¶
func (e *Environment) Logger() log.GosoLogger
func (*Environment) Logs ¶ added in v0.18.1
func (e *Environment) Logs() LogRecords
func (*Environment) Mailpit ¶ added in v0.40.7
func (e *Environment) Mailpit(name string) *mailpitComponent
func (*Environment) MySql ¶
func (e *Environment) MySql(name string) *mysqlComponent
func (*Environment) Redis ¶
func (e *Environment) Redis(name string) *RedisComponent
func (*Environment) ResetLogs ¶ added in v0.21.4
func (e *Environment) ResetLogs()
func (*Environment) Stop ¶
func (e *Environment) Stop() error
func (*Environment) StreamInput ¶
func (e *Environment) StreamInput(name string) *StreamInputComponent
func (*Environment) StreamOutput ¶
func (e *Environment) StreamOutput(name string) *streamOutputComponent
func (*Environment) Wiremock ¶
func (e *Environment) Wiremock(name string) *wiremockComponent
type HealthCheckSettings ¶ added in v0.52.0
type KafkaComponent ¶ added in v0.51.0
type KafkaComponent struct {
// contains filtered or unexported fields
}
func (KafkaComponent) AdminClient ¶ added in v0.51.0
func (c KafkaComponent) AdminClient() admin.Client
func (KafkaComponent) BrokerAddress ¶ added in v0.51.0
func (c KafkaComponent) BrokerAddress() string
func (KafkaComponent) CfgOptions ¶ added in v0.51.0
func (c KafkaComponent) CfgOptions() []cfg.Option
func (KafkaComponent) SchemaRegistryAddress ¶ added in v0.51.0
func (c KafkaComponent) SchemaRegistryAddress() string
func (KafkaComponent) SchemaRegistryClient ¶ added in v0.51.0
func (c KafkaComponent) SchemaRegistryClient() schemaRegistry.Client
type LogRecords ¶ added in v0.18.1
type LogRecords map[string]ChannelRecords
func (LogRecords) Channel ¶ added in v0.26.1
func (logs LogRecords) Channel(channel string) ChannelRecords
func (LogRecords) Filter ¶ added in v0.18.1
func (logs LogRecords) Filter(condition func(LogRecord) bool) LogRecords
type LoggerOption ¶
type LoggerOption func(settings *LoggerSettings) error
type LoggerSettings ¶
type Option ¶
type Option func(env *Environment)
func WithComponent ¶
func WithComponent(settings ComponentBaseSettingsAware) Option
func WithConfigFile ¶
func WithConfigMap ¶
func WithConfigSetting ¶
func WithLogRecording ¶ added in v0.18.1
func WithLogRecording() Option
func WithLoggerLevel ¶
type PortBinding ¶ added in v0.52.0
type PortBinding struct {
ContainerPort int `json:"container_port"`
HostPort int `json:"host_port"`
Protocol string `json:"protocol"`
}
func (PortBinding) DockerPort ¶ added in v0.52.0
func (b PortBinding) DockerPort() string
type PortBindings ¶ added in v0.52.0
type PortBindings map[string]PortBinding
type RecordingLogger ¶ added in v0.18.1
type RecordingLogger interface {
log.GosoLogger
Records() LogRecords
Reset()
}
func NewRecordingConsoleLogger ¶ added in v0.18.1
func NewRecordingConsoleLogger(t *testing.T, config cfg.Config, options ...LoggerOption) (RecordingLogger, error)
type RedisComponent ¶
type RedisComponent struct {
// contains filtered or unexported fields
}
func (*RedisComponent) Address ¶
func (c *RedisComponent) Address() string
func (*RedisComponent) CfgOptions ¶
func (c *RedisComponent) CfgOptions() []cfg.Option
func (*RedisComponent) Client ¶
func (c *RedisComponent) Client() *redis.Client
type StreamInputComponent ¶
type StreamInputComponent struct {
// contains filtered or unexported fields
}
func (*StreamInputComponent) CfgOptions ¶
func (s *StreamInputComponent) CfgOptions() []cfg.Option
func (*StreamInputComponent) Publish ¶
func (s *StreamInputComponent) Publish(body any, attributes map[string]string)
func (*StreamInputComponent) PublishAndStop ¶
func (s *StreamInputComponent) PublishAndStop(body any, attributes map[string]string)
func (*StreamInputComponent) PublishFromJsonFile ¶
func (s *StreamInputComponent) PublishFromJsonFile(fileName string)
func (*StreamInputComponent) Stop ¶
func (s *StreamInputComponent) Stop()
type TmpfsSettings ¶
Source Files
¶
- aws.go
- component_kafka.go
- component_localstack.go
- component_mailpit.go
- component_mysql.go
- component_redis.go
- component_stream_input.go
- component_stream_output.go
- component_wiremock.go
- components.go
- components_config_manager.go
- components_container.go
- container_manager.go
- container_runner.go
- container_runner_external.go
- container_runner_local.go
- container_runner_remote.go
- environment.go
- environment_options.go
- factory_kafka.go
- factory_localstack.go
- factory_mailpit.go
- factory_mysql.go
- factory_redis.go
- factory_stream_input.go
- factory_stream_output.go
- factory_wiremock.go
- filesystem.go
- logging.go
- toxiproxy.go
Click to show internal directories.
Click to hide internal directories.