model

package
v0.0.0-...-520f1c6 Latest Latest
Warning

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

Go to latest
Published: Feb 2, 2022 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Account

type Account struct {
	gorm.Model
	UserID    uint
	UserName  string
	Name      string
	AvatarURL string
	Provider  string
}

type Catalog

type Catalog struct {
	gorm.Model
	Name       string `gorm:"uniqueIndex:uix_name_org"`
	Org        string `gorm:"uniqueIndex:uix_name_org"`
	Provider   string `gorm:"not null;default:github"`
	Type       string `gorm:"not null;default:null"`
	URL        string `gorm:"not null;default:null"`
	Revision   string `gorm:"not null;default:null"`
	ContextDir string
	SHA        string
	Resources  []Resource
	Errors     []CatalogError
}

type CatalogError

type CatalogError struct {
	gorm.Model
	Catalog   Catalog
	CatalogID uint
	Type      string
	Detail    string
}

type Category

type Category struct {
	gorm.Model
	Name      string      `gorm:"not null;unique"`
	Resources []*Resource `gorm:"many2many:resource_categories;"`
}

type Config

type Config struct {
	gorm.Model
	Checksum string
}

type JobState

type JobState int

JobState defines the state of Sync Job

const (
	JobQueued JobState = iota
	JobRunning
	JobDone
	JobError
)

Represents Job State

func (JobState) String

func (s JobState) String() string

type Platform

type Platform struct {
	gorm.Model
	Name             string             `gorm:"not null;unique"`
	ResourceVersions []*ResourceVersion `gorm:"many2many:version_platforms;constraint:OnDelete:CASCADE;"`
	Resource         []*Resource        `gorm:"many2many:resource_platforms;constraint:OnDelete:CASCADE;"`
}

type Resource

type Resource struct {
	gorm.Model
	Name       string `gorm:"not null;default:null"`
	Kind       string `gorm:"not null;default:null"`
	Rating     float64
	Catalog    Catalog
	Categories []*Category `gorm:"many2many:resource_categories;constraint:OnDelete:CASCADE;"`
	CatalogID  uint
	Platforms  []*Platform       `gorm:"many2many:resource_platforms;constraint:OnDelete:CASCADE;"`
	Versions   []ResourceVersion `gorm:"constraint:OnDelete:CASCADE;"`
	Tags       []*Tag            `gorm:"many2many:resource_tags;constraint:OnDelete:CASCADE;"`
}

type ResourceCategory

type ResourceCategory struct {
	ResourceID uint
	CategoryID uint
}

type ResourcePlatform

type ResourcePlatform struct {
	ResourceID uint
	PlatformID uint
}

type ResourceTag

type ResourceTag struct {
	ResourceID uint
	TagID      uint
}

type ResourceVersion

type ResourceVersion struct {
	gorm.Model
	Version             string `gorm:"not null;default:null"`
	Description         string
	URL                 string `gorm:"not null;default:null"`
	DisplayName         string
	Deprecated          bool     `gorm:"default:false"`
	MinPipelinesVersion string   `gorm:"not null;default:null"`
	Resource            Resource `gorm:"constraint:OnDelete:CASCADE;"`
	ResourceID          uint
	Platforms           []*Platform `gorm:"many2many:version_platforms;constraint:OnDelete:CASCADE;"`
	ModifiedAt          time.Time
}

type Scope

type Scope struct {
	gorm.Model
	Name string `gorm:"not null;unique"`
}

type SyncJob

type SyncJob struct {
	gorm.Model
	Catalog   Catalog
	CatalogID uint
	Status    string
	UserID    uint
	User      User
}

func (*SyncJob) IsRunning

func (j *SyncJob) IsRunning() bool

func (*SyncJob) SetState

func (j *SyncJob) SetState(s JobState)

type Tag

type Tag struct {
	gorm.Model
	Name      string      `gorm:"not null;unique"`
	Resources []*Resource `gorm:"many2many:resource_tags;"`
}

type User

type User struct {
	gorm.Model
	Email                string
	Type                 UserType
	AgentName            string
	RefreshTokenChecksum string
	Code                 string
	Scopes               []*Scope  `gorm:"many2many:user_scopes;"`
	Accounts             []Account `gorm:"constraint:OnDelete:CASCADE;"`
}

type UserBackup

type UserBackup struct {
	gorm.Model
	AgentName            string
	GithubLogin          string
	GithubName           string
	Type                 UserType
	Scopes               []*Scope `gorm:"many2many:user_scopes;"`
	RefreshTokenChecksum string
	AvatarURL            string
	Code                 string
}

type UserResourceRating

type UserResourceRating struct {
	gorm.Model
	UserID     uint
	User       User
	Resource   Resource `gorm:"constraint:OnDelete:CASCADE;"`
	ResourceID uint
	Rating     uint `gorm:"not null;default:null"`
}

type UserScope

type UserScope struct {
	UserID  uint
	ScopeID uint
}

type UserType

type UserType string
const (
	NormalUserType UserType = "user"
	AgentUserType  UserType = "agent"
)

Types of Users

type VersionPlatform

type VersionPlatform struct {
	ResourceVersionID uint
	PlatformID        uint
}

Jump to

Keyboard shortcuts

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