data

package
v0.0.0-...-b9c99d5 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2025 License: MIT Imports: 68 Imported by: 0

README

Data

Documentation

Index

Constants

This section is empty.

Variables

ProviderSet is data providers.

Functions

func NewBusRepo

func NewBusRepo(logger log.Logger, db *ent.Client, rc redis.Cmdable) biz.BusRepo

func NewConfig

func NewConfig(ai *conf.AppInfo) (config.Config, func(), error)

func NewConfigBootstrap

func NewConfigBootstrap(c config.Config) (*conf.Bootstrap, error)

func NewEntClient

func NewEntClient(
	conf *conf.Bootstrap, m *Metric, l log.Logger,
) (*ent.Client, func(), error)

func NewEventRepo

func NewEventRepo(
	logger log.Logger, db *ent.Client, sender Sender, m *Metric, rc redis.Cmdable, sc *cache.Cache,
) biz.EventRepo

func NewLogger

func NewLogger(ai *conf.AppInfo, cfg *conf.Bootstrap) (log.Logger, func(), error)

func NewRedisCmd

func NewRedisCmd(
	conf *conf.Bootstrap, m *Metric, l log.Logger,
) (redis.Cmdable, func(), error)

func NewReflector

func NewReflector(
	logger log.Logger,
	db *ent.Client,
) (informer.Reflector, error)

func NewRegistrar

func NewRegistrar(_ *conf.Bootstrap) (registry.Registrar, error)

func NewRuleRepo

func NewRuleRepo(logger log.Logger, db *ent.Client) biz.RuleRepo

func NewSchemaLocalCache

func NewSchemaLocalCache() *cache.Cache

func NewTracerProvider

func NewTracerProvider(
	ai *conf.AppInfo, conf *conf.Bootstrap, l log.Logger,
) (trace.TracerProvider, func(), error)

func SetCacheSchema

func SetCacheSchema(ctx context.Context, rc redis.Cmdable, source string, sType string, val *ent.EventSchema) error

SetCacheSchema to redis cache

Types

type MQProducer

type MQProducer interface {
	Send(
		ctx context.Context, topic string, mode v1.BusWorkMode, eventExt *rule.EventExt, pubTime *timestamppb.Timestamp,
	) (string, error)
	io.Closer
}

func NewRocketMQProducer

func NewRocketMQProducer(endpoints, topic string) (MQProducer, error)

type Metric

type Metric struct {
	CacheHits            metric.Int64Counter
	CacheMisses          metric.Int64Counter
	CacheDurationSec     metric.Float64Histogram
	CodeTotal            metric.Int64Counter
	DurationSec          metric.Float64Histogram
	DbDurationSec        metric.Float64Histogram
	PostEventCount       metric.Int64Counter
	PostEventDurationSec metric.Float64Histogram
}

func NewMetric

func NewMetric(ai *conf.AppInfo) (*Metric, error)

type RedisMetricHook

type RedisMetricHook struct {
	// contains filtered or unexported fields
}

func NewRedisMetricHook

func NewRedisMetricHook(opts ...RedisMetricsOption) *RedisMetricHook

func (*RedisMetricHook) DialHook

func (rmh *RedisMetricHook) DialHook(next redis.DialHook) redis.DialHook

func (*RedisMetricHook) ProcessHook

func (rmh *RedisMetricHook) ProcessHook(next redis.ProcessHook) redis.ProcessHook

func (*RedisMetricHook) ProcessPipelineHook

func (rmh *RedisMetricHook) ProcessPipelineHook(next redis.ProcessPipelineHook) redis.ProcessPipelineHook

type RedisMetricsOption

type RedisMetricsOption func(*redisMetricsOptions)

RedisMetricsOption is a metrics option.

func WithRedisEndpointAddr

func WithRedisEndpointAddr(addrs ...string) RedisMetricsOption

WithRedisEndpointAddr with db Addr.

func WithRedisRequestsDuration

func WithRedisRequestsDuration(c metric.Float64Histogram) RedisMetricsOption

WithRedisRequestsDuration with requests duration(s).

type Sender

type Sender interface {
	Send(ctx context.Context, busName string, eventExt *rule.EventExt, pubTime *timestamppb.Timestamp) (string, error)
}

func NewSender

func NewSender(
	logger log.Logger,
	reflector informer.Reflector,
) (Sender, func(), error)

Directories

Path Synopsis
ent