oplog_test

package
v0.1.0-beta.1 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2020 License: MPL-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package oplog_test provides some gorm helper funcs for testing oplog database integrations

Index

Constants

This section is empty.

Variables

View Source
var File_controller_storage_oplog_test_v1_oplog_test_proto protoreflect.FileDescriptor

Functions

func Init

func Init(db *gorm.DB)

Init will use gorm migrations to init tables for test models

func Reinit

func Reinit(db *gorm.DB)

Reinit will use gorm to drop then init tables for test models

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) Descriptor() ([]byte, []int)

Deprecated: Use TestCar.ProtoReflect.Descriptor instead.

func (*TestCar) GetId

func (x *TestCar) GetId() uint32

func (*TestCar) GetModel

func (x *TestCar) GetModel() string

func (*TestCar) GetMpg

func (x *TestCar) GetMpg() int32

func (*TestCar) GetTable

func (x *TestCar) GetTable() string

func (*TestCar) ProtoMessage

func (*TestCar) ProtoMessage()

func (*TestCar) ProtoReflect

func (x *TestCar) ProtoReflect() protoreflect.Message

func (*TestCar) Reset

func (x *TestCar) Reset()

func (*TestCar) SetTableName

func (c *TestCar) SetTableName(n string)

SetTableName allows the table name to be overridden and makes a TestCar a ReplayableMessage

func (*TestCar) String

func (x *TestCar) String() string

func (*TestCar) TableName

func (c *TestCar) TableName() string

TableName overrides the table name for TestCar

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:"-" 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) Descriptor() ([]byte, []int)

Deprecated: Use TestUser.ProtoReflect.Descriptor instead.

func (*TestUser) GetEmail

func (x *TestUser) GetEmail() string

func (*TestUser) GetId

func (x *TestUser) GetId() uint32

func (*TestUser) GetName

func (x *TestUser) GetName() string

func (*TestUser) GetPhoneNumber

func (x *TestUser) GetPhoneNumber() string

func (*TestUser) GetTable

func (x *TestUser) GetTable() string

func (*TestUser) ProtoMessage

func (*TestUser) ProtoMessage()

func (*TestUser) ProtoReflect

func (x *TestUser) ProtoReflect() protoreflect.Message

func (*TestUser) Reset

func (x *TestUser) Reset()

func (*TestUser) SetTableName

func (u *TestUser) SetTableName(n string)

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.

func (*TestUser) String

func (x *TestUser) String() string

func (*TestUser) TableName

func (u *TestUser) TableName() string

TableName overrides the table name for TestUser

Jump to

Keyboard shortcuts

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