data

package
v1.6.2 Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2023 License: MIT Imports: 40 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 NewCosServiceClient added in v1.3.0

func NewCosServiceClient(conf *conf.Data) *cos.Client

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 AliCode added in v1.3.0

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

func NewPhoneCodeClient added in v1.3.0

func NewPhoneCodeClient(conf *conf.Data) *AliCode

type AvatarReview

type AvatarReview struct {
	gorm.Model
	Uuid     string `gorm:"index;size:20"`
	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 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:20"`
	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, mp *MqPro, es *ElasticSearch, cos *Cos, cosCli *cos.Client, github *Github, wechat *Wechat, qq *QQ, gitee *Gitee, code *AliCode, mailCli *Mail, logger log.Logger) (*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:20"`
	Followed string `gorm:"uniqueIndex:idx_follow;index;size:20"`
	Status   int32
}

type Gitee added in v1.3.0

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

func NewGitee added in v1.3.0

func NewGitee(conf *conf.Data) *Gitee

type Github added in v1.3.0

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

func NewGithub added in v1.3.0

func NewGithub(conf *conf.Data) *Github

type Mail added in v1.3.0

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

func NewMail added in v1.3.0

func NewMail(conf *conf.Data) *Mail

type MqPro added in v1.3.0

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

func NewRocketmqProducer added in v1.3.0

func NewRocketmqProducer(conf *conf.Data) *MqPro

type Profile

type Profile struct {
	CreatedAt time.Time
	Updated   int64
	Uuid      string `gorm:"primaryKey;size:20"`
	Username  string `gorm:"index;not null;size:100"`
	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"`
	Github    string `gorm:"size:100"`
	Gitee     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 ProfileUpdate

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

type QQ added in v1.3.0

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

func NewQQ added in v1.3.0

func NewQQ(conf *conf.Data) *QQ

type User

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

type Wechat added in v1.3.0

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

func NewWechat added in v1.3.0

func NewWechat(conf *conf.Data) *Wechat

Jump to

Keyboard shortcuts

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