Documentation
¶
Index ¶
- Variables
- func NewLogRepo(data *Data, logger log.Logger) biz.LogRepo
- func NewMysqlCmd(conf *conf.Bootstrap, logger log.Logger) *gorm.DB
- func NewRedisClient(conf *conf.Data) *redis.Client
- func NewRedisCmd(conf *conf.Data, logger log.Logger) redis.Cmdable
- type Data
- type LogEntity
- type LogRepo
- func (r LogRepo) CreateLog(ctx context.Context, domain *domain.Log) error
- func (r LogRepo) GetLogCount(ctx context.Context, params map[string]interface{}) (count int64, err error)
- func (r LogRepo) ListLog(ctx context.Context, page, pageSize int64, params map[string]interface{}) ([]*domain.Log, error)
Constants ¶
This section is empty.
Variables ¶
View Source
var ProviderSet = wire.NewSet( NewData, NewRedisCmd, NewMysqlCmd, NewRedisClient, NewLogRepo, )
ProviderSet is data providers.
Functions ¶
Types ¶
type LogEntity ¶
type LogEntity struct {
Id int64 `gorm:"primarykey;type:int;comment:主键id"`
Name string `gorm:"type:varchar(255);comment:名称"`
Domain string `gorm:"type:varchar(255);comment:域"`
TraceId string `gorm:"type:varchar(255);comment:trace id"`
Component string `gorm:"type:varchar(255);comment:请求http/tpc"`
UserId string `gorm:"type:varchar(255);comment:用户Id"`
Username string `gorm:"type:varchar(255);comment:用户名"`
Role string `gorm:"type:varchar(255);comment:角色"`
Method string `gorm:"type:varchar(255);comment:请求方式"`
Operation string `gorm:"type:varchar(255);comment:kratos操作"`
Path string `gorm:"type:varchar(255);comment:请求path"`
Request string `gorm:"type:text;comment:请求参数"`
Code string `gorm:"type:varchar(255);comment:返回code"`
Reason string `gorm:"type:varchar(255);comment:返回reason"`
IP string `gorm:"type:varchar(255);comment:IP"`
Latency string `gorm:"type:varchar(255);comment:响应时长"`
CreatedAt time.Time `gorm:"column:created_at;not null;comment:创建时间"`
}
Click to show internal directories.
Click to hide internal directories.