helper

package
v0.0.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 9, 2023 License: MIT Imports: 20 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitLog

func InitLog(appName bamboo.ContextKey, cfg *LogConfig) error

func InitTracerProvider

func InitTracerProvider(appName string, traceConfig *TraceConfig) (*sdktrace.TracerProvider, error)

func LogConfigFunc

func LogConfigFunc(ctx context.Context, headers map[string]string) context.Context

func SignalWatchProcess added in v0.0.2

func SignalWatchProcess(ctx context.Context) error

Types

type BambooFactory added in v0.0.2

type BambooFactory interface {
	CreateBambooWorkerClient(ctx context.Context, workerName string, cfg *WorkerClientConfig) (bamboo.BambooWorkerClient, error)
	CreateBambooWorker(cfg *WorkerConfig, workerFunc bamboo.WorkerFunc) (bamboo.BambooWorker, error)
}

func NewBambooFactory added in v0.0.2

func NewBambooFactory() BambooFactory

type ConsumerConfig

type ConsumerConfig struct {
	Type      string                   `yaml:"type" validate:"required"`
	Kafka     *KafkaConsumerConfig     `yaml:"kafka"`
	Redis     *RedisConsumerConfig     `yaml:"redis"`
	Goroutine *GoroutineConsumerConfig `yaml:"goroutine"`
}

type GoroutineConsumerConfig added in v0.0.2

type GoroutineConsumerConfig struct {
	Channel string `yaml:"channel" validate:"required"`
}

type GoroutineRequestProducerConfig added in v0.0.2

type GoroutineRequestProducerConfig struct {
	Channel string `yaml:"channel" validate:"required"`
}

type JaegerConfig

type JaegerConfig struct {
	Endpoint string `yaml:"endpoint" validate:"required"`
}

type KafkaConsumerConfig

type KafkaConsumerConfig struct {
	Brokers  []string `yaml:"brokers" validate:"required"`
	GroupID  string   `yaml:"groupId" validate:"required"`
	Topic    string   `yaml:"topic" validate:"required"`
	MaxBytes int      `yaml:"maxBytes" validate:"required"`
}

type KafkaRequestProducerConfig

type KafkaRequestProducerConfig struct {
	Addr  string `yaml:"addr" validate:"required"`
	Topic string `yaml:"topic" validate:"required"`
}

type LogConfig

type LogConfig struct {
	Level string `yaml:"level"`
}

type PublisherConfig

type PublisherConfig struct {
	Type  string                `yaml:"type" validate:"required"`
	Redis *RedisPublisherConfig `yaml:"redis"`
}

type RedisConsumerConfig

type RedisConsumerConfig struct {
	Addrs                  []string `yaml:"addrs" validate:"required"`
	Password               string   `yaml:"password"`
	Channel                string   `yaml:"channel" validate:"required"`
	RequestWaitTimeoutMSec int      `yaml:"requestWaitTimeoutMSec" validate:"required"`
}

type RedisPublisherConfig

type RedisPublisherConfig struct {
	Addrs    []string `yaml:"addrs" validate:"required"`
	Password string   `yaml:"password"`
}

type RedisRequestProducerConfig

type RedisRequestProducerConfig struct {
	Addrs    []string `yaml:"addrs" validate:"required"`
	Password string   `yaml:"password"`
	Channel  string   `yaml:"channel" validate:"required"`
}

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"`
	Goroutine *GoroutineRequestProducerConfig `yaml:"goroutine"`
}

request

type ResultSubscriberConfig

type ResultSubscriberConfig struct {
	Type  string                       `yaml:"type" validate:"required"`
	Redis *RedisResultSubscriberConfig `yaml:"redis"`
}

type TraceConfig

type TraceConfig struct {
	Exporter string        `yaml:"exporter" validate:"required"`
	Jaeger   *JaegerConfig `yaml:"jaeger"`
}

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL