Documentation ¶
Index ¶
- Constants
- Variables
- func CreateCacheByTran(ctx context.Context, cache *redis.Client, vl []uint32, userId uint32) error
- func InitDB(db *gorm.DB)
- func NewFavoriteRepo(data *Data, publishConn publishv1.PublishServiceClient, logger log.Logger) biz.FavoriteRepo
- func NewMysqlConn(c *conf.Data, l log.Logger) *gorm.DB
- func NewPublishRepo(conn pb.PublishServiceClient) biz.PublishRepo
- func NewRedisConn(c *conf.Data, l log.Logger) (cacheClient *redis.Client)
- type Data
- type Favorite
- type KfkWriter
Constants ¶
View Source
const ( OccupyKey = "-1" OccupyValue = "" )
Variables ¶
View Source
var ( ErrCopy = errors.New("copy error") ErrRedisSet = errors.New("redis set error") ErrRedisQuery = errors.New("redis query error") ErrMysqlDelete = errors.New("mysql delete error") ErrMysqlInsert = errors.New("mysql insert error") ErrMysqlQuery = errors.New("mysql query error") ErrRedisDelete = errors.New("redis delete error") ErrRedisTransaction = errors.New("redis transaction error") ErrStrconvParse = errors.New("strconv parse error") ErrExistFavorite = errors.New("exist favorite relation") ErrPublishServiceResponse = errors.New("publish service response error") ErrNotExistFavorite = errors.New("not exist favorite relation") )
View Source
var ProviderSet = wire.NewSet(NewData, NewKafkaWriter, NewFavoriteRepo, NewPublishRepo, NewMysqlConn, NewRedisConn)
Functions ¶
func CreateCacheByTran ¶
CreateCacheByTran 缓存创建事务
func NewFavoriteRepo ¶
func NewFavoriteRepo( data *Data, publishConn publishv1.PublishServiceClient, logger log.Logger, ) biz.FavoriteRepo
func NewPublishRepo ¶
func NewPublishRepo(conn pb.PublishServiceClient) biz.PublishRepo
Types ¶
Click to show internal directories.
Click to hide internal directories.