Documentation
¶
Overview ¶
Package resultlog provides functionality for the TDTP framework.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PipelineResult ¶
type PipelineResult = event.PipelineResult
PipelineResult представляет состояние пайплайна, публикуемое в Redis после завершения выполнения (успешного или с ошибкой).
Redis-ключи:
SET tdtp:pipeline:<name>:state <JSON> EX <ttl> — для GET-запросов оркестратора PUB tdtp:pipeline:<name> — для event-driven маршрутизации
Alias to pkg/resultlog/event.PipelineResult — the struct itself lives in that leaf package (no etl/mercury dependency) so consumers that only need to read this shape don't have to link this package's own etl/mercury/ go-redis dependencies. Existing code referencing resultlog.PipelineResult is unaffected: an alias is the same type, not a copy.
type PublishOptions ¶
type PublishOptions struct {
PackageUUID string // UUID зашифрованного пакета (если encryption: true)
}
PublishOptions содержит дополнительные параметры публикации.
type RedisPublisher ¶
type RedisPublisher struct {
// contains filtered or unexported fields
}
RedisPublisher публикует результат выполнения пайплайна в Redis
func NewRedisPublisher ¶
func NewRedisPublisher(config etl.ResultLogConfig) *RedisPublisher
NewRedisPublisher создает новый Redis publisher на основе конфигурации
func (*RedisPublisher) Close ¶
func (p *RedisPublisher) Close() error
Close закрывает соединение с Redis
func (*RedisPublisher) Publish ¶
func (p *RedisPublisher) Publish(ctx context.Context, pipelineName string, stats etl.ProcessorStats, execErr error, opts ...PublishOptions) error
Publish публикует результат выполнения пайплайна:
- SET tdtp:pipeline:<name>:state <JSON> EX <ttl> → для опроса (polling)
- PUBLISH tdtp:pipeline:<name> <JSON> → для подписки (pub/sub)
Graceful degradation: если Redis недоступен — логирует предупреждение и возвращает nil. Pipeline не должен падать из-за недоступности resultlog. execErr == nil означает успешное выполнение.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package event holds the wire shape tdtpcli publishes after a pipeline run (see pkg/resultlog), kept in its own leaf package deliberately: it has no dependency on pkg/etl or pkg/mercury.
|
Package event holds the wire shape tdtpcli publishes after a pipeline run (see pkg/resultlog), kept in its own leaf package deliberately: it has no dependency on pkg/etl or pkg/mercury. |