data

package
v1.2.4 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2022 License: MIT Imports: 30 Imported by: 0

README

Data

Documentation

Index

Constants

This section is empty.

Variables

Functions

func NewAuthRepo

func NewAuthRepo(data *Data, logger log.Logger) biz.AuthRepo

func NewDB

func NewDB(conf *conf.Data) *gorm.DB

func NewRecovery

func NewRecovery(d *Data) biz.Recovery

func NewRedis

func NewRedis(conf *conf.Data) redis.Cmdable

func NewTransaction

func NewTransaction(d *Data) biz.Transaction

func NewUserRepo

func NewUserRepo(data *Data, logger log.Logger) biz.UserRepo

Types

type AchievementMqPro

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

func NewRocketmqAchievementProducer

func NewRocketmqAchievementProducer(conf *conf.Data) *AchievementMqPro

type AvatarReview

type AvatarReview struct {
	gorm.Model
	Uuid     string `gorm:"index;size:36"`
	JobId    string `gorm:"size:100"`
	Url      string `gorm:"size:1000"`
	Label    string `gorm:"size:100"`
	Result   int32
	Category string `gorm:"size:100"`
	SubLabel string `gorm:"size:100"`
	Score    int32
}

type CodeMqPro

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

func NewRocketmqCodeProducer

func NewRocketmqCodeProducer(conf *conf.Data) *CodeMqPro

type Cos

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

func NewCosClient

func NewCosClient(conf *conf.Data) *Cos

type CoverReview

type CoverReview struct {
	gorm.Model
	Uuid     string `gorm:"index;size:36"`
	JobId    string `gorm:"size:100"`
	Url      string `gorm:"size:1000"`
	Label    string `gorm:"size:100"`
	Result   int32
	Category string `gorm:"size:100"`
	SubLabel string `gorm:"size:100"`
	Score    int32
}

type Data

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

func NewData

func NewData(db *gorm.DB, redisCmd redis.Cmdable, cp *CodeMqPro, es *ElasticSearch, pp *ProfileMqPro, fp *FollowMqPro, pip *PictureMqPro, aq *AchievementMqPro, cos *Cos) (*Data, func(), error)

func (*Data) DB

func (d *Data) DB(ctx context.Context) *gorm.DB

func (*Data) ExecTx

func (d *Data) ExecTx(ctx context.Context, fn func(ctx context.Context) error) error

func (*Data) GroupRecover

func (d *Data) GroupRecover(ctx context.Context, fn func(ctx context.Context) error) func() error

func (*Data) Recover

func (d *Data) Recover(ctx context.Context, fn func(ctx context.Context)) func()

type ElasticSearch

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

func NewElasticsearch

func NewElasticsearch(conf *conf.Data) *ElasticSearch

type Follow

type Follow struct {
	gorm.Model
	Follow   string `gorm:"uniqueIndex:idx_follow;size:36"`
	Followed string `gorm:"uniqueIndex:idx_follow;size:36"`
	Status   int32
}

type FollowMqPro

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

func NewRocketmqFollowProducer

func NewRocketmqFollowProducer(conf *conf.Data) *FollowMqPro

type PictureMqPro

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

func NewRocketmqPictureProducer

func NewRocketmqPictureProducer(conf *conf.Data) *PictureMqPro

type Profile

type Profile struct {
	CreatedAt time.Time
	Updated   int64
	Uuid      string `gorm:"primaryKey;size:36"`
	Username  string `gorm:"uniqueIndex;not null;size:20"`
	Avatar    string `gorm:"size:200"`
	School    string `gorm:"size:50"`
	Company   string `gorm:"size:50"`
	Job       string `gorm:"size:50"`
	Homepage  string `gorm:"size:100"`
	Introduce string `gorm:"size:100"`
}

func (Profile) MarshalEasyJSON added in v1.2.0

func (v Profile) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (Profile) MarshalJSON added in v1.2.0

func (v Profile) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*Profile) UnmarshalEasyJSON added in v1.2.0

func (v *Profile) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*Profile) UnmarshalJSON added in v1.2.0

func (v *Profile) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type ProfileMqPro

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

func NewRocketmqProfileProducer

func NewRocketmqProfileProducer(conf *conf.Data) *ProfileMqPro

type ProfileUpdate

type ProfileUpdate struct {
	Profile
	Status int32 `gorm:"default:1"`
}

type User

type User struct {
	gorm.Model
	Uuid     string `gorm:"uniqueIndex;size:36"`
	Email    string `gorm:"uniqueIndex;size:50"`
	Phone    string `gorm:"uniqueIndex;size:20"`
	Wechat   string `gorm:"uniqueIndex;size:100"`
	Qq       string `gorm:"uniqueIndex;size:100"`
	Weibo    string `gorm:"uniqueIndex;size:100"`
	Github   string `gorm:"uniqueIndex;size:100"`
	Password string `gorm:"size:500"`
}

Jump to

Keyboard shortcuts

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