biz

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2024 License: MIT Imports: 9 Imported by: 0

README

Biz

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrUserNotFound is user not found.
	ErrUserNotFound = errors.NotFound(v1.ErrorReason_USER_NOT_FOUND.String(), "user not found")
)

ProviderSetBiz is biz providers.

Functions

This section is empty.

Types

type AlertBiz

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

AlertBiz .

func NewAlertBiz

func NewAlertBiz(alertRepository repository.Alert) *AlertBiz

NewAlertBiz new AlertBiz

func (*AlertBiz) PushAlarm

func (a *AlertBiz) PushAlarm(ctx context.Context, alarm *bo.Alarm) error

PushAlarm 告警推送

func (*AlertBiz) SaveAlarm

func (a *AlertBiz) SaveAlarm(ctx context.Context, alarm *bo.Alarm) error

SaveAlarm 保存告警数据

type Greeter

type Greeter struct {
	Hello string
}

Greeter is a Greeter model.

type GreeterRepo

type GreeterRepo interface {
	Save(context.Context, *Greeter) (*Greeter, error)
	Update(context.Context, *Greeter) (*Greeter, error)
	FindByID(context.Context, int64) (*Greeter, error)
	ListByHello(context.Context, string) ([]*Greeter, error)
	ListAll(context.Context) ([]*Greeter, error)
}

GreeterRepo is a Greater repo.

type GreeterUsecase

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

GreeterUsecase is a Greeter usecase.

func NewGreeterUsecase

func NewGreeterUsecase(repo GreeterRepo, cacheRepo repository.CacheRepo) *GreeterUsecase

NewGreeterUsecase new a Greeter usecase.

func (*GreeterUsecase) CreateGreeter

func (uc *GreeterUsecase) CreateGreeter(ctx context.Context, g *Greeter) (*Greeter, error)

CreateGreeter creates a Greeter, and returns the new Greeter.

type MetricBiz

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

MetricBiz .

func NewMetricBiz

func NewMetricBiz(metricRepository repository.Metric) *MetricBiz

NewMetricBiz new MetricBiz

func (*MetricBiz) PushMetric

func (b *MetricBiz) PushMetric(req *bo.PushMetricParams) error

PushMetric 推送数据

func (*MetricBiz) Query

Query 查询数据

func (*MetricBiz) SyncMetrics

func (b *MetricBiz) SyncMetrics(ctx context.Context, datasourceInfo *bo.GetMetricsParams) ([]*bo.MetricDetail, error)

SyncMetrics 同步数据源元数据

type StrategyBiz

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

StrategyBiz .

func NewStrategyBiz

func NewStrategyBiz(strategyRepository repository.Strategy) *StrategyBiz

NewStrategyBiz new StrategyBiz

func (*StrategyBiz) Eval

func (s *StrategyBiz) Eval(ctx context.Context, strategy *bo.Strategy) (*bo.Alarm, error)

Eval 根据策略信息产生告警数据

func (*StrategyBiz) SaveStrategy

func (s *StrategyBiz) SaveStrategy(ctx context.Context, strategy []*bo.Strategy) error

SaveStrategy 保存策略信息

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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