model

package
v0.0.0-...-fb9bc76 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultCategories = map[string][]string{
	"General Beacon Reports": {
		"Connection issues, error code while connecting, etc.",
		"Certain features are not working, i.e. cannot comment",
		"Gameplay issues, i.e. cannot dive in, broken peer to peer",
		"Website issues, cannot use certain features, or offline",
	},
	"Other Report Types": {
		"LBP issue, i.e. game crash, graphics bugs, etc.",
	},
}
View Source
var Priorities = map[string]uint{
	"low":    1,
	"medium": 2,
	"high":   3,
}
View Source
var ValidPlatforms = map[string]struct{}{
	"PlayStation 3":                        {},
	"PlayStation Vita":                     {},
	"RPCS3":                                {},
	"Web: Safari":                          {},
	"Web: Google Chrome or Chromium Based": {},
	"Web: Firefox":                         {},
	"Web: Other":                           {},
}

Functions

This section is empty.

Types

type Ban

type Ban struct {
	IP      netip.Addr
	Reason  string
	EndDate time.Time
}

type Comment

type Comment struct {
	ID uint `gorm:"primarykey" json:"-"`

	// Username of whoever posted it, keeping it simple here
	Poster       string `json:"poster"`
	PosterAvatar string `json:"poster_avatar"`

	ReportID uint `json:"-"`

	CreateTime time.Time `json:"-"`

	// The actual body of the comment
	Content string `json:"content"`
}

func (*Comment) MarshalJSON

func (d *Comment) MarshalJSON() ([]byte, error)

type LighthouseError

type LighthouseError struct {
	Type    string
	Title   string
	Status  int
	TraceId string
}

type LighthouseUser

type LighthouseUser struct {
	UserId               uint
	Username             string
	EmailAddressVerified bool
	IconHash             string
	Biography            string
	YayHash              string
	BooHash              string
	MehHash              string
	LastLogin            int
	LastLogout           int
	LevelVisibility      int
	ProfileVisibility    int
	CommentEnabled       bool
}

type Notice

type Notice struct {
	ID         uint      `gorm:"primarykey"`
	Status     string    `json:"status"`
	NoticeText string    `json:"notice_text"`
	Date       time.Time `json:"date"`
	Ended      bool      `json:"-"`
}

type Report

type Report struct {
	// ID is for indexing, UUID is so that people can't sequentially guess reports
	ID               uint `gorm:"primarykey"`
	UUID             string
	Title            string
	Username         string
	UserID           uint
	Avatar           string `gorm:"-"`
	Type             string
	Platform         string
	Description      string
	Resolved         bool
	Evidence         bool
	Read             bool
	SubmitterIP      string
	SubmitTime       time.Time `gorm:"autoCreateTime"`
	Comments         []Comment
	Priority         uint
	DiscordMessageID string
}

func (*Report) BeforeCreate

func (r *Report) BeforeCreate(tx *gorm.DB) error

type ReportCategory

type ReportCategory struct {
	ID       int `gorm:"primarykey"`
	Name     string
	Archived bool
	Types    []ReportType
}

type ReportType

type ReportType struct {
	ID               uint `gorm:"primarykey"`
	Name             string
	Archived         bool
	ReportCategoryID uint
}

type Session

type Session struct {
	ID         string    `gorm:"primarykey" json:"-"`
	Username   string    `json:"login"`
	OAuthToken string    `json:"-"`
	AvatarURL  string    `json:"avatar_url"`
	Expires    time.Time `json:"-"`
}

func (*Session) BeforeCreate

func (s *Session) BeforeCreate(tx *gorm.DB) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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