model

package
v0.3.0-alpha.4 Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func All

func All() []interface{}

All builds all models. Models are enumerated such that each are listed after all the other models on which they may depend.

Types

type Analysis

type Analysis struct {
	Model
	Effort        int
	Issues        []Issue          `gorm:"constraint:OnDelete:CASCADE"`
	Dependencies  []TechDependency `gorm:"constraint:OnDelete:CASCADE"`
	ApplicationID uint             `gorm:"index;not null"`
	Application   *Application
}

Analysis report.

type Application

type Application = model.Application

type ApplicationTag

type ApplicationTag = model.ApplicationTag

type Bucket

type Bucket = model.Bucket

type BucketOwner

type BucketOwner = model.BucketOwner

type BusinessService

type BusinessService = model.BusinessService

type Dependency

type Dependency = model.Dependency

type DependencyCyclicError

type DependencyCyclicError = model.DependencyCyclicError

type Fact

type Fact = model.Fact

type File

type File = model.File

type Identity

type Identity = model.Identity

type Import

type Import = model.Import

type ImportSummary

type ImportSummary = model.ImportSummary

type ImportTag

type ImportTag = model.ImportTag

type Incident

type Incident struct {
	Model
	File     string `gorm:"index;not null"`
	Line     int
	Message  string
	CodeSnip string
	Facts    JSON `gorm:"type:json"`
	IssueID  uint `gorm:"index;not null"`
	Issue    *Issue
}

Incident report an issue incident.

type Issue

type Issue struct {
	Model
	RuleSet     string `gorm:"uniqueIndex:issueA;not null"`
	Rule        string `gorm:"uniqueIndex:issueA;not null"`
	Name        string `gorm:"index"`
	Description string
	Category    string     `gorm:"index;not null"`
	Incidents   []Incident `gorm:"foreignKey:IssueID;constraint:OnDelete:CASCADE"`
	Links       JSON       `gorm:"type:json"`
	Facts       JSON       `gorm:"type:json"`
	Labels      JSON       `gorm:"type:json"`
	Effort      int        `gorm:"index;not null"`
	AnalysisID  uint       `gorm:"index;uniqueIndex:issueA;not null"`
	Analysis    *Analysis
}

Issue report issue (violation).

type JSON

type JSON = []byte

JSON field (data) type.

type JobFunction

type JobFunction = model.JobFunction
type Link struct {
	URL   string `json:"url"`
	Title string `json:"title,omitempty"`
}

Link URL link.

type Map

type Map = map[string]interface{}

Map alias.

type MigrationWave

type MigrationWave = model.MigrationWave

type Model

type Model = model.Model

type Proxy

type Proxy = model.Proxy

type Review

type Review = model.Review

type Rule

type Rule struct {
	Model
	Name        string
	Description string
	Labels      JSON `gorm:"type:json"`
	RuleSetID   uint `gorm:"uniqueIndex:RuleA;not null"`
	RuleSet     *RuleSet
	FileID      *uint `gorm:"uniqueIndex:RuleA" ref:"file"`
	File        *File
}

Rule - Analysis rule.

type RuleSet

type RuleSet struct {
	Model
	Kind        string
	Name        string `gorm:"uniqueIndex;not null"`
	Description string
	Custom      bool
	Repository  JSON `gorm:"type:json"`
	ImageID     uint `gorm:"index" ref:"file"`
	Image       *File
	IdentityID  *uint `gorm:"index"`
	Identity    *Identity
	Rules       []Rule    `gorm:"constraint:OnDelete:CASCADE"`
	DependsOn   []RuleSet `gorm:"many2many:RuleSetDependencies;constraint:OnDelete:CASCADE"`
}

RuleSet - Analysis ruleset.

func (*RuleSet) BeforeUpdate

func (r *RuleSet) BeforeUpdate(db *gorm.DB) (err error)

BeforeUpdate hook to avoid cyclic dependencies.

type Setting

type Setting = model.Setting

type Stakeholder

type Stakeholder = model.Stakeholder

type StakeholderGroup

type StakeholderGroup = model.StakeholderGroup

type TTL

type TTL struct {
	Created   int `json:"created,omitempty"`
	Pending   int `json:"pending,omitempty"`
	Postponed int `json:"postponed,omitempty"`
	Running   int `json:"running,omitempty"`
	Succeeded int `json:"succeeded,omitempty"`
	Failed    int `json:"failed,omitempty"`
}

TTL time-to-live.

type Tag

type Tag = model.Tag

type TagCategory

type TagCategory = model.TagCategory

type Task

type Task struct {
	Model
	BucketOwner
	Name          string `gorm:"index"`
	Addon         string `gorm:"index"`
	Locator       string `gorm:"index"`
	Priority      int
	Image         string
	Variant       string
	Policy        string
	TTL           JSON
	Data          JSON
	Started       *time.Time
	Terminated    *time.Time
	State         string `gorm:"index"`
	Errors        JSON
	Pod           string `gorm:"index"`
	Retries       int
	Canceled      bool
	Report        *TaskReport `gorm:"constraint:OnDelete:CASCADE"`
	ApplicationID *uint
	Application   *Application
	TaskGroupID   *uint `gorm:"<-:create"`
	TaskGroup     *TaskGroup
}

func (*Task) BeforeCreate

func (m *Task) BeforeCreate(db *gorm.DB) (err error)

func (*Task) Error

func (m *Task) Error(severity, description string, x ...interface{})

Error appends an error.

func (*Task) Reset

func (m *Task) Reset()

type TaskError

type TaskError struct {
	Severity    string `json:"severity"`
	Description string `json:"description"`
}

TaskError used in Task.Errors.

type TaskGroup

type TaskGroup struct {
	Model
	BucketOwner
	Name  string
	Addon string
	Data  JSON
	Tasks []Task `gorm:"constraint:OnDelete:CASCADE"`
	List  JSON
	State string
}

func (*TaskGroup) Propagate

func (m *TaskGroup) Propagate() (err error)

Propagate group data into the task.

type TaskReport

type TaskReport struct {
	Model
	Status    string
	Errors    JSON
	Total     int
	Completed int
	Activity  JSON `gorm:"type:json"`
	Result    JSON `gorm:"type:json"`
	TaskID    uint `gorm:"<-:create;uniqueIndex"`
	Task      *Task
}

type TechDependency

type TechDependency struct {
	Model
	Provider   string `gorm:"uniqueIndex:depA"`
	Name       string `gorm:"uniqueIndex:depA"`
	Version    string `gorm:"uniqueIndex:depA"`
	SHA        string `gorm:"uniqueIndex:depA"`
	Indirect   bool
	Labels     JSON `gorm:"type:json"`
	AnalysisID uint `gorm:"index;uniqueIndex:depA;not null"`
	Analysis   *Analysis
}

TechDependency report dependency.

type Ticket

type Ticket = model.Ticket

type Tracker

type Tracker = model.Tracker

Jump to

Keyboard shortcuts

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