Documentation ¶
Index ¶
- Constants
- Variables
- type User
- func (s *User) HasPK() bool
- func (v User) MarshalEasyJSON(w *jwriter.Writer)
- func (v User) MarshalJSON() ([]byte, error)
- func (s *User) PKPointer() interface{}
- func (s *User) PKValue() interface{}
- func (s *User) Pointers() []interface{}
- func (s *User) SetPK(pk interface{})
- func (s User) String() string
- func (s *User) Table() reform.Table
- func (v *User) UnmarshalEasyJSON(l *jlexer.Lexer)
- func (v *User) UnmarshalJSON(data []byte) error
- func (u *User) ValidateOnLogin() error
- func (u *User) ValidateOnRegistration() error
- func (s *User) Values() []interface{}
- func (s *User) View() reform.View
Constants ¶
const (
Addr = "user:9500"
)
Variables ¶
var UserTable = &userTableType{ s: parse.StructInfo{Type: "User", SQLSchema: "", SQLName: "user", Fields: []parse.FieldInfo{{Name: "ID", Type: "uint64", Column: "id"}, {Name: "Login", Type: "string", Column: "login"}, {Name: "PasswordHash", Type: "string", Column: "password"}}, PKFieldIndex: 0}, z: new(User).Values(), }
UserTable represents user view or table in SQL database.
Functions ¶
This section is empty.
Types ¶
type User ¶
type User struct { ID uint64 `reform:"id,pk" json:"id"` Login string `reform:"login" json:"login"` Password string `reform:"-" json:"password"` PasswordHash string `reform:"password" json:"-"` }
User model
func GetByLogin ¶
GetByLogin returns a user by login or error
func (User) MarshalEasyJSON ¶
MarshalEasyJSON supports easyjson.Marshaler interface
func (User) MarshalJSON ¶
MarshalJSON supports json.Marshaler interface
func (*User) PKPointer ¶
func (s *User) PKPointer() interface{}
PKPointer returns a pointer to primary key field for that record. Returned interface{} value is never untyped nil.
func (*User) PKValue ¶
func (s *User) PKValue() interface{}
PKValue returns a value of primary key for that record. Returned interface{} value is never untyped nil.
func (*User) Pointers ¶
func (s *User) Pointers() []interface{}
Pointers returns a slice of pointers to struct or record fields. Returned interface{} values are never untyped nils.
func (*User) Table ¶
func (s *User) Table() reform.Table
Table returns Table object for that record.
func (*User) UnmarshalEasyJSON ¶
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*User) UnmarshalJSON ¶
UnmarshalJSON supports json.Unmarshaler interface