models

package
v0.0.0-...-d01dfd4 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2024 License: Apache-2.0 Imports: 7 Imported by: 3

Documentation

Index

Constants

View Source
const (
	ProMetaPublic                   = "public"
	ProMetaEnableContentTrust       = "enable_content_trust"
	ProMetaEnableContentTrustCosign = "enable_content_trust_cosign"
	ProMetaPreventVul               = "prevent_vul" // prevent vulnerable images from being pulled
	ProMetaSeverity                 = "severity"
	ProMetaAutoScan                 = "auto_scan"
	ProMetaReuseSysCVEAllowlist     = "reuse_sys_cve_allowlist"
	ProMetaAutoSBOMGen              = "auto_sbom_generation"
)

keys of project metadata and severity values

View Source
const (
	// ProjectTable is the table name for project
	ProjectTable = "project"
	// ProjectPublic means project is public
	ProjectPublic = "public"
	// ProjectPrivate means project is private
	ProjectPrivate = "private"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Member

type Member struct {
	ID           int       `orm:"pk;auto;column(id)" json:"id"`
	ProjectID    int64     `orm:"column(project_id)" json:"project_id"`
	Role         int       `orm:"column(role)" json:"role_id"`
	EntityID     int       `orm:"column(entity_id)" json:"entity_id"`
	EntityType   string    `orm:"column(entity_type)" json:"entity_type"`
	CreationTime time.Time `orm:"column(creation_time);auto_now_add" json:"creation_time"`
	UpdateTime   time.Time `orm:"column(update_time);auto_now" json:"update_time"`
}

Member holds the details of a member.

func (*Member) TableName

func (*Member) TableName() string

TableName ...

type MemberQuery

type MemberQuery struct {
	UserID   int    // the user id
	Name     string // the username of member
	Role     int    // the role of the member has to the project
	GroupIDs []int  // the group ID of current user belongs to

	WithPublic bool // include the public projects for the member
}

MemberQuery ...

type NamesQuery

type NamesQuery struct {
	Names      []string // the names of project
	WithPublic bool     // include the public projects
}

NamesQuery ...

type Project

type Project struct {
	ProjectID    int64                  `orm:"pk;auto;column(project_id)" json:"project_id"`
	OwnerID      int                    `orm:"column(owner_id)" json:"owner_id"`
	Name         string                 `orm:"column(name)" json:"name" sort:"default"`
	CreationTime time.Time              `orm:"column(creation_time);auto_now_add" json:"creation_time"`
	UpdateTime   time.Time              `orm:"column(update_time);auto_now" json:"update_time"`
	Deleted      bool                   `orm:"column(deleted)" json:"deleted"`
	OwnerName    string                 `orm:"-" json:"owner_name"`
	Role         int                    `orm:"-" json:"current_user_role_id"`
	RoleList     []int                  `orm:"-" json:"current_user_role_ids"`
	RepoCount    int64                  `orm:"-" json:"repo_count"`
	Metadata     map[string]string      `orm:"-" json:"metadata"`
	CVEAllowlist allowlist.CVEAllowlist `orm:"-" json:"cve_allowlist"`
	RegistryID   int64                  `orm:"column(registry_id)" json:"registry_id"`
}

Project holds the details of a project.

func (*Project) AutoSBOMGen

func (p *Project) AutoSBOMGen() bool

AutoSBOMGen ...

func (*Project) AutoScan

func (p *Project) AutoScan() bool

AutoScan ...

func (*Project) ContentTrustCosignEnabled

func (p *Project) ContentTrustCosignEnabled() bool

VulPrevented ...

func (*Project) ContentTrustEnabled

func (p *Project) ContentTrustEnabled() bool

ContentTrustEnabled ...

func (*Project) FilterByMember

func (p *Project) FilterByMember(_ context.Context, qs orm.QuerySeter, _ string, value interface{}) orm.QuerySeter

FilterByMember returns orm.QuerySeter with member filter

func (*Project) FilterByNames

func (p *Project) FilterByNames(_ context.Context, qs orm.QuerySeter, _ string, value interface{}) orm.QuerySeter

FilterByNames returns orm.QuerySeter with name filter

func (*Project) FilterByOwner

func (p *Project) FilterByOwner(_ context.Context, qs orm.QuerySeter, _ string, value interface{}) orm.QuerySeter

FilterByOwner returns orm.QuerySeter with owner filter

func (*Project) FilterByPublic

func (p *Project) FilterByPublic(_ context.Context, qs orm.QuerySeter, _ string, value interface{}) orm.QuerySeter

FilterByPublic returns orm.QuerySeter with public filter

func (*Project) GetMetadata

func (p *Project) GetMetadata(key string) (string, bool)

GetMetadata ...

func (*Project) IsProxy

func (p *Project) IsProxy() bool

IsProxy returns true when the project type is proxy cache

func (*Project) IsPublic

func (p *Project) IsPublic() bool

IsPublic ...

func (*Project) ReuseSysCVEAllowlist

func (p *Project) ReuseSysCVEAllowlist() bool

ReuseSysCVEAllowlist ...

func (*Project) SetMetadata

func (p *Project) SetMetadata(key, value string)

SetMetadata ...

func (*Project) Severity

func (p *Project) Severity() string

Severity ...

func (*Project) TableName

func (p *Project) TableName() string

TableName is required by beego orm to map Project to table project

func (*Project) VulPrevented

func (p *Project) VulPrevented() bool

VulPrevented ...

type Projects

type Projects []*Project

Projects the connection for Project

func (Projects) OwnerIDs

func (projects Projects) OwnerIDs() []int

OwnerIDs returns all the owner ids from the projects

Jump to

Keyboard shortcuts

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