db_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: 8 Imported by: 0

Documentation

Overview

Package db_test provides some helper funcs for testing db integrations

Index

Constants

This section is empty.

Variables

View Source
var File_controller_storage_db_db_test_v1_db_test_proto protoreflect.FileDescriptor

Functions

This section is empty.

Types

type Cloner

type Cloner interface {
	Clone() interface{}
}

type NotIder

type NotIder struct{}

func (*NotIder) Clone

func (i *NotIder) Clone() interface{}

type StoreTestCar

type StoreTestCar struct {

	// @inject_tag: gorm:"primary_key"
	Id uint32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty" gorm:"primary_key"`
	// create_time from the RDBMS
	// @inject_tag: `gorm:"default:CURRENT_TIMESTAMP"`
	CreateTime *timestamp.Timestamp `protobuf:"bytes,2,opt,name=create_time,json=createTime,proto3" json:"create_time,omitempty" gorm:"default:CURRENT_TIMESTAMP"`
	// update_time from the RDBMS
	// @inject_tag: `gorm:"default:CURRENT_TIMESTAMP"`
	UpdateTime *timestamp.Timestamp `protobuf:"bytes,3,opt,name=update_time,json=updateTime,proto3" json:"update_time,omitempty" gorm:"default:CURRENT_TIMESTAMP"`
	// public_id is the used to access the car via an API
	PublicId string `protobuf:"bytes,4,opt,name=public_id,json=publicId,proto3" json:"public_id,omitempty"`
	// name is the optional friendly name used to
	// access the Scope via an API
	// @inject_tag: `gorm:"default:null"`
	Name string `protobuf:"bytes,5,opt,name=name,proto3" json:"name,omitempty" gorm:"default:null"`
	// @inject_tag: `gorm:"default:null"`
	Model string `protobuf:"bytes,6,opt,name=model,proto3" json:"model,omitempty" gorm:"default:null"`
	// @inject_tag: `gorm:"default:null"`
	Mpg int32 `protobuf:"varint,7,opt,name=mpg,proto3" json:"mpg,omitempty" gorm:"default:null"`
	// contains filtered or unexported fields
}

TestCar for gorm test car model

func (*StoreTestCar) Descriptor deprecated

func (*StoreTestCar) Descriptor() ([]byte, []int)

Deprecated: Use StoreTestCar.ProtoReflect.Descriptor instead.

func (*StoreTestCar) GetCreateTime

func (x *StoreTestCar) GetCreateTime() *timestamp.Timestamp

func (*StoreTestCar) GetId

func (x *StoreTestCar) GetId() uint32

func (*StoreTestCar) GetModel

func (x *StoreTestCar) GetModel() string

func (*StoreTestCar) GetMpg

func (x *StoreTestCar) GetMpg() int32

func (*StoreTestCar) GetName

func (x *StoreTestCar) GetName() string

func (*StoreTestCar) GetPublicId

func (x *StoreTestCar) GetPublicId() string

func (*StoreTestCar) GetUpdateTime

func (x *StoreTestCar) GetUpdateTime() *timestamp.Timestamp

func (*StoreTestCar) ProtoMessage

func (*StoreTestCar) ProtoMessage()

func (*StoreTestCar) ProtoReflect

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

func (*StoreTestCar) Reset

func (x *StoreTestCar) Reset()

func (*StoreTestCar) String

func (x *StoreTestCar) String() string

type StoreTestRental

type StoreTestRental struct {

	// @inject_tag: gorm:"primary_key"
	Id uint32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty" gorm:"primary_key"`
	// create_time from the RDBMS
	// @inject_tag: `gorm:"default:CURRENT_TIMESTAMP"`
	CreateTime *timestamp.Timestamp `protobuf:"bytes,2,opt,name=create_time,json=createTime,proto3" json:"create_time,omitempty" gorm:"default:CURRENT_TIMESTAMP"`
	// update_time from the RDBMS
	// @inject_tag: `gorm:"default:CURRENT_TIMESTAMP"`
	UpdateTime *timestamp.Timestamp `protobuf:"bytes,3,opt,name=update_time,json=updateTime,proto3" json:"update_time,omitempty" gorm:"default:CURRENT_TIMESTAMP"`
	// public_id is the used to access the rental via an API
	PublicId string `protobuf:"bytes,4,opt,name=public_id,json=publicId,proto3" json:"public_id,omitempty"`
	// name is the optional friendly name used to
	// access the rental via an API
	// @inject_tag: `gorm:"default:null"`
	Name string `protobuf:"bytes,5,opt,name=name,proto3" json:"name,omitempty" gorm:"default:null"`
	// @inject_tag: `gorm:"default:null"`
	UserId uint32 `protobuf:"varint,6,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty" gorm:"default:null"`
	// @inject_tag: `gorm:"default:null"`
	CarId uint32 `protobuf:"varint,7,opt,name=car_id,json=carId,proto3" json:"car_id,omitempty" gorm:"default:null"`
	// contains filtered or unexported fields
}

TestRental for gorm test rental model

func (*StoreTestRental) Descriptor deprecated

func (*StoreTestRental) Descriptor() ([]byte, []int)

Deprecated: Use StoreTestRental.ProtoReflect.Descriptor instead.

func (*StoreTestRental) GetCarId

func (x *StoreTestRental) GetCarId() uint32

func (*StoreTestRental) GetCreateTime

func (x *StoreTestRental) GetCreateTime() *timestamp.Timestamp

func (*StoreTestRental) GetId

func (x *StoreTestRental) GetId() uint32

func (*StoreTestRental) GetName

func (x *StoreTestRental) GetName() string

func (*StoreTestRental) GetPublicId

func (x *StoreTestRental) GetPublicId() string

func (*StoreTestRental) GetUpdateTime

func (x *StoreTestRental) GetUpdateTime() *timestamp.Timestamp

func (*StoreTestRental) GetUserId

func (x *StoreTestRental) GetUserId() uint32

func (*StoreTestRental) ProtoMessage

func (*StoreTestRental) ProtoMessage()

func (*StoreTestRental) ProtoReflect

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

func (*StoreTestRental) Reset

func (x *StoreTestRental) Reset()

func (*StoreTestRental) String

func (x *StoreTestRental) String() string

type StoreTestScooter

type StoreTestScooter struct {

	// @inject_tag: gorm:"primary_key"
	Id uint32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty" gorm:"primary_key"`
	// create_time from the RDBMS
	// @inject_tag: `gorm:"default:CURRENT_TIMESTAMP"`
	CreateTime *timestamp.Timestamp `protobuf:"bytes,2,opt,name=create_time,json=createTime,proto3" json:"create_time,omitempty" gorm:"default:CURRENT_TIMESTAMP"`
	// update_time from the RDBMS
	// @inject_tag: `gorm:"default:CURRENT_TIMESTAMP"`
	UpdateTime *timestamp.Timestamp `protobuf:"bytes,3,opt,name=update_time,json=updateTime,proto3" json:"update_time,omitempty" gorm:"default:CURRENT_TIMESTAMP"`
	// private_id is the used to access scooter, but not intended to be available
	// via the API
	PrivateId string `protobuf:"bytes,4,opt,name=private_id,json=privateId,proto3" json:"private_id,omitempty"`
	// @inject_tag: `gorm:"default:null"`
	Model string `protobuf:"bytes,6,opt,name=model,proto3" json:"model,omitempty" gorm:"default:null"`
	// @inject_tag: `gorm:"default:null"`
	Mpg int32 `protobuf:"varint,7,opt,name=mpg,proto3" json:"mpg,omitempty" gorm:"default:null"`
	// contains filtered or unexported fields
}

StoreTestScooter used in the db tests only and provides a gorm resource with a private id.

func (*StoreTestScooter) Descriptor deprecated

func (*StoreTestScooter) Descriptor() ([]byte, []int)

Deprecated: Use StoreTestScooter.ProtoReflect.Descriptor instead.

func (*StoreTestScooter) GetCreateTime

func (x *StoreTestScooter) GetCreateTime() *timestamp.Timestamp

func (*StoreTestScooter) GetId

func (x *StoreTestScooter) GetId() uint32

func (*StoreTestScooter) GetModel

func (x *StoreTestScooter) GetModel() string

func (*StoreTestScooter) GetMpg

func (x *StoreTestScooter) GetMpg() int32

func (*StoreTestScooter) GetPrivateId

func (x *StoreTestScooter) GetPrivateId() string

func (*StoreTestScooter) GetUpdateTime

func (x *StoreTestScooter) GetUpdateTime() *timestamp.Timestamp

func (*StoreTestScooter) ProtoMessage

func (*StoreTestScooter) ProtoMessage()

func (*StoreTestScooter) ProtoReflect

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

func (*StoreTestScooter) Reset

func (x *StoreTestScooter) Reset()

func (*StoreTestScooter) String

func (x *StoreTestScooter) String() string

type StoreTestUser

type StoreTestUser struct {

	// @inject_tag: gorm:"primary_key"
	Id uint32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty" gorm:"primary_key"`
	// create_time from the RDBMS
	// @inject_tag: `gorm:"default:CURRENT_TIMESTAMP"`
	CreateTime *timestamp.Timestamp `protobuf:"bytes,2,opt,name=create_time,json=createTime,proto3" json:"create_time,omitempty" gorm:"default:CURRENT_TIMESTAMP"`
	// update_time from the RDBMS
	// @inject_tag: `gorm:"default:CURRENT_TIMESTAMP"`
	UpdateTime *timestamp.Timestamp `protobuf:"bytes,3,opt,name=update_time,json=updateTime,proto3" json:"update_time,omitempty" gorm:"default:CURRENT_TIMESTAMP"`
	// public_id is the used to access the user via an API
	PublicId string `protobuf:"bytes,4,opt,name=public_id,json=publicId,proto3" json:"public_id,omitempty"`
	// name is the optional friendly name used to
	// access the user via an API
	// @inject_tag: `gorm:"default:null"`
	Name string `protobuf:"bytes,5,opt,name=name,proto3" json:"name,omitempty" gorm:"default:null"`
	// @inject_tag: `gorm:"default:null"`
	PhoneNumber string `protobuf:"bytes,6,opt,name=phone_number,json=phoneNumber,proto3" json:"phone_number,omitempty" gorm:"default:null"`
	// @inject_tag: `gorm:"default:null"`
	Email string `protobuf:"bytes,7,opt,name=email,proto3" json:"email,omitempty" gorm:"default:null"`
	// @inject_tag: `gorm:"default:null"`
	Version uint32 `protobuf:"varint,8,opt,name=version,proto3" json:"version,omitempty" gorm:"default:null"`
	// contains filtered or unexported fields
}

TestUser for gorm test user model

func (*StoreTestUser) Descriptor deprecated

func (*StoreTestUser) Descriptor() ([]byte, []int)

Deprecated: Use StoreTestUser.ProtoReflect.Descriptor instead.

func (*StoreTestUser) GetCreateTime

func (x *StoreTestUser) GetCreateTime() *timestamp.Timestamp

func (*StoreTestUser) GetEmail

func (x *StoreTestUser) GetEmail() string

func (*StoreTestUser) GetId

func (x *StoreTestUser) GetId() uint32

func (*StoreTestUser) GetName

func (x *StoreTestUser) GetName() string

func (*StoreTestUser) GetPhoneNumber

func (x *StoreTestUser) GetPhoneNumber() string

func (*StoreTestUser) GetPublicId

func (x *StoreTestUser) GetPublicId() string

func (*StoreTestUser) GetUpdateTime

func (x *StoreTestUser) GetUpdateTime() *timestamp.Timestamp

func (*StoreTestUser) GetVersion

func (x *StoreTestUser) GetVersion() uint32

func (*StoreTestUser) ProtoMessage

func (*StoreTestUser) ProtoMessage()

func (*StoreTestUser) ProtoReflect

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

func (*StoreTestUser) Reset

func (x *StoreTestUser) Reset()

func (*StoreTestUser) String

func (x *StoreTestUser) String() string

type TestCar

type TestCar struct {
	*StoreTestCar
	// contains filtered or unexported fields
}

func NewTestCar

func NewTestCar() (*TestCar, error)

func (*TestCar) SetTableName

func (c *TestCar) SetTableName(name string)

func (*TestCar) TableName

func (c *TestCar) TableName() string

type TestRental

type TestRental struct {
	*StoreTestRental
	// contains filtered or unexported fields
}

func NewTestRental

func NewTestRental() (*TestRental, error)

func (*TestRental) SetTableName

func (r *TestRental) SetTableName(name string)

func (*TestRental) TableName

func (r *TestRental) TableName() string

type TestScooter

type TestScooter struct {
	*StoreTestScooter
	// contains filtered or unexported fields
}

func NewTestScooter

func NewTestScooter() (*TestScooter, error)

func (*TestScooter) Clone

func (t *TestScooter) Clone() interface{}

func (*TestScooter) SetTableName

func (t *TestScooter) SetTableName(name string)

func (*TestScooter) TableName

func (t *TestScooter) TableName() string

type TestUser

type TestUser struct {
	*StoreTestUser
	// contains filtered or unexported fields
}

func AllocTestUser

func AllocTestUser() TestUser

func NewTestUser

func NewTestUser() (*TestUser, error)

func (*TestUser) Clone

func (u *TestUser) Clone() interface{}

Clone is useful when you're retrying transactions and you need to send the user several times

func (*TestUser) SetTableName

func (u *TestUser) SetTableName(name string)

func (*TestUser) TableName

func (u *TestUser) TableName() string

Jump to

Keyboard shortcuts

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