Documentation
¶
Index ¶
Constants ¶
View Source
const ( // CreatePostgresTable represents a query to create the Postgres repos table. CreatePostgresTable = `` /* 687-byte string literal not displayed */ // CreateSqliteTable represents a query to create the Sqlite repos table. CreateSqliteTable = `` /* 627-byte string literal not displayed */ )
View Source
const ( // CreateOrgNameIndex represents a query to create an // index on the repos table for the org and name columns. CreateOrgNameIndex = ` CREATE INDEX IF NOT EXISTS repos_org_name ON repos (org, name); ` )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type EngineOpt ¶
type EngineOpt func(*engine) error
EngineOpt represents a configuration option to initialize the database engine for Repos.
func WithClient ¶
WithClient sets the gorm.io/gorm client in the database engine for Repos.
func WithContext ¶ added in v0.21.0
WithContext sets the context in the database engine for Repos.
func WithEncryptionKey ¶
WithEncryptionKey sets the encryption key in the database engine for Repos.
func WithLogger ¶
WithLogger sets the github.com/sirupsen/logrus logger in the database engine for Repos.
func WithSkipCreation ¶
WithSkipCreation sets the skip creation logic in the database engine for Repos.
type RepoInterface ¶ added in v0.20.0
type RepoInterface interface {
// CreateRepoIndexes defines a function that creates the indexes for the repos table.
CreateRepoIndexes(context.Context) error
// CreateRepoTable defines a function that creates the repos table.
CreateRepoTable(context.Context, string) error
// CountRepos defines a function that gets the count of all repos.
CountRepos(context.Context) (int64, error)
// CountReposForOrg defines a function that gets the count of repos by org name.
CountReposForOrg(context.Context, string, map[string]interface{}) (int64, error)
// CountReposForUser defines a function that gets the count of repos by user ID.
CountReposForUser(context.Context, *library.User, map[string]interface{}) (int64, error)
// CreateRepo defines a function that creates a new repo.
CreateRepo(context.Context, *library.Repo) (*library.Repo, error)
// DeleteRepo defines a function that deletes an existing repo.
DeleteRepo(context.Context, *library.Repo) error
// GetRepo defines a function that gets a repo by ID.
GetRepo(context.Context, int64) (*library.Repo, error)
// GetRepoForOrg defines a function that gets a repo by org and repo name.
GetRepoForOrg(context.Context, string, string) (*library.Repo, error)
// ListRepos defines a function that gets a list of all repos.
ListRepos(context.Context) ([]*library.Repo, error)
// ListReposForOrg defines a function that gets a list of repos by org name.
ListReposForOrg(context.Context, string, string, map[string]interface{}, int, int) ([]*library.Repo, int64, error)
// ListReposForUser defines a function that gets a list of repos by user ID.
ListReposForUser(context.Context, *library.User, string, map[string]interface{}, int, int) ([]*library.Repo, int64, error)
// UpdateRepo defines a function that updates an existing repo.
UpdateRepo(context.Context, *library.Repo) (*library.Repo, error)
}
RepoInterface represents the Vela interface for repo functions with the supported Database backends.
Click to show internal directories.
Click to hide internal directories.