Documentation
¶
Index ¶
- Variables
- func OnUserHexPassword()
- type App
- type Auditor
- type Cidade
- func (this *Cidade) FindByNameAndEstado(nome string, estado *Estado) (*Cidade, error)
- func (this *Cidade) FindByNameAndEstadoUf(nome string, uf string) (*Cidade, error)
- func (this *Cidade) IsPersisted() bool
- func (this *Cidade) ListByEstado(estado *Estado) (*[]*Cidade, error)
- func (this *Cidade) LoadRelated(entity *Cidade)
- func (this *Cidade) TableName() string
- type Email
- func (this *Email) Create(to string, subject string, body string) (*Email, error)
- func (this *Email) CreateOnly(to string, subject string, body string) *Email
- func (this *Email) CreateWithCco(to string, cco string, subject string, body string) (*Email, error)
- func (this *Email) CreateWithCcoOnly(to string, cco string, subject string, body string) *Email
- func (this *Email) IsPersisted() bool
- func (this *Email) List() (*[]*Email, error)
- func (this *Email) TableName() string
- type Estado
- type Role
- func (this *Role) Exists(authority string) bool
- func (this *Role) FindByAuthority(authority string) (role *Role, err error)
- func (this *Role) FindByAuthorityOrNil(authority string) *Role
- func (this *Role) IsPersisted() bool
- func (this *Role) List() (*[]*Role, error)
- func (this *Role) TableName() string
- type Tenant
- func (this *Tenant) FindByDocumento(documento string) (*Tenant, error)
- func (this *Tenant) First() *Tenant
- func (this *Tenant) GenereteUuid() string
- func (this *Tenant) GetByUuid(uuid string) (*Tenant, error)
- func (this *Tenant) GetByUuidAndEnabled(uuid string) (*Tenant, error)
- func (this *Tenant) GetId() int64
- func (this *Tenant) IsPersisted() bool
- func (this *Tenant) List() (*[]*Tenant, error)
- func (this *Tenant) LoadRelated(entity *Tenant)
- func (this *Tenant) Page(page *db.Page) (*[]*Tenant, error)
- func (this *Tenant) TableName() string
- type TenantUser
- func (this *TenantUser) Create(user *User, tenant *Tenant) error
- func (this *TenantUser) FindByAdminUserAndTenant(user *User, tenant *Tenant) (*TenantUser, error)
- func (this *TenantUser) FindByUserAndTenant(user *User, tenant *Tenant) (*TenantUser, error)
- func (this *TenantUser) GetFirstTenant(user *User) (*Tenant, error)
- func (this *TenantUser) HasActiveTenant(user *User) (bool, error)
- func (this *TenantUser) IsPersisted() bool
- func (this *TenantUser) List() (*[]*TenantUser, error)
- func (this *TenantUser) ListActivesByTenant(tenant *Tenant) (*[]*TenantUser, error)
- func (this *TenantUser) ListActivesByUser(user *User) (*[]*TenantUser, error)
- func (this *TenantUser) ListByTenant(tenant *Tenant) (*[]*TenantUser, error)
- func (this *TenantUser) ListByUser(user *User) (*[]*TenantUser, error)
- func (this *TenantUser) ListByUserAdmin(user *User) (*[]*TenantUser, error)
- func (this *TenantUser) ListTenantsActivesByUser(user *User) ([]*Tenant, error)
- func (this *TenantUser) ListTenantsByUser(user *User) ([]*Tenant, error)
- func (this *TenantUser) ListUsersActivesByTenant(tenant *Tenant) ([]*User, error)
- func (this *TenantUser) ListUsersByTenant(tenant *Tenant) ([]*User, error)
- func (this *TenantUser) LoadRelated(entity *TenantUser)
- func (this *TenantUser) Remove(user *User, tenant *Tenant) error
- func (this *TenantUser) RemoveAllByTenant(tenant *Tenant) error
- func (this *TenantUser) RemoveAllByUser(user *User) error
- func (this *TenantUser) TableName() string
- func (this *TenantUser) ToTenants(results []*TenantUser) []*Tenant
- func (this *TenantUser) ToUsers(results []*TenantUser) []*User
- type User
- func (this *User) ChangePassword(newPassword string)
- func (this *User) EncodePassword()
- func (this *User) FirstName() string
- func (this *User) GenerateToken(password string)
- func (this *User) GenereteUuid() string
- func (this *User) GetAuthorities() string
- func (this *User) GetByChangePwdToken(token string) (*User, error)
- func (this *User) GetByToken(token string) (*User, error)
- func (this *User) GetByUserName(username string) (*User, error)
- func (this *User) GetByUuid(uuid string) (*User, error)
- func (this *User) GetByUuidAndEnabled(uuid string) (*User, error)
- func (this *User) IsPersisted() bool
- func (this *User) IsSamePassword(newPassword string) bool
- func (this *User) List() (*[]*User, error)
- func (this *User) ListByTenant(tenant *Tenant) (*[]*User, error)
- func (this *User) LoadIfExists() (bool, error)
- func (this *User) LoadRelated(entity *User)
- func (this *User) Page(page *db.Page) (*[]*User, error)
- func (this *User) PageByTenant(tenant Tenant, page *db.Page) (*[]*User, error)
- func (this *User) String() string
- func (this *User) TableName() string
- func (this *User) UpdateLastLogin(userId int64)
- type UserRole
- func (this *UserRole) Create(user *User, autority string) error
- func (this *UserRole) FindAllByRole(role *Role) (*[]*UserRole, error)
- func (this *UserRole) FindAllByUser(user *User) (*[]*UserRole, error)
- func (this *UserRole) FindAllRolesByUser(user *User) *[]*Role
- func (this *UserRole) FindByUser(user *User) (*UserRole, error)
- func (this *UserRole) FindByUserAndAuthority(user *User, autority string) (*UserRole, error)
- func (this *UserRole) FindByUserAndRole(user *User, role *Role) (*UserRole, error)
- func (this *UserRole) FindRoleByUser(user *User) *Role
- func (this *UserRole) HasRoles(user *User, roles ...string) bool
- func (this *UserRole) IsPersisted() bool
- func (this *UserRole) TableName() string
Constants ¶
This section is empty.
Variables ¶
View Source
var (
UserHexPassword = false
)
Functions ¶
func OnUserHexPassword ¶
func OnUserHexPassword()
Types ¶
type App ¶
type App struct {
Id int64 `form:"-" json:",string,omitempty"`
CreatedAt time.Time `orm:"auto_now_add;type(datetime)" json:"-"`
UpdatedAt time.Time `orm:"auto_now;type(datetime)"`
Name string `orm:"size(50)" valid:"Required;MinSize(2);MaxSize(50)" form:"" json:""`
Token string `orm:"size(200)" valid:"Required;MaxSize(200)" form:"" json:""`
LastLogin time.Time `orm:"type(datetime);null" json:""`
Tenant *Tenant `orm:"rel(fk);on_delete(do_nothing)" valid:"" form:"" goutils:"tenant"`
Session *db.Session `orm:"-" json:"-"`
Count int64 `orm:"-"`
}
func (*App) IsPersisted ¶
type Auditor ¶
type Auditor struct {
Id int64 `form:"-" json:",string,omitempty"`
CreatedAt time.Time `orm:"auto_now_add;type(datetime)"`
UpdatedAt time.Time `orm:"auto_now;type(datetime)" json:"-"`
Content string `orm:"type(text)" valid:"Required;MaxSize(300)" form:""`
Tenant *Tenant `orm:"null;rel(fk);on_delete(do_nothing)" valid:""`
User *User `orm:"null;rel(fk);on_delete(do_nothing)"`
Session *db.Session `orm:"-" inject:""`
}
func NewAuditor ¶
func NewAuditorWithTenant ¶
func (*Auditor) IsPersisted ¶
func (*Auditor) ListByTenant ¶
func (*Auditor) LoadRelated ¶
type Cidade ¶
type Cidade struct {
Id int64 `form:"-" json:",string,omitempty"`
Nome string `orm:"size(100)" valid:"Required;MaxSize(100)" form:""`
Estado *Estado `orm:"rel(fk);on_delete(do_nothing)" valid:"Required;" form:""`
Session *db.Session `orm:"-" json:"-" inject:""`
}
func (*Cidade) FindByNameAndEstado ¶
func (*Cidade) FindByNameAndEstadoUf ¶
func (*Cidade) IsPersisted ¶
func (*Cidade) LoadRelated ¶
type Email ¶
type Email struct {
Id int64 `form:"-" json:",string,omitempty"`
CreatedAt time.Time `orm:"auto_now_add;type(datetime)" json:"-"`
UpdatedAt time.Time `orm:"auto_now;type(datetime)" json:"-"`
To string `orm:"type(text)" valid:"Required;MaxSize(500)"`
Cco string `orm:"type(text)" valid:"Required;MaxSize(500)"`
Subject string `orm:"type(text)" valid:"Required;MaxSize(200)"`
Body string `orm:"type(text)" valid:"Required;"`
Enabled bool `orm:"" valid:"" `
Tenant *Tenant `orm:"rel(fk);on_delete(do_nothing)" form:"" goutils:"tenant"`
Session *db.Session `orm:"-"`
}
func (*Email) CreateOnly ¶
func (*Email) CreateWithCco ¶
func (*Email) CreateWithCcoOnly ¶
func (*Email) IsPersisted ¶
type Estado ¶
type Estado struct {
Id int64 `form:"-" json:",string,omitempty"`
Nome string `orm:"size(100)" valid:"Required;MaxSize(100)" form:""`
Uf string `orm:"size(2)" valid:"Required;MaxSize(2)" form:""`
Session *db.Session `orm:"-" json:"-" inject:""`
}
func (*Estado) IsPersisted ¶
type Role ¶
type Role struct {
Id int64 `form:"-" json:",string,omitempty"`
CreatedAt time.Time `orm:"auto_now_add;type(datetime)" json:"-"`
UpdatedAt time.Time `orm:"auto_now;type(datetime)" json:"-"`
Authority string `orm:"size(50)"`
Description string `orm:"size(100)"`
Session *db.Session `orm:"-" inject:""`
}
func (*Role) FindByAuthority ¶
func (*Role) FindByAuthorityOrNil ¶
func (*Role) IsPersisted ¶
type Tenant ¶
type Tenant struct {
Id int64 `form:"-" json:",string,omitempty"`
CreatedAt time.Time `orm:"auto_now_add;type(datetime)" json:"-"`
UpdatedAt time.Time `orm:"auto_now;type(datetime)" json:"-"`
Name string `orm:"size(100)" valid:"Required;MaxSize(100)" form:""`
Documento string `orm:"size(20)" valid:"Required;MaxSize(14);MinSize(11)" form:""`
Enabled bool `orm:"" form:"" json:",string"`
Uuid string `orm:"size(100);unique" valid:"MaxSize(100)" form:"-" json:""`
Cidade *Cidade `orm:"rel(fk);on_delete(do_nothing)" valid:"RequiredRel" form:""`
Session *db.Session `orm:"-" json:"-" inject:""`
}
func NewTenantWithId ¶
func (*Tenant) FindByDocumento ¶
func (*Tenant) GenereteUuid ¶
func (*Tenant) GetByUuidAndEnabled ¶
func (*Tenant) IsPersisted ¶
func (*Tenant) LoadRelated ¶
type TenantUser ¶
type TenantUser struct {
Id int64 `form:"-" json:",string,omitempty"`
CreatedAt time.Time `orm:"auto_now_add;type(datetime)" json:"-"`
UpdatedAt time.Time `orm:"auto_now;type(datetime)" json:"-"`
Enabled bool `orm:"" valid:"Required;" form:"" json:",string,omitempty"`
Tenant *Tenant `orm:"rel(fk);on_delete(do_nothing)" valid:"Required" form:"" goutils:"no_set_tenant;no_filter_tenant"`
User *User `orm:"rel(fk);on_delete(do_nothing)" valid:"Required" form:",select"`
Admin bool `orm:"" valid:"Required;" form:"" json:",string,omitempty"`
Session *db.Session `orm:"-" inject:""`
}
func NewTenantUser ¶
func NewTenantUser(session *db.Session) *TenantUser
func (*TenantUser) FindByAdminUserAndTenant ¶
func (this *TenantUser) FindByAdminUserAndTenant(user *User, tenant *Tenant) (*TenantUser, error)
func (*TenantUser) FindByUserAndTenant ¶
func (this *TenantUser) FindByUserAndTenant(user *User, tenant *Tenant) (*TenantUser, error)
func (*TenantUser) GetFirstTenant ¶
func (this *TenantUser) GetFirstTenant(user *User) (*Tenant, error)
func (*TenantUser) HasActiveTenant ¶
func (this *TenantUser) HasActiveTenant(user *User) (bool, error)
func (*TenantUser) IsPersisted ¶
func (this *TenantUser) IsPersisted() bool
func (*TenantUser) List ¶
func (this *TenantUser) List() (*[]*TenantUser, error)
func (*TenantUser) ListActivesByTenant ¶
func (this *TenantUser) ListActivesByTenant(tenant *Tenant) (*[]*TenantUser, error)
func (*TenantUser) ListActivesByUser ¶
func (this *TenantUser) ListActivesByUser(user *User) (*[]*TenantUser, error)
func (*TenantUser) ListByTenant ¶
func (this *TenantUser) ListByTenant(tenant *Tenant) (*[]*TenantUser, error)
func (*TenantUser) ListByUser ¶
func (this *TenantUser) ListByUser(user *User) (*[]*TenantUser, error)
func (*TenantUser) ListByUserAdmin ¶
func (this *TenantUser) ListByUserAdmin(user *User) (*[]*TenantUser, error)
func (*TenantUser) ListTenantsActivesByUser ¶
func (this *TenantUser) ListTenantsActivesByUser(user *User) ([]*Tenant, error)
func (*TenantUser) ListTenantsByUser ¶
func (this *TenantUser) ListTenantsByUser(user *User) ([]*Tenant, error)
func (*TenantUser) ListUsersActivesByTenant ¶
func (this *TenantUser) ListUsersActivesByTenant(tenant *Tenant) ([]*User, error)
func (*TenantUser) ListUsersByTenant ¶
func (this *TenantUser) ListUsersByTenant(tenant *Tenant) ([]*User, error)
func (*TenantUser) LoadRelated ¶
func (this *TenantUser) LoadRelated(entity *TenantUser)
func (*TenantUser) RemoveAllByTenant ¶
func (this *TenantUser) RemoveAllByTenant(tenant *Tenant) error
func (*TenantUser) RemoveAllByUser ¶
func (this *TenantUser) RemoveAllByUser(user *User) error
func (*TenantUser) TableName ¶
func (this *TenantUser) TableName() string
func (*TenantUser) ToTenants ¶
func (this *TenantUser) ToTenants(results []*TenantUser) []*Tenant
func (*TenantUser) ToUsers ¶
func (this *TenantUser) ToUsers(results []*TenantUser) []*User
type User ¶
type User struct {
Id int64 `form:"-" json:",string,omitempty"`
CreatedAt time.Time `orm:"auto_now_add;type(datetime)" json:"-"`
UpdatedAt time.Time `orm:"auto_now;type(datetime)" json:"-"`
Name string `orm:"size(100)" valid:"Required;MaxSize(100)" form:"" json:""`
UserName string `orm:"size(100);unique" valid:"Required;MaxSize(100);Email" form:""`
Password string `orm:"size(100)" valid:"MaxSize(100)" form:"" json:"-"`
Enabled bool `orm:"" valid:"Required;" form:"" json:""`
LastLogin time.Time `orm:"null;type(datetime)"`
ExpirationDate time.Time `orm:"type(datetime);null" form:"-" json:"-"`
Token string `orm:"type(text);null" valid:"" form:"-" json:"-"`
Uuid string `orm:"size(100);unique" valid:"MaxSize(100)" form:"-" json:""`
ChangePwdExpirationDate time.Time `orm:"type(datetime);null" form:"-" json:"-"`
ChangePwdToken string `orm:"type(text);null" valid:"MaxSize(256)" form:"-" json:"-"`
Tenant *Tenant `orm:"rel(fk);on_delete(do_nothing)" valid:"" form:"" goutils:"no_set_tenant;no_filter_tenant"`
Role *Role `orm:"-"`
Roles *[]*Role `orm:"-"`
Session *db.Session `orm:"-" json:"-" inject:""`
}
func (*User) ChangePassword ¶
func (*User) EncodePassword ¶
func (this *User) EncodePassword()
func (*User) GenerateToken ¶
func (*User) GenereteUuid ¶
func (*User) GetAuthorities ¶
func (*User) GetByChangePwdToken ¶
func (*User) GetByUuidAndEnabled ¶
func (*User) IsPersisted ¶
func (*User) IsSamePassword ¶
func (*User) LoadIfExists ¶
func (*User) LoadRelated ¶
func (*User) PageByTenant ¶
func (*User) UpdateLastLogin ¶
type UserRole ¶
type UserRole struct {
Id int64 `form:"-" json:",string,omitempty"`
CreatedAt time.Time `orm:"auto_now_add;type(datetime)" json:"-"`
UpdatedAt time.Time `orm:"auto_now;type(datetime)" json:"-"`
User *User `orm:"rel(fk)"`
Role *Role `orm:"rel(fk)"`
Session *db.Session `orm:"-" inject:""`
}
func NewUserRole ¶
func NewUserRoleWithRole ¶
func (*UserRole) FindAllByRole ¶
func (*UserRole) FindAllByUser ¶
func (*UserRole) FindAllRolesByUser ¶
func (*UserRole) FindByUserAndAuthority ¶
func (*UserRole) FindByUserAndRole ¶
func (*UserRole) FindRoleByUser ¶
func (*UserRole) IsPersisted ¶
Click to show internal directories.
Click to hide internal directories.