models

package
v0.0.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 17, 2023 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DB *gorm.DB

Functions

func ConnectDatabase

func ConnectDatabase()

Types

type AuthorizedMethods

type AuthorizedMethods struct {
	Data []string
}

type ErrorMessage

type ErrorMessage struct {
	Error string `json:"error"`
}

type Group

type Group struct {
	ID        uint      `json:"id" gorm:"primary_key; not null; autoIncrement"`
	Name      string    `json:"name" gorm:"not null"  binding:"required"`
	CreatedAt time.Time `gorm:"not null"`
	UpdatedAt time.Time `gorm:"not null"`
}

type GroupUpdate

type GroupUpdate struct {
	ID        uint      `json:"id,omitempty"`
	Name      string    `json:"name,omitempty"`
	CreatedAt time.Time `json:"created_at,omitempty"`
	UpdatedAt time.Time `json:"updated_at,omitempty"`
}

type Language

type Language struct {
	ID         int       `json:"id" gorm:"primary_key; not null"`
	Name       string    `json:"name" gorm:"not null"  binding:"required"`
	Created_by uint      `json:"created_by" gorm:"not null"  binding:"required"`
	CreatedAt  time.Time `json:"created"`
	UpdatedAt  time.Time `json:"updated"`
}

type LanguageUpdate

type LanguageUpdate struct {
	ID         int    `json:"id,omitempty"`
	Name       string `json:"name,omitempty"`
	Created_by uint   `json:"created_by,omitempty"`
}

type Policy

type Policy struct {
	ID                uint   `json:"id" gorm:"primary_key,not null,auto_increment"`
	Name              string `json:"name" binding:"required" gorm:"not null"`
	Path              string `json:"path" binding:"required" gorm:"not null"`
	AuthorizedMethods string `json:"authorizedMethods" binding:"required" gorm:"not null"`
}

type PolicyUpdate

type PolicyUpdate struct {
	ID                uint   `json:"id,omitempty"`
	Name              string `json:"name,omitempty"`
	Path              string `json:"path,omitempty"`
	AuthorizedMethods string `json:"authorizedMethods,omitempty"`
}

type Project

type Project struct {
	ID         uint      `json:"id" gorm:"primary_key; not null"`
	Name       string    `json:"name" gorm:"not null"  binding:"required"`
	Created_by string    `json:"created_by" gorm:"not null"  binding:"required"`
	Language   string    `json:"language" gorm:"not null"  binding:"required"`
	CreatedAt  time.Time `gorm:"not null"`
	UpdatedAt  time.Time `gorm:"not null"`
}

type ProjectUpdate

type ProjectUpdate struct {
	ID         uint   `json:"id,omitempty"`
	Name       string `json:"name,omitempty"`
	Created_by string `json:"created_by,omitempty"`
	Language   string `json:"language,omitempty"`
}

type Role

type Role struct {
	ID       uint   `json:"id" gorm:"primary_key,not null,auto_increment"`
	Name     string `json:"name" binding:"required" gorm:"not null"`
	Policies string `json:"policies" binding:"required" gorm:"not null"`
}

type RoleUpdate

type RoleUpdate struct {
	ID       uint   `json:"id,omitempty"`
	Name     string `json:"name,omitempty"`
	Policies string `json:"policies,omitempty"`
}

type SuccessFindGroup

type SuccessFindGroup struct {
	Data Project `json:"data"`
}

type SuccessFindGroups

type SuccessFindGroups struct {
	Data []Project `json:"data"`
}

type SuccessFindLanguage

type SuccessFindLanguage struct {
	Data Project `json:"data"`
}

type SuccessFindLanguages

type SuccessFindLanguages struct {
	Data []Project `json:"data"`
}

type SuccessFindPolicies

type SuccessFindPolicies struct {
	Data []Policy `json:"data"`
}

type SuccessFindProject

type SuccessFindProject struct {
	Data Project `json:"data"`
}

type SuccessFindProjects

type SuccessFindProjects struct {
	Data []Project `json:"data"`
}

type SuccessFindRoles

type SuccessFindRoles struct {
	Data []Role `json:"data"`
}

type SuccessFindUser

type SuccessFindUser struct {
	Data User `json:"data"`
}

type SuccessFindUsers

type SuccessFindUsers struct {
	Data []User `json:"data"`
}

type SuccessGroupCreation

type SuccessGroupCreation struct {
	Data Project `json:"data"`
}

type SuccessGroupDelete

type SuccessGroupDelete struct {
	Data bool `json:"data"`
}

type SuccessGroupUpdate

type SuccessGroupUpdate struct {
	Data Project `json:"data"`
}

type SuccessLanguageCreation

type SuccessLanguageCreation struct {
	Data Project `json:"data"`
}

type SuccessLanguageDelete

type SuccessLanguageDelete struct {
	Data bool `json:"data"`
}

type SuccessLanguageUpdate

type SuccessLanguageUpdate struct {
	Data Project `json:"data"`
}

type SuccessMessages

type SuccessMessages struct {
	Message string `json:"message"`
}

type SuccessPolicyCreation

type SuccessPolicyCreation struct {
	Data Policy `json:"data"`
}

type SuccessPolicyDelete

type SuccessPolicyDelete struct {
	Data bool `json:"data"`
}

type SuccessPolicyUpdate

type SuccessPolicyUpdate struct {
	Data Policy `json:"data"`
}

type SuccessProjectCreation

type SuccessProjectCreation struct {
	Data Project `json:"data"`
}

type SuccessProjectDelete

type SuccessProjectDelete struct {
	Data bool `json:"data"`
}

type SuccessProjectUpdate

type SuccessProjectUpdate struct {
	Data Project `json:"data"`
}

type SuccessRoleCreation

type SuccessRoleCreation struct {
	Data Role `json:"data"`
}

type SuccessRoleDelete

type SuccessRoleDelete struct {
	Data bool `json:"data"`
}

type SuccessRoleUpdate

type SuccessRoleUpdate struct {
	Data Role `json:"data"`
}

type SuccessUserCreation

type SuccessUserCreation struct {
	Data User `json:"data"`
}

type SuccessUserDelete

type SuccessUserDelete struct {
	Data bool `json:"data"`
}

type SuccessUserUpdate

type SuccessUserUpdate struct {
	Data User `json:"data"`
}

type TokenRefresh

type TokenRefresh struct {
	Token string `json:"token"`
}

type TokenRequest

type TokenRequest struct {
	Mail     string `json:"mail"`
	Password string `json:"password"`
}

type TokenResponse

type TokenResponse struct {
	Token string `json:"token"`
}

type User

type User struct {
	ID        uint      `json:"id" gorm:"primary_key; not null"`
	Name      string    `json:"name" binding:"required"`
	Lastname  string    `json:"lastname" binding:"required"`
	Username  string    `json:"username" gorm:"not null; unique" binding:"required"`
	Mail      string    `json:"mail" gorm:"not null; unique" binding:"required"`
	Password  string    `json:"-" binding:"required"`
	Role      string    `json:"role" binding:"required"`
	Group     int       `json:"group" binding:"required"`
	State     bool      `json:"state" binding:"required"`
	CreatedAt time.Time `gorm:"not null"`
	UpdatedAt time.Time `gorm:"not null"`
}

func (*User) CheckPassword

func (user *User) CheckPassword(providedPassword string) error

type UserCreate added in v0.0.3

type UserCreate struct {
	ID        uint      `json:"id" gorm:"primary_key; not null"`
	Name      string    `json:"name" binding:"required"`
	Lastname  string    `json:"lastname" binding:"required"`
	Username  string    `json:"username" gorm:"not null; unique" binding:"required"`
	Mail      string    `json:"mail" gorm:"not null; unique" binding:"required"`
	Password  string    `json:"password" binding:"required"`
	Role      string    `json:"role" binding:"required"`
	Group     int       `json:"group" binding:"required"`
	State     bool      `json:"state" binding:"required"`
	CreatedAt time.Time `gorm:"not null"`
	UpdatedAt time.Time `gorm:"not null"`
}

func (*UserCreate) HashPassword added in v0.0.3

func (user *UserCreate) HashPassword(password string) error

type UserUpdate

type UserUpdate struct {
	ID       uint   `json:"id,omitempty"`
	Name     string `json:"name,omitempty"`
	Lastname string `json:"lastname,omitempty"`
	Username string `json:"username,omitempty"`
	Mail     string `json:"mail,omitempty"`
	Password string `json:"password,omitempty"`
	Role     string `json:"role,omitempty"`
	Group    int    `json:"group,omitempty"`
	State    bool   `json:"state,omitempty"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL