database

package
v0.0.0-...-777ca84 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DB *gorm.DB

Functions

func ConnectDB

func ConnectDB()

Types

type AssignedRules

type AssignedRules struct {
	gorm.Model
	RuleID    uint   `json:"rule_id"`
	Rule      Rule   `gorm:"constraint:OnDelete:CASCADE;"`
	UserID    uint   `json:"user_id"`
	User      User   `gorm:"constraint:OnDelete:CASCADE;"`
	MetaValue string `json:"meta_value"`
}

type HTTPMethod

type HTTPMethod struct {
	gorm.Model
	Method string `gorm:"uniqueIndex;unique;not null" json:"method"`
}

type MetaLocation

type MetaLocation struct {
	gorm.Model
	MetaLocation string `gorm:"uniqueIndex;unique;not null" json:"meta_location"`
}

type Rule

type Rule struct {
	gorm.Model     `yaml:"-"`
	Path           string       `gorm:"index;not null" json:"path" yaml:"Path"`
	MetaKey        string       `json:"meta_key" yaml:"MetaKey"`
	PathPrefix     bool         `gorm:"default:false" json:"path_prefix" yaml:"path_prefix"`
	MetaLocationID uint         `json:"meta_location_id" yaml:"MetaLocationID"`
	MetaLocation   MetaLocation `gorm:"constraint:OnDelete:CASCADE;" yaml:"-"`
	HTTPMethodID   uint         `json:"http_method_id" yaml:"HTTPMethodID"`
	HTTPMethod     HTTPMethod   `gorm:"constraint:OnDelete:CASCADE;" yaml:"-"`
}

type User

type User struct {
	gorm.Model
	Username string `gorm:"uniqueIndex;unique;not null" json:"username"`
	Email    string `gorm:"uniqueIndex;unique;not null" json:"email"`
	Password string `gorm:"not null" json:"-"`
}

Jump to

Keyboard shortcuts

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