models

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2022 License: AGPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bundle

type Bundle struct {
	ID   string `gorm:"primarykey"`
	Name string
}

type CodeHosting

type CodeHosting struct {
	gorm.Model
	URL         string `json:"url" gorm:"not null"`
	PublisherID string `json:"publisherId"`
}

type Log

type Log struct {
	ID        string         `json:"id" gorm:"primaryKey"`
	Message   string         `json:"message" gorm:"not null"`
	CreatedAt time.Time      `json:"createdAt" gorm:"index"`
	UpdatedAt time.Time      `json:"updatedAt"`
	DeletedAt gorm.DeletedAt `json:"-" gorm:"index"`

	// Entity this Log entry is about (fe. Publisher, Software, etc.)
	EntityID   string `json:"-"`
	EntityType string `json:"-"`
}

type Publisher

type Publisher struct {
	ID          string         `gorm:"primarykey"`
	Email       string         `json:"email"`
	Description string         `json:"description"`
	CodeHosting []CodeHosting  `gorm:"constraint:OnUpdate:CASCADE,OnDelete:SET NULL;unique" json:"codeHosting"`
	CreatedAt   time.Time      `json:"createdAt" gorm:"index"`
	UpdatedAt   time.Time      `json:"updatedAt"`
	DeletedAt   gorm.DeletedAt `gorm:"index"`
}

type Software

type Software struct {
	ID            string         `json:"id" gorm:"primarykey"`
	URLs          []SoftwareURL  `json:"urls"`
	PubliccodeYml string         `json:"publiccodeYml"`
	Logs          []Log          `json:"-" gorm:"polymorphic:Entity;"`
	CreatedAt     time.Time      `json:"createdAt" gorm:"index"`
	UpdatedAt     time.Time      `json:"updatedAt"`
	DeletedAt     gorm.DeletedAt `json:"-" gorm:"index"`
}

func (Software) TableName

func (Software) TableName() string

type SoftwareURL

type SoftwareURL struct {
	gorm.Model
	ID         string `gorm:"primarykey"`
	URL        string `gorm:"uniqueIndex"`
	SoftwareID string
}

func (SoftwareURL) MarshalJSON

func (su SoftwareURL) MarshalJSON() ([]byte, error)

Jump to

Keyboard shortcuts

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