Documentation ¶
Index ¶
- func CheckIfError(err error, message ...string)
- type Authenticator
- type Config
- type Groomba
- func (g Groomba) FilterBranches(referenceDate time.Time) ([]*plumbing.Reference, error)
- func (g Groomba) IsStaticBranch(name string) bool
- func (g Groomba) MoveBranch(refName string) *MoveBranchError
- func (g Groomba) MoveStaleBranches(branches []*plumbing.Reference) error
- func (g Groomba) PrintBranchesGroupbyAuthor(branches []*plumbing.Reference) error
- type MoveBranchError
- type MoveBranchOperation
- type MoveStaleBranchesError
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckIfError ¶
CheckIfError should be used to naively panic if an error is not nil.
Types ¶
type Authenticator ¶ added in v0.3.10
type Authenticator interface {
Get() transport.AuthMethod
}
type Config ¶
type Config struct { Auth auth.AuthType `yaml:"auth" toml:"auth"` Clobber bool `yaml:"clobber" toml:"clobber"` DryRun bool `yaml:"dry_run" toml:"dry_run"` MaxConcurrency uint8 `yaml:"max_concurrency" toml:"max_concurrency"` Prefix string `yaml:"prefix" toml:"prefix"` StaleAgeThreshold int `yaml:"stale_age_threshold" toml:"stale_age_threshold"` StaticBranches []string `yaml:"static_branches" toml:"static_branches"` }
Config stores the configuration for Groomba
type Groomba ¶
type Groomba struct {
// contains filtered or unexported fields
}
Groomba base type to store config and other shared references
func NewGroomba ¶
func NewGroomba(config *Config, repo *git.Repository, a Authenticator) Groomba
func (Groomba) FilterBranches ¶
func (Groomba) IsStaticBranch ¶
func (Groomba) MoveBranch ¶
func (g Groomba) MoveBranch(refName string) *MoveBranchError
func (Groomba) MoveStaleBranches ¶
func (Groomba) PrintBranchesGroupbyAuthor ¶
Example ¶
InitTest() cfg, _ := GetConfig(".") repo, _ := git.PlainOpen("testdata/dst") g := Groomba{cfg: cfg, repo: repo, auth: &MockAuthenticator{}} fb, _ := g.FilterBranches(time.Now()) _ = g.PrintBranchesGroupbyAuthor(fb)
Output: Test: - name: refs/remotes/origin/IsStale age: 19d - name: refs/remotes/origin/IsStale2 age: 19d
type MoveBranchError ¶ added in v0.3.3
type MoveBranchError struct {
// contains filtered or unexported fields
}
MoveBranchError defines the errors during the MoveBranch step
func (*MoveBranchError) Error ¶ added in v0.3.3
func (e *MoveBranchError) Error() string
Error so MoveBranchError satisfies the error interface
func (*MoveBranchError) Unwrap ¶ added in v0.3.3
func (e *MoveBranchError) Unwrap() error
Unwrap for MoveBranchError
type MoveBranchOperation ¶ added in v0.3.3
type MoveBranchOperation int
MoveBranchOperation defines the various operatons during MoveBranch
const ( CopyBranch MoveBranchOperation = iota DeleteBranch )
type MoveStaleBranchesError ¶ added in v0.3.3
type MoveStaleBranchesError struct {
// contains filtered or unexported fields
}
MoveStaleBranchesError stores all errors from MoveBranches
func (*MoveStaleBranchesError) Error ¶ added in v0.3.3
func (m *MoveStaleBranchesError) Error() string
Error so MoveStaleBranchesError satisfies the error interface
Click to show internal directories.
Click to hide internal directories.