Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // Ctl is a global repository controller instance Ctl = NewController() )
Functions ¶
This section is empty.
Types ¶
type Controller ¶
type Controller interface { // Ensure the repository specified by the "name" exists, creates it if it doesn't exist. // The "name" should contain the namespace part. The "created" will be set as true // when the repository is created Ensure(ctx context.Context, name string) (created bool, id int64, err error) // Count returns the total count of repositories according to the query Count(ctx context.Context, query *q.Query) (total int64, err error) // List repositories according to the query List(ctx context.Context, query *q.Query) (repositories []*model.RepoRecord, err error) // Get the repository specified by ID Get(ctx context.Context, id int64) (repository *model.RepoRecord, err error) // GetByName gets the repository specified by name GetByName(ctx context.Context, name string) (repository *model.RepoRecord, err error) // Delete the repository specified by ID Delete(ctx context.Context, id int64) (err error) // Update the repository. Specify the properties or all properties will be updated Update(ctx context.Context, repository *model.RepoRecord, properties ...string) (err error) // AddPullCount increase pull count for the specified repository AddPullCount(ctx context.Context, id int64, count uint64) error }
Controller defines the operations related with repositories
func NewController ¶
func NewController() Controller
NewController creates an instance of the default repository controller
Click to show internal directories.
Click to hide internal directories.