Documentation
¶
Index ¶
- func CreateBambooWorker(cfg *WorkerConfig, workerFunc bamboo.WorkerFunc) (bamboo.BambooWorker, error)
- func InitLog(env string, cfg *LogConfig) error
- func InitTracerProvider(appName string, traceConfig *TraceConfig) (*sdktrace.TracerProvider, error)
- func LogConfigFunc(ctx context.Context, headers map[string]string) context.Context
- type BambooPrameter
- type ConsumerConfig
- type JaegerConfig
- type KafkaConsumerConfig
- type KafkaRequestProducerConfig
- type LogConfig
- type PublisherConfig
- type RedisConsumerConfig
- type RedisPublisherConfig
- type RedisRequestProducerConfig
- type RedisResultSubscriberConfig
- type RequestProducerConfig
- type ResultSubscriberConfig
- type StandardClient
- type TraceConfig
- type WorkerClient
- type WorkerClientConfig
- type WorkerConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateBambooWorker ¶
func CreateBambooWorker(cfg *WorkerConfig, workerFunc bamboo.WorkerFunc) (bamboo.BambooWorker, error)
func InitTracerProvider ¶
func InitTracerProvider(appName string, traceConfig *TraceConfig) (*sdktrace.TracerProvider, error)
Types ¶
type BambooPrameter ¶
type ConsumerConfig ¶
type ConsumerConfig struct { Type string `yaml:"type" validate:"required"` Kafka *KafkaConsumerConfig `yaml:"kafka"` Redis *RedisConsumerConfig `yaml:"redis"` }
type JaegerConfig ¶
type JaegerConfig struct {
Endpoint string `yaml:"endpoint" validate:"required"`
}
type KafkaConsumerConfig ¶
type PublisherConfig ¶
type PublisherConfig struct { Type string `yaml:"type" validate:"required"` Redis *RedisPublisherConfig `yaml:"redis"` }
type RedisConsumerConfig ¶
type RedisPublisherConfig ¶
type RedisResultSubscriberConfig ¶
type RedisResultSubscriberConfig struct { Addrs []string `yaml:"addrs" validate:"required"` Password string `yaml:"password"` }
result
type RequestProducerConfig ¶
type RequestProducerConfig struct { Type string `yaml:"type" validate:"required"` Kafka *KafkaRequestProducerConfig `yaml:"kafka"` Redis *RedisRequestProducerConfig `yaml:"redis"` }
request
type ResultSubscriberConfig ¶
type ResultSubscriberConfig struct { Type string `yaml:"type" validate:"required"` Redis *RedisResultSubscriberConfig `yaml:"redis"` }
type StandardClient ¶
type StandardClient struct {
Clients map[string]WorkerClient
}
type TraceConfig ¶
type TraceConfig struct { Exporter string `yaml:"exporter" validate:"required"` Jaeger *JaegerConfig `yaml:"jaeger"` }
type WorkerClient ¶
type WorkerClient interface { Produce(ctx context.Context, resultChannel string, heartbeatIntervalSec int, jobTimeoutSec int, headers map[string]string, data []byte) error Subscribe(ctx context.Context, resultChannel string, heartbeatIntervalSec int, jobTimeoutSec int) ([]byte, error) Ping(ctx context.Context) error Close(ctx context.Context) }
func CreateWorkerClient ¶
func CreateWorkerClient(ctx context.Context, workerName string, cfg *WorkerClientConfig, propagator propagation.TextMapPropagator) WorkerClient
func NewWorkerClient ¶
func NewWorkerClient(rp bamboo.BambooRequestProducer, rs bamboo.BambooResultSubscriber) WorkerClient
type WorkerClientConfig ¶
type WorkerClientConfig struct { RequestProducer *RequestProducerConfig `yaml:"requestProducer" validate:"required"` ResultSubscriber *ResultSubscriberConfig `yaml:"resultSubscriber" validate:"required"` }
client
type WorkerConfig ¶
type WorkerConfig struct { Consumer *ConsumerConfig `yaml:"consumer"` Publisher *PublisherConfig `yaml:"publisher"` NumWorkers int `yaml:"numWorkers"` }
worker
Click to show internal directories.
Click to hide internal directories.