Documentation ¶
Index ¶
- Constants
- Variables
- func ErrDryRunModeUnsupported(err error) error
- func ErrEmptySlice(err error) error
- func ErrInvalidDB(err error) error
- func ErrInvalidData(err error) error
- func ErrInvalidField(err error) error
- func ErrInvalidTransaction(err error) error
- func ErrInvalidValue(err error) error
- func ErrInvalidValueOfLength(err error) error
- func ErrMissingWhereClause(err error) error
- func ErrModelValueRequired(err error) error
- func ErrNotImplemented(err error) error
- func ErrPrimaryKeyRequired(err error) error
- func ErrRegistered(err error) error
- func ErrUnsupportedDriver(err error) error
- func ErrUnsupportedRelation(err error) error
- func GormErrRecordNotFound(err error) error
- func IsErrInvalidTransaction(err error) bool
- func IsGormErrRecordNotFound(err error) bool
- func NewGormTracingHook(opts ...tracing.Option) gorm.Plugin
- func WrapGormError(err error) error
- type Conf
- func (*Conf) Descriptor() ([]byte, []int)deprecated
- func (x *Conf) GetDriver() string
- func (x *Conf) GetLogLevel() int32
- func (x *Conf) GetSource() string
- func (*Conf) ProtoMessage()
- func (x *Conf) ProtoReflect() protoreflect.Message
- func (x *Conf) Reset()
- func (x *Conf) String() string
- func (m *Conf) Validate() error
- type ConfValidationError
- type DB
- type DBTextMapCarrier
- type GormTracingHook
- type Logger
- func (l *Logger) Error(ctx context.Context, msg string, data ...interface{})
- func (l *Logger) Info(ctx context.Context, msg string, data ...interface{})
- func (l *Logger) LogMode(level logger.LogLevel) logger.Interface
- func (l *Logger) Trace(ctx context.Context, begin time.Time, fc func() (string, int64), err error)
- func (l *Logger) Warn(ctx context.Context, msg string, data ...interface{})
Constants ¶
const ( Reset = "\033[0m" Red = "\033[31m" Green = "\033[32m" Yellow = "\033[33m" Blue = "\033[34m" Magenta = "\033[35m" Cyan = "\033[36m" White = "\033[37m" BlueBold = "\033[34;1m" MagentaBold = "\033[35;1m" RedBold = "\033[31;1m" YellowBold = "\033[33;1m" )
Colors
Variables ¶
var File_store_gormx_conf_proto protoreflect.FileDescriptor
Functions ¶
func ErrDryRunModeUnsupported ¶
ErrDryRunModeUnsupported dry run mode unsupported
func ErrInvalidTransaction ¶
func ErrInvalidValueOfLength ¶
ErrInvalidValueOfLength invalid values do not match length
func ErrMissingWhereClause ¶
ErrMissingWhereClause missing where clause
func ErrModelValueRequired ¶
ErrModelValueRequired model value required
func ErrPrimaryKeyRequired ¶
ErrPrimaryKeyRequired primary keys required
func ErrUnsupportedDriver ¶
ErrUnsupportedDriver unsupported driver
func ErrUnsupportedRelation ¶
ErrUnsupportedRelation unsupported relations
func GormErrRecordNotFound ¶
GormErrRecordNotFound 找不到记录
func IsErrInvalidTransaction ¶
func IsGormErrRecordNotFound ¶
Types ¶
type Conf ¶
type Conf struct { Driver string `protobuf:"bytes,1,opt,name=driver,proto3" json:"driver,omitempty"` Source string `protobuf:"bytes,2,opt,name=source,proto3" json:"source,omitempty"` LogLevel int32 `protobuf:"varint,3,opt,name=logLevel,proto3" json:"logLevel,omitempty"` // contains filtered or unexported fields }
func (*Conf) Descriptor
deprecated
func (*Conf) GetLogLevel ¶
func (*Conf) ProtoMessage ¶
func (*Conf) ProtoMessage()
func (*Conf) ProtoReflect ¶
func (x *Conf) ProtoReflect() protoreflect.Message
type ConfValidationError ¶
type ConfValidationError struct {
// contains filtered or unexported fields
}
ConfValidationError is the validation error returned by Conf.Validate if the designated constraints aren't met.
func (ConfValidationError) Cause ¶
func (e ConfValidationError) Cause() error
Cause function returns cause value.
func (ConfValidationError) Error ¶
func (e ConfValidationError) Error() string
Error satisfies the builtin error interface
func (ConfValidationError) ErrorName ¶
func (e ConfValidationError) ErrorName() string
ErrorName returns error name.
func (ConfValidationError) Field ¶
func (e ConfValidationError) Field() string
Field function returns field value.
func (ConfValidationError) Key ¶
func (e ConfValidationError) Key() bool
Key function returns key value.
func (ConfValidationError) Reason ¶
func (e ConfValidationError) Reason() string
Reason function returns reason value.
type DBTextMapCarrier ¶
type DBTextMapCarrier struct {
// contains filtered or unexported fields
}
func (*DBTextMapCarrier) Get ¶
func (carrier *DBTextMapCarrier) Get(key string) string
Get returns the value associated with the passed key.
func (*DBTextMapCarrier) Keys ¶
func (carrier *DBTextMapCarrier) Keys() []string
Keys lists the keys stored in this carrier.
func (*DBTextMapCarrier) Set ¶
func (carrier *DBTextMapCarrier) Set(key string, value string)
Set stores the key-value pair.
type GormTracingHook ¶
type GormTracingHook struct {
// contains filtered or unexported fields
}
func (*GormTracingHook) Initialize ¶
func (p *GormTracingHook) Initialize(db *gorm.DB) error
func (*GormTracingHook) Name ¶
func (p *GormTracingHook) Name() string