Documentation
¶
Index ¶
- func ApplyMigrations(t *testing.T, migrateDirPath, scriptBefore string)
- func Cleanup()
- func EnvDebugHandler(prefix string) http.HandlerFunc
- func JoinHostFromRandomPort(urlPath, env string) string
- func RandomPortEnv() string
- func SetEnv(content []byte) error
- func SqlExecFromFile(t *testing.T, conn *sql.DB, scriptSql string)
- func Unmarshal(t *testing.T, data []byte, source any)
- type Config
- type DbClient
- type DbConfig
- type ElasticSearchClient
- type ElasticSearchHelper
- type ElasticSearchService
- type HTTPHelper
- type HandlerCollection
- type Helper
- type KafkaClient
- type KafkaHelper
- type KafkaService
- type MinioClient
- type MinioConfig
- type MinioHelper
- type MinioService
- type Option
- type PostgresHelper
- type PostgresService
- type RedisClient
- type RedisHelper
- type RedisService
- type WebClient
- type WebServer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ApplyMigrations ¶
func EnvDebugHandler ¶
func EnvDebugHandler(prefix string) http.HandlerFunc
func JoinHostFromRandomPort ¶
func RandomPortEnv ¶
func RandomPortEnv() string
Types ¶
type Config ¶
type Config struct {
// contains filtered or unexported fields
}
func (Config) ElasticSearchAddress ¶
func (Config) KafkaBrokers ¶
func (Config) MinioConfig ¶ added in v2.0.2
func (c Config) MinioConfig() MinioConfig
type ElasticSearchClient ¶
type ElasticSearchHelper ¶
type ElasticSearchHelper struct {
// contains filtered or unexported fields
}
func ElasticSearch ¶
func ElasticSearch() *ElasticSearchHelper
func (*ElasticSearchHelper) Client ¶
func (h *ElasticSearchHelper) Client(t *testing.T) ElasticSearchClient
type ElasticSearchService ¶
type ElasticSearchService struct {
// contains filtered or unexported fields
}
func NewElasticSearchService ¶
func NewElasticSearchService(opts ...tc.ContainerCustomizer) *ElasticSearchService
func (*ElasticSearchService) WithHelper ¶
func (e *ElasticSearchService) WithHelper(h *Helper) error
type HTTPHelper ¶
type HTTPHelper struct {
// contains filtered or unexported fields
}
func HTTP ¶
func HTTP() *HTTPHelper
func (*HTTPHelper) ServerMain ¶
func (h *HTTPHelper) ServerMain(m *testing.M, envs ...string) WebServer
type HandlerCollection ¶ added in v2.0.4
type HandlerCollection struct {
// contains filtered or unexported fields
}
func NewHandlerCollection ¶ added in v2.0.5
func NewHandlerCollection(t *testing.T) *HandlerCollection
func (*HandlerCollection) Handle ¶ added in v2.0.4
func (h *HandlerCollection) Handle(key string) func(w http.ResponseWriter, r *http.Request)
func (*HandlerCollection) Set ¶ added in v2.0.4
func (h *HandlerCollection) Set(key string, fn func(http.ResponseWriter, *http.Request))
type Helper ¶
type Helper struct {
// contains filtered or unexported fields
}
func (*Helper) ElasticSearch ¶
func (h *Helper) ElasticSearch() *ElasticSearchHelper
func (*Helper) HTTP ¶
func (h *Helper) HTTP() *HTTPHelper
func (*Helper) Kafka ¶
func (h *Helper) Kafka() *KafkaHelper
func (*Helper) Minio ¶ added in v2.0.2
func (h *Helper) Minio() *MinioHelper
func (*Helper) Postgres ¶
func (h *Helper) Postgres() *PostgresHelper
func (*Helper) Redis ¶ added in v2.0.2
func (h *Helper) Redis() *RedisHelper
type KafkaClient ¶
type KafkaClient interface {
Consume(ctx context.Context, timeout time.Duration, topic string) *sarama.ConsumerMessage
Produce(topic string, value []byte, h ...sarama.RecordHeader)
ProduceWithKey(topic string, key []byte, data []byte, headers ...sarama.RecordHeader)
CreateTopic(name string, detail *sarama.TopicDetail, validateOnly bool)
}
func NewKafkaClient ¶
func NewKafkaClient(t *testing.T) KafkaClient
type KafkaHelper ¶
type KafkaHelper struct {
// contains filtered or unexported fields
}
func Kafka ¶
func Kafka() *KafkaHelper
func (*KafkaHelper) Client ¶
func (h *KafkaHelper) Client(t *testing.T) KafkaClient
type KafkaService ¶
type KafkaService struct {
// contains filtered or unexported fields
}
func NewKafkaService ¶
func NewKafkaService(image string, opts ...tc.ContainerCustomizer) *KafkaService
func (*KafkaService) WithHelper ¶
func (k *KafkaService) WithHelper(h *Helper) error
type MinioClient ¶ added in v2.0.2
type MinioConfig ¶ added in v2.0.2
type MinioHelper ¶ added in v2.0.2
type MinioHelper struct {
// contains filtered or unexported fields
}
func Minio ¶ added in v2.0.2
func Minio() *MinioHelper
func (*MinioHelper) Client ¶ added in v2.0.2
func (h *MinioHelper) Client(t *testing.T) MinioClient
type MinioService ¶ added in v2.0.2
type MinioService struct {
// contains filtered or unexported fields
}
func NewMinioService ¶ added in v2.0.2
func NewMinioService(image string, opts ...tc.ContainerCustomizer) *MinioService
func (*MinioService) WithHelper ¶ added in v2.0.2
func (k *MinioService) WithHelper(h *Helper) error
type PostgresHelper ¶
type PostgresHelper struct {
// contains filtered or unexported fields
}
func Postgres ¶
func Postgres() *PostgresHelper
type PostgresService ¶
type PostgresService struct {
// contains filtered or unexported fields
}
func NewPostgresService ¶
func NewPostgresService(image string, opts ...tc.ContainerCustomizer) *PostgresService
func (*PostgresService) WithHelper ¶
func (p *PostgresService) WithHelper(h *Helper) error
type RedisClient ¶
type RedisClient interface {
Client() redis.UniversalClient
}
type RedisHelper ¶
type RedisHelper struct {
// contains filtered or unexported fields
}
func Redis ¶ added in v2.0.2
func Redis() *RedisHelper
func (*RedisHelper) Client ¶
func (h *RedisHelper) Client(t *testing.T) RedisClient
type RedisService ¶
type RedisService struct {
// contains filtered or unexported fields
}
func NewRedisService ¶
func NewRedisService(image string, opts ...tc.ContainerCustomizer) *RedisService
func (*RedisService) WithHelper ¶
func (k *RedisService) WithHelper(h *Helper) error
type WebServer ¶
type WebServer interface {
HandleFunc(pattern string, handler http.HandlerFunc)
Addr() string
Cleanup()
// NewDebugHandler - инструмент дебага с безопасной остановкой
// пример - next := srv.NewDebugHandler(steron.EnvDebugHandler("env_prefix_")); next()
NewDebugHandler(handlerFunc http.HandlerFunc) func(...string)
}
Source Files
¶
Click to show internal directories.
Click to hide internal directories.