biz

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2024 License: MIT Imports: 17 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 Config

type Config struct {
	Receivers map[string]*api.Receiver
	Templates map[string]string
	sync.RWMutex
}

Config 配置数据

func GetConfigData

func GetConfigData() *Config

GetConfigData 获取配置数据

func (*Config) Bytes

func (l *Config) Bytes() []byte

Bytes json 序列化

func (*Config) Get

func (l *Config) Get() *bo.CacheConfigParams

Get 获取接收人

func (*Config) GetReceivers

func (l *Config) GetReceivers() map[string]*api.Receiver

GetReceivers 获取接收人

func (*Config) GetTemplates

func (l *Config) GetTemplates() map[string]string

GetTemplates 获取模板

func (*Config) Set

func (l *Config) Set(ctx context.Context, cache cache.ICacher, params *bo.CacheConfigParams) error

Set 设置接收人

type ConfigBiz

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

ConfigBiz 配置业务

func NewConfigBiz

func NewConfigBiz(c *rabbitconf.Bootstrap, cacheRepo repo.CacheRepo) *ConfigBiz

NewConfigBiz 创建配置业务

func (*ConfigBiz) CacheConfig

func (b *ConfigBiz) CacheConfig(ctx context.Context, params *bo.CacheConfigParams) error

CacheConfig 缓存配置

func (*ConfigBiz) LoadConfig

func (b *ConfigBiz) LoadConfig(ctx context.Context) error

LoadConfig 加载配置

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 repo.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 MsgBiz

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

MsgBiz 消息业务

func NewMsgBiz

func NewMsgBiz(c *rabbitconf.Bootstrap) *MsgBiz

NewMsgBiz 创建消息业务

func (*MsgBiz) SendMsg

func (b *MsgBiz) SendMsg(ctx context.Context, msg *bo.SendMsgParams) error

SendMsg 发送消息

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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