Documentation ¶
Index ¶
- Variables
- func ConnectDatabase()
- func ConnectMysql(dsn string) (database *gorm.DB, err error)
- func ConnectPostgres(dsn string) (database *gorm.DB, err error)
- func ConnectSqlServer(dsn string) (database *gorm.DB, err error)
- func ConnectSqlite(dsn string) (database *gorm.DB, err error)
- func HandleIsFree(path string, domain string) (bool, string)
- func Paginate(value interface{}, pagination *Pagination, db *gorm.DB) func(db *gorm.DB) *gorm.DB
- type Base
- type CollectedPage
- type Handler
- type HandlerRbac
- type Pagination
- type PermisionType
- type User
- type XssHit
Constants ¶
This section is empty.
Variables ¶
View Source
var DB *gorm.DB
Functions ¶
func ConnectDatabase ¶
func ConnectDatabase()
func ConnectPostgres ¶ added in v0.1.3
func ConnectSqlServer ¶ added in v0.1.3
Types ¶
type CollectedPage ¶
type Handler ¶
type Handler struct { gorm.Model Path string `gorm:"size:255;not null"` Domain string `gorm:"default:*"` OwnerID int Owner User `json:"-"` Screenshot bool Dom bool CollectedPages []string `gorm:"serializer:json"` Members []HandlerRbac `gorm:"foreignKey:HandlerID"` }
func GetHandlerById ¶
func GetHandlerById(id interface{}) (handler Handler)
func GetViewableHandlers ¶
func (*Handler) GetRoleForUser ¶
type HandlerRbac ¶
type HandlerRbac struct { gorm.Model UserID int HandlerID int User User Permission PermisionType Handler Handler }
func GetHandleRbacForUser ¶
func GetHandleRbacForUser(userId int) (rbacs []HandlerRbac)
type Pagination ¶
type Pagination struct { Limit int `json:"limit" form:"limit"` Page int `json:"page" form:"page"` TotalRows int `json:"total_rows"` TotalPages int `json:"total_pages"` Rows interface{} `json:"rows"` }
func (*Pagination) GetLimit ¶
func (p *Pagination) GetLimit() int
func (*Pagination) GetOffset ¶
func (p *Pagination) GetOffset() int
func (*Pagination) GetPage ¶
func (p *Pagination) GetPage() int
type PermisionType ¶
type PermisionType string
const ( READ PermisionType = "READ" WRITE PermisionType = "WRITE" OWNER PermisionType = "OWNER" )
func (*PermisionType) Scan ¶
func (t *PermisionType) Scan(value interface{}) error
type User ¶
type User struct { ID uint `gorm:"primaryKey"` CreatedAt time.Time `json:"-"` UpdatedAt time.Time `json:"-"` DeletedAt gorm.DeletedAt `gorm:"index" json:"-"` Email string `gorm:"size:255;not null;unique"` Username string `gorm:"size:255;not null;unique"` Password string `gorm:"size:255;not null;" json:"-"` IsAdmin bool `gorm:"default:false"` HandlersRbac []HandlerRbac `json:"-"` NotifiersConfig map[string]string `gorm:"serializer:json" json:"-"` OTPEnabled bool `gorm:"default:false"` OTPSecret string `gorm:"size:16;not null;" json:"-"` }
func GetUserByEmail ¶
func GetUserById ¶
func GetUsersByEmail ¶
func (*User) CheckPassword ¶
func (*User) HandlerRbacs ¶
func (u *User) HandlerRbacs() []HandlerRbac
func (*User) SetPassword ¶
type XssHit ¶
type XssHit struct { gorm.Model Ip string Referer string UserAgent string Origin string CorrelationKey string `gorm:"not null"` PublicId string Cookies string LocalStorage string SessionStorage string Url string Dom string Screenshot string OwnerID int Owner User `json:"-"` HandlerID int Handler Handler `json:"-"` CollectedPages []CollectedPage }
func GetHitByCorrelationKey ¶
func GetHitBySharingKey ¶
func GetViewableHitPaginated ¶
func GetViewableHitPaginated(user_id int, pagination *Pagination) (hits []XssHit)
func (*XssHit) DisableSharing ¶
func (hit *XssHit) DisableSharing()
func (*XssHit) EnableSharing ¶
func (hit *XssHit) EnableSharing()
Click to show internal directories.
Click to hide internal directories.