Documentation
¶
Overview ¶
Package oplog_test provides some gorm helper funcs for testing oplog database integrations
Index ¶
- Variables
- func Init(t testing.TB, db *dbw.DB)
- func Reinit(t *testing.T, db *dbw.DB)
- type TestCar
- func (*TestCar) Descriptor() ([]byte, []int)deprecated
- func (x *TestCar) GetId() uint32
- func (x *TestCar) GetModel() string
- func (x *TestCar) GetMpg() int32
- func (x *TestCar) GetTable() string
- func (*TestCar) ProtoMessage()
- func (x *TestCar) ProtoReflect() protoreflect.Message
- func (x *TestCar) Reset()
- func (c *TestCar) SetTableName(n string)
- func (x *TestCar) String() string
- func (c *TestCar) TableName() string
- type TestNonReplayableUser
- func (*TestNonReplayableUser) Descriptor() ([]byte, []int)deprecated
- func (x *TestNonReplayableUser) GetEmail() string
- func (x *TestNonReplayableUser) GetId() uint32
- func (x *TestNonReplayableUser) GetName() string
- func (x *TestNonReplayableUser) GetPhoneNumber() string
- func (*TestNonReplayableUser) ProtoMessage()
- func (x *TestNonReplayableUser) ProtoReflect() protoreflect.Message
- func (x *TestNonReplayableUser) Reset()
- func (x *TestNonReplayableUser) String() string
- type TestRental
- func (*TestRental) Descriptor() ([]byte, []int)deprecated
- func (x *TestRental) GetCarId() uint32
- func (x *TestRental) GetTable() string
- func (x *TestRental) GetUserId() uint32
- func (*TestRental) ProtoMessage()
- func (x *TestRental) ProtoReflect() protoreflect.Message
- func (x *TestRental) Reset()
- func (r *TestRental) SetTableName(n string)
- func (x *TestRental) String() string
- func (r *TestRental) TableName() string
- type TestUser
- func (*TestUser) Descriptor() ([]byte, []int)deprecated
- func (x *TestUser) GetEmail() string
- func (x *TestUser) GetId() uint32
- func (x *TestUser) GetName() string
- func (x *TestUser) GetPhoneNumber() string
- func (x *TestUser) GetTable() string
- func (x *TestUser) GetVersion() uint32
- func (*TestUser) ProtoMessage()
- func (x *TestUser) ProtoReflect() protoreflect.Message
- func (x *TestUser) Reset()
- func (u *TestUser) SetTableName(n string)
- func (x *TestUser) String() string
- func (u *TestUser) TableName() string
Constants ¶
This section is empty.
Variables ¶
var File_controller_storage_oplog_test_v1_oplog_test_proto protoreflect.FileDescriptor
Functions ¶
Types ¶
type TestCar ¶
type TestCar struct { // @inject_tag: gorm:"primary_key" Id uint32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty" gorm:"primary_key"` Model string `protobuf:"bytes,4,opt,name=model,proto3" json:"model,omitempty"` Mpg int32 `protobuf:"varint,5,opt,name=mpg,proto3" json:"mpg,omitempty"` // @inject_tag: gorm:"-" json:"-" Table string `protobuf:"bytes,6,opt,name=table,proto3" json:"-" gorm:"-"` // contains filtered or unexported fields }
TestCar for gorm test car model
func (*TestCar) Descriptor
deprecated
func (*TestCar) ProtoMessage ¶
func (*TestCar) ProtoMessage()
func (*TestCar) ProtoReflect ¶
func (x *TestCar) ProtoReflect() protoreflect.Message
func (*TestCar) SetTableName ¶
SetTableName allows the table name to be overridden and makes a TestCar a ReplayableMessage
type TestNonReplayableUser ¶
type TestNonReplayableUser struct { // @inject_tag: gorm:"primary_key" Id uint32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty" gorm:"primary_key"` Name string `protobuf:"bytes,4,opt,name=name,proto3" json:"name,omitempty"` PhoneNumber string `protobuf:"bytes,5,opt,name=phone_number,json=phoneNumber,proto3" json:"phone_number,omitempty"` Email string `protobuf:"bytes,6,opt,name=email,proto3" json:"email,omitempty"` // contains filtered or unexported fields }
TestNonReplayableUser for negative test
func (*TestNonReplayableUser) Descriptor
deprecated
func (*TestNonReplayableUser) Descriptor() ([]byte, []int)
Deprecated: Use TestNonReplayableUser.ProtoReflect.Descriptor instead.
func (*TestNonReplayableUser) GetEmail ¶
func (x *TestNonReplayableUser) GetEmail() string
func (*TestNonReplayableUser) GetId ¶
func (x *TestNonReplayableUser) GetId() uint32
func (*TestNonReplayableUser) GetName ¶
func (x *TestNonReplayableUser) GetName() string
func (*TestNonReplayableUser) GetPhoneNumber ¶
func (x *TestNonReplayableUser) GetPhoneNumber() string
func (*TestNonReplayableUser) ProtoMessage ¶
func (*TestNonReplayableUser) ProtoMessage()
func (*TestNonReplayableUser) ProtoReflect ¶
func (x *TestNonReplayableUser) ProtoReflect() protoreflect.Message
func (*TestNonReplayableUser) Reset ¶
func (x *TestNonReplayableUser) Reset()
func (*TestNonReplayableUser) String ¶
func (x *TestNonReplayableUser) String() string
type TestRental ¶
type TestRental struct { UserId uint32 `protobuf:"varint,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` CarId uint32 `protobuf:"varint,2,opt,name=car_id,json=carId,proto3" json:"car_id,omitempty"` // @inject_tag: gorm:"-" json:"-" Table string `protobuf:"bytes,3,opt,name=table,proto3" json:"-" gorm:"-"` // contains filtered or unexported fields }
TestRental for gorm test rental model
func (*TestRental) Descriptor
deprecated
func (*TestRental) Descriptor() ([]byte, []int)
Deprecated: Use TestRental.ProtoReflect.Descriptor instead.
func (*TestRental) GetCarId ¶
func (x *TestRental) GetCarId() uint32
func (*TestRental) GetTable ¶
func (x *TestRental) GetTable() string
func (*TestRental) GetUserId ¶
func (x *TestRental) GetUserId() uint32
func (*TestRental) ProtoMessage ¶
func (*TestRental) ProtoMessage()
func (*TestRental) ProtoReflect ¶
func (x *TestRental) ProtoReflect() protoreflect.Message
func (*TestRental) Reset ¶
func (x *TestRental) Reset()
func (*TestRental) SetTableName ¶
func (r *TestRental) SetTableName(n string)
SetTableName allows the table name to be overridden and makes a TestRental a ReplayableMessage
func (*TestRental) String ¶
func (x *TestRental) String() string
func (*TestRental) TableName ¶
func (r *TestRental) TableName() string
TableName overrids the table name for TestRental
type TestUser ¶
type TestUser struct { // @inject_tag: gorm:"primary_key" Id uint32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty" gorm:"primary_key"` Name string `protobuf:"bytes,4,opt,name=name,proto3" json:"name,omitempty"` PhoneNumber string `protobuf:"bytes,5,opt,name=phone_number,json=phoneNumber,proto3" json:"phone_number,omitempty"` Email string `protobuf:"bytes,6,opt,name=email,proto3" json:"email,omitempty"` // @inject_tag: gorm:"default:null" Version uint32 `protobuf:"varint,9,opt,name=version,proto3" json:"version,omitempty" gorm:"default:null"` // @inject_tag: gorm:"-" json:"-" Table string `protobuf:"bytes,7,opt,name=table,proto3" json:"-" gorm:"-"` // contains filtered or unexported fields }
TestUser for gorm test user model
func (*TestUser) Descriptor
deprecated
func (*TestUser) GetPhoneNumber ¶
func (*TestUser) GetVersion ¶ added in v0.7.4
func (*TestUser) ProtoMessage ¶
func (*TestUser) ProtoMessage()
func (*TestUser) ProtoReflect ¶
func (x *TestUser) ProtoReflect() protoreflect.Message
func (*TestUser) SetTableName ¶
SetTableName allows the table name to be overridden and makes a TestUser a ReplayableMessage. If the caller attempts to set the name to "" the name will be reset to the default name.