Documentation
¶
Index ¶
- Constants
- func AreTestStructObjectsSame(ts1 *TestStruct, ts2 *TestStruct) bool
- func CreateDocker(user, pass, name string) (dockerPool *dockertest.Pool, dockerResource *dockertest.Resource, db *sql.DB)
- func FatalIfTestStructNotDeletedInTheDatabase(t *testing.T, db *sql.DB, id uint64)
- func ObjFieldInterfaces(obj interface{}, includeID bool) []interface{}
- func RemoveDocker(dockerPool *dockertest.Pool, dockerResource *dockertest.Resource)
- func TestStructJSON() []byte
- func TestStructURLValues() url.Values
- type TestStruct
Constants ¶
View Source
const IDField = "ID"
Variables ¶
This section is empty.
Functions ¶
func AreTestStructObjectsSame ¶
func AreTestStructObjectsSame(ts1 *TestStruct, ts2 *TestStruct) bool
func CreateDocker ¶
func CreateDocker(user, pass, name string) (dockerPool *dockertest.Pool, dockerResource *dockertest.Resource, db *sql.DB)
func ObjFieldInterfaces ¶
func ObjFieldInterfaces(obj interface{}, includeID bool) []interface{}
func RemoveDocker ¶
func RemoveDocker(dockerPool *dockertest.Pool, dockerResource *dockertest.Resource)
func TestStructJSON ¶
func TestStructJSON() []byte
func TestStructURLValues ¶
Types ¶
type TestStruct ¶
type TestStruct struct {
ID uint64
Flags uint64
PrimaryEmail string `crud:"req"`
EmailSecondary string `crud:"req email"`
FirstName string `crud:"req len:2,30"`
LastName string `crud:"req len:0,255"`
Age int `crud:"val:1,120"`
Price int `crud:"val:0,999"`
PostCode string `crud:"req len:6 regexp:^[0-9]{2}\\-[0-9]{3}$"`
PostCode2 string `crud:"len:6" 2db_regexp:"^[0-9]{2}\\-[0-9]{3}$"`
Password string `json:"password"`
Key string `crud:"req uniq len:30,255"`
CreatedAt int64
CreatedBy uint64
ModifiedAt int64
ModifiedBy uint64
}
Test struct for all the tests
func FatalIfNoTestStructInTheDatabase ¶
func FatalIfNoTestStructInTheDatabase(t *testing.T, db *sql.DB) *TestStruct
func TestStructWithData ¶
func TestStructWithData() *TestStruct
Click to show internal directories.
Click to hide internal directories.