reform.v1: gopkg.in/reform.v1/internal/test/models Index | Files | Directories

package models

import "gopkg.in/reform.v1/internal/test/models"

Index

Package Files

extra.go extra_reform.go good.go good_reform.go

Variables

var ExtraTable = &extraTableType{
    s:  parse.StructInfo{Type: "Extra", SQLSchema: "", SQLName: "extra", Fields: []parse.FieldInfo{{Name: "ID", Type: "Integer", Column: "id"}, {Name: "Name", Type: "*String", Column: "name"}, {Name: "Byte", Type: "uint8", Column: "byte"}, {Name: "Uint8", Type: "uint8", Column: "uint8"}, {Name: "ByteP", Type: "*uint8", Column: "bytep"}, {Name: "Uint8P", Type: "*uint8", Column: "uint8p"}, {Name: "Bytes", Type: "[]uint8", Column: "bytes"}, {Name: "Uint8s", Type: "[]uint8", Column: "uint8s"}, {Name: "BytesA", Type: "[512]uint8", Column: "bytesa"}, {Name: "Uint8sA", Type: "[512]uint8", Column: "uint8sa"}, {Name: "BytesT", Type: "Bytes", Column: "bytest"}, {Name: "Uint8sT", Type: "Uint8s", Column: "uint8st"}}, PKFieldIndex: 0},
    z:  new(Extra).Values(),
}

ExtraTable represents extra view or table in SQL database.

var IDOnlyTable = &iDOnlyTableType{
    s:  parse.StructInfo{Type: "IDOnly", SQLSchema: "", SQLName: "id_only", Fields: []parse.FieldInfo{{Name: "ID", Type: "int32", Column: "id"}}, PKFieldIndex: 0},
    z:  new(IDOnly).Values(),
}

IDOnlyTable represents id_only view or table in SQL database.

var LegacyPersonTable = &legacyPersonTableType{
    s:  parse.StructInfo{Type: "LegacyPerson", SQLSchema: "legacy", SQLName: "people", Fields: []parse.FieldInfo{{Name: "ID", Type: "int32", Column: "id"}, {Name: "Name", Type: "*string", Column: "name"}}, PKFieldIndex: 0},
    z:  new(LegacyPerson).Values(),
}

LegacyPersonTable represents people view or table in SQL database.

var PersonProjectView = &personProjectViewType{
    s:  parse.StructInfo{Type: "PersonProject", SQLSchema: "", SQLName: "person_project", Fields: []parse.FieldInfo{{Name: "PersonID", Type: "int32", Column: "person_id"}, {Name: "ProjectID", Type: "string", Column: "project_id"}}, PKFieldIndex: -1},
    z:  new(PersonProject).Values(),
}

PersonProjectView represents person_project view or table in SQL database.

var PersonTable = &personTableType{
    s:  parse.StructInfo{Type: "Person", SQLSchema: "", SQLName: "people", Fields: []parse.FieldInfo{{Name: "ID", Type: "int32", Column: "id"}, {Name: "GroupID", Type: "*int32", Column: "group_id"}, {Name: "Name", Type: "string", Column: "name"}, {Name: "Email", Type: "*string", Column: "email"}, {Name: "CreatedAt", Type: "time.Time", Column: "created_at"}, {Name: "UpdatedAt", Type: "*time.Time", Column: "updated_at"}}, PKFieldIndex: 0},
    z:  new(Person).Values(),
}

PersonTable represents people view or table in SQL database.

var ProjectTable = &projectTableType{
    s:  parse.StructInfo{Type: "Project", SQLSchema: "", SQLName: "projects", Fields: []parse.FieldInfo{{Name: "Name", Type: "string", Column: "name"}, {Name: "ID", Type: "string", Column: "id"}, {Name: "Start", Type: "time.Time", Column: "start"}, {Name: "End", Type: "*time.Time", Column: "end"}}, PKFieldIndex: 1},
    z:  new(Project).Values(),
}

ProjectTable represents projects view or table in SQL database.

type Bytes Uses

type Bytes []byte

types for testing

type Extra Uses

type Extra struct {
    ID  Integer `reform:"id,pk"`
    // UUID     uuid.UUID `reform:"uuid"`
    Name *String `reform:"name"`

    Ignored1 string
    Ignored2 string `reform:""`
    Ignored3 string `reform:"-"`

    Byte    byte       `reform:"byte"`
    Uint8   uint8      `reform:"uint8"`
    ByteP   *byte      `reform:"bytep"`
    Uint8P  *uint8     `reform:"uint8p"`
    Bytes   []byte     `reform:"bytes"`
    Uint8s  []uint8    `reform:"uint8s"`
    BytesA  [512]byte  `reform:"bytesa"`
    Uint8sA [512]uint8 `reform:"uint8sa"`
    BytesT  Bytes      `reform:"bytest"`
    Uint8sT Uint8s     `reform:"uint8st"`
}

reform:extra

func (*Extra) HasPK Uses

func (s *Extra) HasPK() bool

HasPK returns true if record has non-zero primary key set, false otherwise.

func (*Extra) PKPointer Uses

func (s *Extra) PKPointer() interface{}

PKPointer returns a pointer to primary key field for that record. Returned interface{} value is never untyped nil.

func (*Extra) PKValue Uses

func (s *Extra) PKValue() interface{}

PKValue returns a value of primary key for that record. Returned interface{} value is never untyped nil.

func (*Extra) Pointers Uses

func (s *Extra) Pointers() []interface{}

Pointers returns a slice of pointers to struct or record fields. Returned interface{} values are never untyped nils.

func (*Extra) SetPK Uses

func (s *Extra) SetPK(pk interface{})

SetPK sets record primary key.

func (Extra) String Uses

func (s Extra) String() string

String returns a string representation of this struct or record.

func (*Extra) Table Uses

func (s *Extra) Table() reform.Table

Table returns Table object for that record.

func (*Extra) Values Uses

func (s *Extra) Values() []interface{}

Values returns a slice of struct or record field values. Returned interface{} values are never untyped nils.

func (*Extra) View Uses

func (s *Extra) View() reform.View

View returns View object for that struct.

type IDOnly Uses

type IDOnly struct {
    ID int32 `reform:"id,pk"`
}

reform:id_only

func (*IDOnly) HasPK Uses

func (s *IDOnly) HasPK() bool

HasPK returns true if record has non-zero primary key set, false otherwise.

func (*IDOnly) PKPointer Uses

func (s *IDOnly) PKPointer() interface{}

PKPointer returns a pointer to primary key field for that record. Returned interface{} value is never untyped nil.

func (*IDOnly) PKValue Uses

func (s *IDOnly) PKValue() interface{}

PKValue returns a value of primary key for that record. Returned interface{} value is never untyped nil.

func (*IDOnly) Pointers Uses

func (s *IDOnly) Pointers() []interface{}

Pointers returns a slice of pointers to struct or record fields. Returned interface{} values are never untyped nils.

func (*IDOnly) SetPK Uses

func (s *IDOnly) SetPK(pk interface{})

SetPK sets record primary key.

func (IDOnly) String Uses

func (s IDOnly) String() string

String returns a string representation of this struct or record.

func (*IDOnly) Table Uses

func (s *IDOnly) Table() reform.Table

Table returns Table object for that record.

func (*IDOnly) Values Uses

func (s *IDOnly) Values() []interface{}

Values returns a slice of struct or record field values. Returned interface{} values are never untyped nils.

func (*IDOnly) View Uses

func (s *IDOnly) View() reform.View

View returns View object for that struct.

type Integer Uses

type Integer int32

types for testing

type LegacyPerson Uses

type LegacyPerson struct {
    ID   int32   `reform:"id,pk"`
    Name *string `reform:"name"`
}

reform:legacy.people

func (*LegacyPerson) HasPK Uses

func (s *LegacyPerson) HasPK() bool

HasPK returns true if record has non-zero primary key set, false otherwise.

func (*LegacyPerson) PKPointer Uses

func (s *LegacyPerson) PKPointer() interface{}

PKPointer returns a pointer to primary key field for that record. Returned interface{} value is never untyped nil.

func (*LegacyPerson) PKValue Uses

func (s *LegacyPerson) PKValue() interface{}

PKValue returns a value of primary key for that record. Returned interface{} value is never untyped nil.

func (*LegacyPerson) Pointers Uses

func (s *LegacyPerson) Pointers() []interface{}

Pointers returns a slice of pointers to struct or record fields. Returned interface{} values are never untyped nils.

func (*LegacyPerson) SetPK Uses

func (s *LegacyPerson) SetPK(pk interface{})

SetPK sets record primary key.

func (LegacyPerson) String Uses

func (s LegacyPerson) String() string

String returns a string representation of this struct or record.

func (*LegacyPerson) Table Uses

func (s *LegacyPerson) Table() reform.Table

Table returns Table object for that record.

func (*LegacyPerson) Values Uses

func (s *LegacyPerson) Values() []interface{}

Values returns a slice of struct or record field values. Returned interface{} values are never untyped nils.

func (*LegacyPerson) View Uses

func (s *LegacyPerson) View() reform.View

View returns View object for that struct.

type Person Uses

type Person struct {
    ID        int32      `reform:"id,pk"`
    GroupID   *int32     `reform:"group_id"`
    Name      string     `reform:"name"`
    Email     *string    `reform:"email"`
    CreatedAt time.Time  `reform:"created_at"`
    UpdatedAt *time.Time `reform:"updated_at"`
}

reform:people

func (*Person) AfterFind Uses

func (p *Person) AfterFind() error

AfterFind converts to UTC and truncates to second both CreatedAt and UpdatedAt.

func (*Person) BeforeInsert Uses

func (p *Person) BeforeInsert() error

BeforeInsert sets CreatedAt if it's not set, then converts to UTC, truncates to second and strips monotonic clock reading from both CreatedAt and UpdatedAt.

func (*Person) BeforeUpdate Uses

func (p *Person) BeforeUpdate() error

BeforeUpdate sets CreatedAt if it's not set, sets UpdatedAt, then converts to UTC, truncates to second and strips monotonic clock reading from both CreatedAt and UpdatedAt.

func (*Person) HasPK Uses

func (s *Person) HasPK() bool

HasPK returns true if record has non-zero primary key set, false otherwise.

func (*Person) PKPointer Uses

func (s *Person) PKPointer() interface{}

PKPointer returns a pointer to primary key field for that record. Returned interface{} value is never untyped nil.

func (*Person) PKValue Uses

func (s *Person) PKValue() interface{}

PKValue returns a value of primary key for that record. Returned interface{} value is never untyped nil.

func (*Person) Pointers Uses

func (s *Person) Pointers() []interface{}

Pointers returns a slice of pointers to struct or record fields. Returned interface{} values are never untyped nils.

func (*Person) SetPK Uses

func (s *Person) SetPK(pk interface{})

SetPK sets record primary key.

func (Person) String Uses

func (s Person) String() string

String returns a string representation of this struct or record.

func (*Person) Table Uses

func (s *Person) Table() reform.Table

Table returns Table object for that record.

func (*Person) Values Uses

func (s *Person) Values() []interface{}

Values returns a slice of struct or record field values. Returned interface{} values are never untyped nils.

func (*Person) View Uses

func (s *Person) View() reform.View

View returns View object for that struct.

type PersonProject Uses

type PersonProject struct {
    PersonID  int32  `reform:"person_id"`
    ProjectID string `reform:"project_id"`
}

PersonProject represents row in table person_project. reform:person_project

func (*PersonProject) Pointers Uses

func (s *PersonProject) Pointers() []interface{}

Pointers returns a slice of pointers to struct or record fields. Returned interface{} values are never untyped nils.

func (PersonProject) String Uses

func (s PersonProject) String() string

String returns a string representation of this struct or record.

func (*PersonProject) Values Uses

func (s *PersonProject) Values() []interface{}

Values returns a slice of struct or record field values. Returned interface{} values are never untyped nils.

func (*PersonProject) View Uses

func (s *PersonProject) View() reform.View

View returns View object for that struct.

type Project Uses

type Project struct {
    Name  string     `reform:"name"`
    ID    string     `reform:"id,pk"`
    Start time.Time  `reform:"start"`
    End   *time.Time `reform:"end"`
}

Project represents row in table projects (reform:projects).

func (*Project) AfterFind Uses

func (p *Project) AfterFind() error

AfterFind converts to UTC both Start and End.

func (*Project) BeforeInsert Uses

func (p *Project) BeforeInsert() error

BeforeInsert converts to UTC, truncates to day and strips monotonic clock reading from both Start and End.

func (*Project) BeforeUpdate Uses

func (p *Project) BeforeUpdate() error

BeforeUpdate converts to UTC, truncates to day and strips monotonic clock reading from both Start and End.

func (*Project) HasPK Uses

func (s *Project) HasPK() bool

HasPK returns true if record has non-zero primary key set, false otherwise.

func (*Project) PKPointer Uses

func (s *Project) PKPointer() interface{}

PKPointer returns a pointer to primary key field for that record. Returned interface{} value is never untyped nil.

func (*Project) PKValue Uses

func (s *Project) PKValue() interface{}

PKValue returns a value of primary key for that record. Returned interface{} value is never untyped nil.

func (*Project) Pointers Uses

func (s *Project) Pointers() []interface{}

Pointers returns a slice of pointers to struct or record fields. Returned interface{} values are never untyped nils.

func (*Project) SetPK Uses

func (s *Project) SetPK(pk interface{})

SetPK sets record primary key.

func (Project) String Uses

func (s Project) String() string

String returns a string representation of this struct or record.

func (*Project) Table Uses

func (s *Project) Table() reform.Table

Table returns Table object for that record.

func (*Project) Values Uses

func (s *Project) Values() []interface{}

Values returns a slice of struct or record field values. Returned interface{} values are never untyped nils.

func (*Project) View Uses

func (s *Project) View() reform.View

View returns View object for that struct.

type String Uses

type String string

types for testing

type Uint8s Uses

type Uint8s []uint8

types for testing

Directories

PathSynopsis
bogus

Package models imports 6 packages (graph). Updated 2019-01-18. Refresh now. Tools for package owners.