Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // Ctl is a global project controller instance Ctl = NewController() )
Functions ¶
Types ¶
type Controller ¶
type Controller interface { // Create create project instance Create(ctx context.Context, project *models.Project) (int64, error) // Count returns the total count of projects according to the query Count(ctx context.Context, query *q.Query) (int64, error) // Delete delete the project by project id Delete(ctx context.Context, id int64) error // Exists returns true when the specific project exists Exists(ctx context.Context, projectIDOrName interface{}) (bool, error) // Get get the project by project id or name Get(ctx context.Context, projectIDOrName interface{}, options ...Option) (*models.Project, error) // GetByName get the project by project name GetByName(ctx context.Context, projectName string, options ...Option) (*models.Project, error) // List list projects List(ctx context.Context, query *q.Query, options ...Option) ([]*models.Project, error) // Update update the project Update(ctx context.Context, project *models.Project) error // ListRoles lists the roles of user for the specific project ListRoles(ctx context.Context, projectID int64, u *commonmodels.User) ([]int, error) }
Controller defines the operations related with blobs
func NewController ¶
func NewController() Controller
NewController creates an instance of the default project controller
type Option ¶
type Option func(*Options)
Option option for `Get` and `Exist` method of `Controller`
func WithCVEAllowlist ¶
func WithCVEAllowlist() Option
WithCVEAllowlist set WithCVEAllowlist for the Options
func WithEffectCVEAllowlist ¶
func WithEffectCVEAllowlist() Option
WithEffectCVEAllowlist set WithEffectCVEAllowlist for the Options
type Options ¶
type Options struct { WithDetail bool WithCVEAllowlist bool // get project with cve allowlist WithEffectCVEAllowlist bool // get project with effect cve allowlist WithMetadata bool // get project with metadata WithOwner bool // get project with owner name }
Options options used by `Get` method of `Controller`
Click to show internal directories.
Click to hide internal directories.