Documentation
¶
Index ¶
- type Repository
- func (r Repository) Dependencies() ([]*modfile.Require, error)
- func (r Repository) GoFix(ctx context.Context) error
- func (r Repository) GoGenerate(ctx context.Context) error
- func (r Repository) GoGetAll(ctx context.Context) error
- func (r Repository) GoGetTools(ctx context.Context) error
- func (r Repository) GoModInit(ctx context.Context) error
- func (r Repository) GoModTidy(ctx context.Context) error
- func (r Repository) GoModVendor(ctx context.Context) error
- func (r *Repository) GoTestCover(ctx context.Context) (float64, error)
- func (r Repository) GoVet(ctx context.Context) error
- func (r Repository) Gofumpt(ctx context.Context) error
- func (r Repository) Goimports(ctx context.Context) error
- func (r Repository) GolangCILint(ctx context.Context) error
- func (r Repository) GolangCILintFix(ctx context.Context) error
- func (r Repository) GolangCILintWithLinters(ctx context.Context, fix bool, settings config.Linters) error
- func (r Repository) IsGoRepo() (bool, error)
- func (r Repository) SettleModules(ctx context.Context) error
- func (r Repository) UpdateDependencies(ctx context.Context) error
- func (r Repository) UpdateTools(ctx context.Context) error
- type Service
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Repository ¶
type Repository struct{ *ghrepo.Repository }
Repository represents a local go repository.
func (Repository) Dependencies ¶
func (r Repository) Dependencies() ([]*modfile.Require, error)
Dependencies returns the list of required modules declared in go.mod.
func (Repository) GoGenerate ¶
func (r Repository) GoGenerate(ctx context.Context) error
func (Repository) GoGetAll ¶
func (r Repository) GoGetAll(ctx context.Context) error
GoGetAll updates all package dependencies reachable from the module, its tests' included.
func (Repository) GoGetTools ¶
func (r Repository) GoGetTools(ctx context.Context) error
GoGetTools updates all tool dependencies listed in go.mod.
func (Repository) GoModInit ¶
func (r Repository) GoModInit(ctx context.Context) error
GoModInit initializes a go module in the repository.
func (Repository) GoModTidy ¶
func (r Repository) GoModTidy(ctx context.Context) error
GoModTidy tidies the go module in the repository.
func (Repository) GoModVendor ¶
func (r Repository) GoModVendor(ctx context.Context) error
GoModVendor vendors all dependencies in the repository.
func (*Repository) GoTestCover ¶
func (r *Repository) GoTestCover(ctx context.Context) (float64, error)
func (Repository) GoVet ¶
func (r Repository) GoVet(ctx context.Context) error
GoVet runs go vet on the repository
func (Repository) GolangCILint ¶
func (r Repository) GolangCILint(ctx context.Context) error
func (Repository) GolangCILintFix ¶
func (r Repository) GolangCILintFix(ctx context.Context) error
func (Repository) GolangCILintWithLinters ¶
func (r Repository) GolangCILintWithLinters(ctx context.Context, fix bool, settings config.Linters) error
GolangCILintWithLinters runs golangci-lint with these linters only; a setting left at its zero value keeps golangci-lint's default, so a default of true cannot be turned off.
func (Repository) IsGoRepo ¶
func (r Repository) IsGoRepo() (bool, error)
func (Repository) SettleModules ¶
func (r Repository) SettleModules(ctx context.Context) error
SettleModules brings go.mod and go.sum in line with the code, and vendor/ where the module vendors: after a change that imports a package go.mod does not require or vendor/ does not hold yet, for one.
func (Repository) UpdateDependencies ¶
func (r Repository) UpdateDependencies(ctx context.Context) error
UpdateDependencies updates all dependencies in the repository.
func (Repository) UpdateTools ¶
func (r Repository) UpdateTools(ctx context.Context) error
UpdateTools updates all go tools in the repository.
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service is a repository service for gorepo repositories.
func NewService ¶
NewService creates a new gorepo Service.
func (*Service) NewRepository ¶
func (s *Service) NewRepository(ctx context.Context, owner, name string, opts ...ghrepo.Option) (*Repository, error)
NewRepository opens or initializes a repository at the given path.
func (*Service) PrefetchOrgRepositories ¶
PrefetchOrgRepositories fetches all repositories by the given organization and caches them. This is useful to avoid hitting the GitHub API rate limits when creating multiple repositories.
func (*Service) PrefetchUserRepositories ¶
PrefetchUserRepositories fetches all repositories by the given user and caches them. This is useful to avoid hitting the GitHub API rate limits when creating multiple repositories.