tests

package
v0.0.0-...-d79b3d1 Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2020 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Schema = schema{

	User: &schemaUser{
		BaseSchema: baseSchemaUser,

		ID:        baseSchemaUser.ColumnsArr[0],
		Name:      baseSchemaUser.ColumnsArr[1],
		Password:  baseSchemaUser.ColumnsArr[2],
		Role:      baseSchemaUser.ColumnsArr[3],
		Address:   schemaInstanceUserAddress,
		Work:      schemaInstanceUserWork,
		CreatedAt: baseSchemaUser.ColumnsArr[12],
		UpdatedAt: baseSchemaUser.ColumnsArr[13],
	},

	Group: &schemaGroup{
		BaseSchema: baseSchemaGroup,

		ID:   baseSchemaGroup.ColumnsArr[0],
		Name: baseSchemaGroup.ColumnsArr[1],
	},

	UserGroup: &schemaUserGroup{
		BaseSchema: baseSchemaUserGroup,

		ID:    schemaInstanceUserGroupID,
		Admin: baseSchemaUserGroup.ColumnsArr[2],
	},
}

Schema represents the schema of the package "tests".

Functions

This section is empty.

Types

type Address

type Address struct {
	Street string `ceous:"street"`
	Number string `ceous:"number"`
	City   string `ceous:"city"`
	State  string `ceous:"state"`
}

type CapitalString

type CapitalString string

func (CapitalString) Value

func (str CapitalString) Value() (driver.Value, error)

Value returns a driver Value.

type ErrorString

type ErrorString string

func (ErrorString) Value

func (str ErrorString) Value() (driver.Value, error)

Value returns a driver Value.

type Group

type Group struct {
	ceous.Model `tableName:"groups"`
	ID          int    `ceous:"id,pk,autoincr"`
	Name        string `ceous:"name"`
}

func (*Group) ColumnAddress

func (model *Group) ColumnAddress(name string) (interface{}, error)

ColumnAddress returns the pointer address of a field given its column name.

func (*Group) GetID

func (model *Group) GetID() interface{}

GetID returns the primary key for model `Group`.

func (*Group) Value

func (model *Group) Value(name string) (interface{}, error)

Value returns the value from a field given its column name.

type User

type User struct {
	ceous.Model `tableName:"users"`
	ID          int       `ceous:"id,pk,autoincr"`
	Name        string    `ceous:"name"`
	Password    string    `ceous:"password"`
	Role        string    `ceous:"role"`
	Address     Address   `ceous:""`
	Work        Address   `ceous:"work"`
	CreatedAt   time.Time `ceous:"created_at"`
	UpdatedAt   time.Time `ceous:"updated_at"`
}

func (*User) ColumnAddress

func (model *User) ColumnAddress(name string) (interface{}, error)

ColumnAddress returns the pointer address of a field given its column name.

func (*User) GetID

func (model *User) GetID() interface{}

GetID returns the primary key for model `User`.

func (*User) Value

func (model *User) Value(name string) (interface{}, error)

Value returns the value from a field given its column name.

type UserGroup

type UserGroup struct {
	ceous.Model `tableName:"user_groups"`
	ID          UserGroupPK `ceous:",pk"`

	Admin bool `ceous:"admin"`
	// contains filtered or unexported fields
}

func (*UserGroup) AssignUser

func (model *UserGroup) AssignUser(value *User)

AssignUser is a setter for `user` with no further processing.

func (*UserGroup) ColumnAddress

func (model *UserGroup) ColumnAddress(name string) (interface{}, error)

ColumnAddress returns the pointer address of a field given its column name.

func (*UserGroup) GetID

func (model *UserGroup) GetID() interface{}

GetID returns the primary key for model `UserGroup`.

func (*UserGroup) SetUser

func (model *UserGroup) SetUser(value *User) error

SetUser updates the value for the user, updating the user.

func (*UserGroup) User

func (model *UserGroup) User() *User

UserGroupUser returns the UserGroupUser from UserGroup.

func (*UserGroup) Value

func (model *UserGroup) Value(name string) (interface{}, error)

Value returns the value from a field given its column name.

type UserGroupPK

type UserGroupPK struct {
	ceous.Embedded
	UserID  int `ceous:"user_id"`
	GroupID int `ceous:"group_id"`
}

func (*UserGroupPK) ColumnAddress

func (model *UserGroupPK) ColumnAddress(name string) (interface{}, error)

ColumnAddress returns the pointer address of a field given its column name.

func (*UserGroupPK) Columns

func (ugPK *UserGroupPK) Columns() []ceous.SchemaField

func (*UserGroupPK) String

func (ugPK *UserGroupPK) String() string

func (*UserGroupPK) Value

func (model *UserGroupPK) Value(name string) (interface{}, error)

Value returns the value from a field given its column name.

type UserIgnored

type UserIgnored struct {
	ceous.Model `tableName:"users"`
	ID          int       `ceous:"id,pk,autoincr"`
	Name        string    `ceous:"name"`
	Password    string    `ceous:"password"`
	Role        string    `ceous:"role"`
	CreatedAt   time.Time `ceous:"created_at"`
	UpdatedAt   time.Time `ceous:"updated_at"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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