models

package
v0.0.0-...-c2f43af Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2024 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Event

type Event struct {
	ID            int64  `xorm:"pk autoincr" db:"id"`
	Name          string `db:"name"`
	EventType     string `db:"event_type"`
	ThumbnailURL  string `db:"thumbnail_url"`
	Source        string `db:"source"`
	SourceURL     string `db:"source_url"`
	Time          string `db:"time"`
	Severity      string `db:"severity"`
	SeverityClass string `db:"severity_class"`
	Description   string `db:"description"`
	Roles         string `db:"roles"` // Changed to string, seperated by a semi-colon ";"
}

Event represents an event with various attributes and roles

func (*Event) TableName

func (e *Event) TableName() string

TableName returns the table name for the Event model

type Role

type Role struct {
	ID          int64  `xorm:"pk autoincr" db:"id"`
	Name        string `xorm:"unique" db:"name"`
	Description string `db:"description"`
	Permissions string `xorm:"json" db:"permissions"` // Changed to string, seperated by a semi-colon ";"
}

Role represents a role with permissions

func (*Role) TableName

func (r *Role) TableName() string

TableName returns the table name for the Role model

type Server

type Server struct {
	ID           int64     `xorm:"pk autoincr" db:"id"`
	Name         string    `db:"name"`
	Type         string    `db:"type"`
	URL          string    `db:"url"`
	Roles        string    `db:"roles"` // Changed to string, seperated by a semi-colon ";"
	CreatedAt    time.Time `xorm:"created" db:"created_at"`
	UpdatedAt    time.Time `xorm:"updated" db:"updated_at"`
	Description  string    `db:"description"`
	Status       string    `db:"status"`
	IPAddress    string    `db:"ip_address"`
	Location     string    `db:"location"`
	PublicKey    string    `db:"public_key"`
	MAC          string    `db:"mac"`
	Model        string    `db:"model"`
	Manufacturer string    `db:"manufacturer"`
}

Server represents a server with various attributes and roles

func (*Server) TableName

func (s *Server) TableName() string

TableName returns the table name for the Server model

type User

type User struct {
	ID        int64     `xorm:"pk autoincr" db:"id"`
	Email     string    `xorm:"unique" db:"email"`
	Name      string    `db:"name"`
	RoleID    int64     `xorm:"index" db:"role_id"`
	Role      Role      `xorm:"role" db:"role"`
	CreatedAt time.Time `xorm:"created" db:"created_at"`
	UpdatedAt time.Time `xorm:"updated" db:"updated_at"`
}

User represents a user with role and timestamps

func (*User) TableName

func (u *User) TableName() string

TableName returns the table name for the User model

Jump to

Keyboard shortcuts

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