models

package
v0.0.0-...-679a743 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2020 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type OnionCategory

type OnionCategory struct {
	gorm.Model
	l10n.Locale
	sorting.Sorting
	Name string `gorm:"index:name"`
	Code string `gorm:"index:code"`

	Categories []OnionCategory
	CategoryID uint `gorm:"index:category_id"`
}

func (OnionCategory) DefaultPath

func (category OnionCategory) DefaultPath() string

func (OnionCategory) Validate

func (category OnionCategory) Validate(db *gorm.DB)
type OnionLink struct {
	gorm.Model
	URL            string
	Name           string `gorm:"size:255;unique" json:"href" yaml:"href"`
	Healthy        bool   `json:"healthy" yaml:"healthy"`
	OnionServiceID uint   `json:"-" yaml:"-"`
}

func (*OnionLink) BeforeCreate

func (ol *OnionLink) BeforeCreate() (err error)

func (OnionLink) Validate

func (ol OnionLink) Validate(db *gorm.DB)

type OnionPublicKey

type OnionPublicKey struct {
	gorm.Model
	UID         string `gorm:"primary_key" json:"id,omitempty" yaml:"id,omitempty"`
	UserID      string `json:"user_id,omitempty" yaml:"user_id,omitempty"`
	Fingerprint string `json:"fingerprint,omitempty" yaml:"fingerprint,omitempty"`
	Description string `json:"description,omitempty" yaml:"description,omitempty"`
	Value       string `json:"value" yaml:"value"`
	ServiceID   uint   `json:"-" yaml:"-"`
}

type OnionService

type OnionService struct {
	gorm.Model
	Name              string    `json:"name" yaml:"name"`
	NameWithSlug      slug.Slug `l10n:"sync"`
	MainImage         media_library.MediaBox
	Featured          bool
	CategoryID        uint              `l10n:"sync" gorm:"index:category_id"`
	Category          OnionCategory     `l10n:"sync"`
	Code              string            `l10n:"sync" gorm:"index:code"`
	Slug              string            `json:"slug,omitempty" yaml:"slug,omitempty"`
	Description       string            `json:"description,omitempty" yaml:"description,omitempty"`
	Summary           string            `gorm:"type:mediumtext"`
	ServiceProperties ServiceProperties `sql:"type:text"`
	Links             []*OnionLink      `l10n:"sync" json:"urls,omitempty" yaml:"urls,omitempty"`
	PublicKeys        []*OnionPublicKey `l10n:"sync" json:"public_keys,omitempty" yaml:"public_keys,omitempty"`
	Tags              []*OnionTag       `l10n:"sync" gorm:"many2many:service_tags;" json:"tags,omitempty" yaml:"tags,omitempty"`
	Seo               qor_seo.Setting
}

func (OnionService) DefaultPath

func (o OnionService) DefaultPath() string

func (OnionService) GetID

func (o OnionService) GetID() uint

func (OnionService) GetSEO

func (o OnionService) GetSEO() *qor_seo.SEO

func (OnionService) Validate

func (o OnionService) Validate(db *gorm.DB)

type OnionSetting

type OnionSetting struct {
	gorm.Model
	PaginationSetting
	l10n.Locale
}

type OnionTag

type OnionTag struct {
	gorm.Model
	Name         string          `gorm:"size:32;unique" json:"name" yaml:"name"`
	NameWithSlug qor_slug.Slug   `l10n:"sync" json:"name_with_slug" gorm:"index:name_with_slug"`
	Seo          qor_seo.Setting `json:"seo"`
	l10n.Locale
	sorting.Sorting
}

func (*OnionTag) BeforeCreate

func (o *OnionTag) BeforeCreate() (err error)

func (OnionTag) DefaultPath

func (o OnionTag) DefaultPath() string

func (*OnionTag) SetLanguageCode

func (o *OnionTag) SetLanguageCode(code string)

func (OnionTag) Validate

func (o OnionTag) Validate(db *gorm.DB)

type PaginationSetting

type PaginationSetting struct {
	Limit   uint
	PerPage uint
}

to do

type ServiceProperties

type ServiceProperties []ServiceProperty

func (*ServiceProperties) Scan

func (serviceProperties *ServiceProperties) Scan(value interface{}) error

func (ServiceProperties) Value

func (serviceProperties ServiceProperties) Value() (driver.Value, error)

type ServiceProperty

type ServiceProperty struct {
	Name  string
	Value string
}

Jump to

Keyboard shortcuts

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