data

package
v1.2.2 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	LOG                       = log.NewHelper(log.With(log.GetLogger(), "source", "accesslog"))
	ErrMissingJwtToken        = errors.Unauthorized("TOKEN_MISSING", "JWT token is missing")
	ErrTokenInvalid           = errors.Unauthorized("TOKEN_INVALID", "Token is invalid")
	ErrTokenExpired           = errors.Unauthorized("TOKEN_EXPIRED", "JWT token has expired")
	ErrTokenParseFail         = errors.Unauthorized("TOKEN_PARSE_FAIL", "Fail to parse JWT token ")
	ErrUnSupportSigningMethod = errors.Unauthorized("UN_SUPPORT_SIGNING_METHOD", "Wrong signing method")
)

Functions

func NewAchievementRepo

func NewAchievementRepo(data *Data, logger log.Logger) biz.AchievementRepo

func NewAchievementServiceClient

func NewAchievementServiceClient(r *nacos.Registry) achievementv1.AchievementClient

func NewCommentRepo

func NewCommentRepo(data *Data, logger log.Logger) biz.CommentRepo

func NewCommentServiceClient

func NewCommentServiceClient(r *nacos.Registry) commentv1.CommentClient

func NewCreationRepo

func NewCreationRepo(data *Data, logger log.Logger) biz.CreationRepo

func NewCreationServiceClient

func NewCreationServiceClient(r *nacos.Registry) creationv1.CreationClient

func NewDB

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

func NewJwt

func NewJwt(d *Data) biz.Jwt

func NewMessageRepo

func NewMessageRepo(data *Data, logger log.Logger) biz.MessageRepo

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

func NewUserServiceClient

func NewUserServiceClient(r *nacos.Registry) userv1.UserClient

Types

type CosComment

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

func NewCosCommentClient

func NewCosCommentClient(conf *conf.Data) *CosComment

type CosCreation

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

func NewCosCreationClient

func NewCosCreationClient(conf *conf.Data) *CosCreation

type CosUser

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

func NewCosUserClient

func NewCosUserClient(conf *conf.Data) *CosUser

type Data

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

func NewData

func NewData(db *gorm.DB, redisCmd redis.Cmdable, uc userv1.UserClient, cc creationv1.CreationClient, commc commentv1.CommentClient, ac achievementv1.AchievementClient, jwt Jwt, cosUser *CosUser, cosCreation *CosCreation, cosComment *CosComment, phoneCodeCli *TxCode, goMailCli *GoMail) (*Data, func(), error)

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) JwtCheck

func (d *Data) JwtCheck(jwtToken string) (string, error)

func (*Data) Recover

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

type GoMail

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

func NewGoMail

func NewGoMail(conf *conf.Data) *GoMail

type Jwt

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

func NewJwtClient

func NewJwtClient(conf *conf.Data) Jwt

type SystemNotification

type SystemNotification struct {
	gorm.Model
	ContentId        int32
	NotificationType string
	Title            string `gorm:"size:100"`
	Uid              string
	Uuid             string `gorm:"index;size:36"`
	Label            string `gorm:"size:100"`
	Result           int32
	Section          string
	Text             string
	Comment          string `gorm:"size:100"`
}

type TxCode

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

func NewPhoneCode

func NewPhoneCode(conf *conf.Data) *TxCode

Jump to

Keyboard shortcuts

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