Documentation
¶
Index ¶
- func GetSqlDB(dataSourceName string) (*sql.DB, error)
- type Logg
- type Permission
- type Role
- type SqlContext
- func (s *SqlContext) CreateInitialAdmin() error
- func (s *SqlContext) CreateInitialPermissions() error
- func (s *SqlContext) CreateInitialRoles() error
- func (a *SqlContext) CreateLog(logs Logg) (Logg, error)
- func (a *SqlContext) CreatePermission(permission Permission) (Permission, error)
- func (a *SqlContext) CreateRole(role Role) (Role, error)
- func (s *SqlContext) CreateTables()
- func (a *SqlContext) CreateToken(user User, expire_in time.Duration) (interface{}, error)
- func (a *SqlContext) CreateUser(username, lastname, firstname, email, password string, role_id int) (User, error)
- func (a *SqlContext) DeletePermission(resourceName string, roleCode int) error
- func (s *SqlContext) DropTables()
- func (a *SqlContext) GetLog4Period(date1, date2 time.Time) ([]Logg, error)
- func (a *SqlContext) GetLogs() ([]Logg, error)
- func (a *SqlContext) GetPermission(resource_name string, role_code int) (Permission, error)
- func (a *SqlContext) GetPermissions() ([]Permission, error)
- func (a *SqlContext) GetRole(code int) (Role, error)
- func (a *SqlContext) GetRoles() ([]Role, error)
- func (a *SqlContext) GetToken(tokenvalue string) (Token, error)
- func (a *SqlContext) GetUser(id string) (User, error)
- func (a *SqlContext) GetUserByCredentials(username, password string) (User, error)
- func (a *SqlContext) GetUsers() ([]User, error)
- func (s *SqlContext) InitBDD()
- func (s *SqlContext) InitTables()
- func (a *SqlContext) IsAuthorized4Token(tokenValue, resourceName, resourceId string) error
- func (a *SqlContext) IsPermitted4User(userRole Role, userId, username, resourceName, resourceParam string) bool
- func (a *SqlContext) PutUser(id, lastname, firstname, email, password string) (User, error)
- func (a *SqlContext) UnactivateUser(id string) error
- type Token
- type User
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Permission ¶
type SqlContext ¶
func GetSqlContext ¶
func GetSqlContext(dataSourceName string, initDB bool) (SqlContext, error)
func (*SqlContext) CreateInitialAdmin ¶
func (s *SqlContext) CreateInitialAdmin() error
func (*SqlContext) CreateInitialPermissions ¶
func (s *SqlContext) CreateInitialPermissions() error
func (*SqlContext) CreateInitialRoles ¶
func (s *SqlContext) CreateInitialRoles() error
func (*SqlContext) CreatePermission ¶
func (a *SqlContext) CreatePermission(permission Permission) (Permission, error)
func (*SqlContext) CreateRole ¶
func (a *SqlContext) CreateRole(role Role) (Role, error)
func (*SqlContext) CreateTables ¶
func (s *SqlContext) CreateTables()
func (*SqlContext) CreateToken ¶
func (a *SqlContext) CreateToken(user User, expire_in time.Duration) (interface{}, error)
func (*SqlContext) CreateUser ¶
func (a *SqlContext) CreateUser(username, lastname, firstname, email, password string, role_id int) (User, error)
func (*SqlContext) DeletePermission ¶
func (a *SqlContext) DeletePermission(resourceName string, roleCode int) error
func (*SqlContext) DropTables ¶
func (s *SqlContext) DropTables()
func (*SqlContext) GetLog4Period ¶
func (a *SqlContext) GetLog4Period(date1, date2 time.Time) ([]Logg, error)
func (*SqlContext) GetLogs ¶
func (a *SqlContext) GetLogs() ([]Logg, error)
func (*SqlContext) GetPermission ¶
func (a *SqlContext) GetPermission(resource_name string, role_code int) (Permission, error)
func (*SqlContext) GetPermissions ¶
func (a *SqlContext) GetPermissions() ([]Permission, error)
func (*SqlContext) GetRoles ¶
func (a *SqlContext) GetRoles() ([]Role, error)
func (*SqlContext) GetUserByCredentials ¶
func (a *SqlContext) GetUserByCredentials(username, password string) (User, error)
func (*SqlContext) GetUsers ¶
func (a *SqlContext) GetUsers() ([]User, error)
func (*SqlContext) InitBDD ¶
func (s *SqlContext) InitBDD()
func (*SqlContext) InitTables ¶
func (s *SqlContext) InitTables()
func (*SqlContext) IsAuthorized4Token ¶
func (a *SqlContext) IsAuthorized4Token(tokenValue, resourceName, resourceId string) error
func (*SqlContext) IsPermitted4User ¶
func (a *SqlContext) IsPermitted4User(userRole Role, userId, username, resourceName, resourceParam string) bool
func (*SqlContext) PutUser ¶
func (a *SqlContext) PutUser(id, lastname, firstname, email, password string) (User, error)
func (*SqlContext) UnactivateUser ¶
func (a *SqlContext) UnactivateUser(id string) error
type Token ¶
type User ¶
type User struct {
Id string `json:"id"`
Username string `json:"username"`
Lastname string `json:"lastname"`
Firstname string `json:"firstname"`
Email string `json:"email"`
Password []byte `json:"password"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
Activated bool `json:"activated"`
Role_id int `json:"role_id"` //foreign key with role table
}
Click to show internal directories.
Click to hide internal directories.