Documentation ¶
Index ¶
- Constants
- Variables
- func CreateCacheByTran(ctx context.Context, cache *redis.Client, ul []uint32, userId uint32) error
- func InitDB(db *gorm.DB)
- func NewMysqlConn(c *conf.Data, l log.Logger) *gorm.DB
- func NewRelationRepo(data *Data, userConn userv1.UserServiceClient, logger log.Logger) biz.RelationRepo
- type CacheClient
- type Data
- type Followers
- type KfkWriter
- type UserRepo
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") ErrUserServiceResponse = errors.New("user service response error") )
View Source
var ( ErrFollowYourself = errors.New("can't follow yourself") ErrExistRelation = errors.New("exist relation") ErrNotExistRelation = errors.New("not exist relation") )
View Source
var ProviderSet = wire.NewSet(NewData, NewKafkaWriter, NewRelationRepo, NewUserRepo, NewMysqlConn, NewRedisConn)
Functions ¶
func CreateCacheByTran ¶
CreateCacheByTran 缓存创建事务
func NewRelationRepo ¶
func NewRelationRepo(data *Data, userConn userv1.UserServiceClient, logger log.Logger) biz.RelationRepo
Types ¶
type CacheClient ¶
type CacheClient struct {
// contains filtered or unexported fields
}
CacheClient relation 服务的 Redis 缓存客户端
func NewRedisConn ¶
func NewRedisConn(c *conf.Data, l log.Logger) (cache *CacheClient)
NewRedisConn Redis数据库连接
type Followers ¶
Click to show internal directories.
Click to hide internal directories.