models

package
v0.0.0-...-fe66236 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2015 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cat

type Cat struct {
	Id       int
	Title    string    `valid:"Required;MaxSize(64)"`
	Parent   *Cat      `orm:"column(parent_id);rel(fk)"`
	DataType *DealType `orm:"column(data_type_id);rel(one)"`
}

type Cy

type Cy struct {
	Id   int
	Abbr string `valid:"Required;MaxSize(3)"`
}

type Deal

type Deal struct {
	Id       int
	Tick     *Tick     `orm:"column(tick_id);rel(fk)" json:"-"` // RelForeignKey relation
	DateTime time.Time `valid:"Required"`
	Cat      *Cat      `valid:"Required" orm:"column(cat_id);rel(one)"`
	Amount   float32   `valid:"Required"`
	Cy       *Cy       `valid:"Required" orm:"column(cy_id);rel(one)"`
	Comment  string    `valid:"MaxSize(128)"`

	Tags []*Tag `orm:"rel(m2m)"`
	// contains filtered or unexported fields
}

type DealType

type DealType struct {
	Id    int
	Title string `valid:"Required;MaxSize(32)"`
}

type Tag

type Tag struct {
	Id    int
	Title string `valid:"Required;MaxSize(48)"`
}

type Tick

type Tick struct {
	Id       int
	User     *User  `orm:"column(user_id);rel(fk)" json:"-"` // RelForeignKey relation
	Title    string `valid:"Required;MaxSize(64)"`
	Rest     float32
	Created  time.Time
	Modified time.Time
}

type User

type User struct {
	Id    int
	Login string  `valid:"Required;MaxSize(32)"`
	Name  string  `valid:"MaxSize(64)"`
	Email string  `valid:"Email;MaxSize(96)"`
	Pass  string  `valid:"Required;MinSize(8)" json:"-"`
	Ticks []*Tick `orm:"reverse(many)"` // reverse relationship of fk
}

func (*User) TableName

func (u *User) TableName() string

func (*User) Valid

func (u *User) Valid(v *validation.Validation)

Jump to

Keyboard shortcuts

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