Documentation ¶
Index ¶
- func ProjectAliasesString(aliases []*ProjectAlias) string
- type Cache
- func (c *Cache) AddAlias(alias string, project *projects.Project) error
- func (c *Cache) AddProjects(gitProjects ...*projects.Project)
- func (c *Cache) AliasStrings(prefix string) []string
- func (c *Cache) AliasesByProjectString(remotes ...string) string
- func (c *Cache) Clear(clearAliases bool)
- func (c *Cache) DeleteAlias(alias *ProjectAlias)
- func (c *Cache) DoMigrations() (error, int)
- func (c *Cache) DumpString(all bool, search string, remotes ...string) string
- func (c *Cache) FuzzyFindAlias(name string) []*ProjectAlias
- func (c *Cache) FuzzyFindProjects(search string) []*projects.Project
- func (c *Cache) GetAliasByName(name string, remotes ...string) *ProjectAlias
- func (c *Cache) GetProjectAliasStrings(project *projects.Project) []string
- func (c *Cache) GetProjectAliases(project *projects.Project) []*ProjectAlias
- func (c *Cache) GetProjectByAlias(alias *ProjectAlias) *projects.Project
- func (c *Cache) GetProjectByID(id string) *projects.Project
- func (c *Cache) GetProjectByPath(path string) *projects.Project
- func (c *Cache) GetProjectByRemoteAndId(remote string, id int) *projects.Project
- func (c *Cache) GetProjectFromCwd() (*projects.Project, error)
- func (c *Cache) GetProjectPath(p *projects.Project) string
- func (c *Cache) GetProjectStringWithAliases(project *projects.Project) string
- func (c *Cache) GetProjectsByID(id int) []*projects.Project
- func (c *Cache) GetProjectsWithAliases() []*projects.Project
- func (c *Cache) GetUpdated() time.Time
- func (c *Cache) GoTo(project *projects.Project)
- func (c *Cache) IsProjectCloned(p *projects.Project) bool
- func (c *Cache) Load() error
- func (c *Cache) LoadRemotes(gitRemotes ...string)
- func (c *Cache) LockCache()
- func (c *Cache) OpenProject(ctx context.Context, project *projects.Project) *git.Repository
- func (c *Cache) PrepProjectPath(path string)
- func (c *Cache) ProjectString(p *projects.Project) string
- func (c *Cache) ProjectStrings(prefix string) []string
- func (c *Cache) Read() error
- func (c *Cache) ReceiveRemoteStream(remote remote.Remote, wg *sync.WaitGroup, pBar *pterm.ProgressbarPrinter, ...)
- func (c *Cache) Refresh(remotes ...string)
- func (c *Cache) SetUpdated()
- func (c *Cache) String() string
- func (c *Cache) UnlockCache()
- func (c *Cache) Write()
- type CacheOpts
- type ProjectAlias
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ProjectAliasesString ¶
func ProjectAliasesString(aliases []*ProjectAlias) string
Types ¶
type Cache ¶
type Cache struct { Projects []*projects.Project Aliases []*ProjectAlias Updated time.Time CacheVersion string // contains filtered or unexported fields }
func NewProjectCache ¶
Returns a new project cache ready to load from cache file. Cache.Load() must be called manually
func (*Cache) AddProjects ¶
func (*Cache) AliasStrings ¶
func (*Cache) AliasesByProjectString ¶
func (*Cache) DeleteAlias ¶
func (c *Cache) DeleteAlias(alias *ProjectAlias)
func (*Cache) DoMigrations ¶ added in v0.2.0
Performs any required updates based on version of cache read from disk. Does not check to ensure migrations were successful, only checks if a version has been achieved
func (*Cache) DumpString ¶
This command will only dump projects that have been cloned locally. Setting all to true will list all projects
func (*Cache) FuzzyFindAlias ¶
func (c *Cache) FuzzyFindAlias(name string) []*ProjectAlias
Performs a fuzzy find on the input string, returning the closest matched based on its Levenshtein distance, along with an integer indicating number of matches found
func (*Cache) FuzzyFindProjects ¶
Returns all matching projects by fuzzy find term Matches NameWithNamespace and Aliases
func (*Cache) GetAliasByName ¶
func (c *Cache) GetAliasByName(name string, remotes ...string) *ProjectAlias
func (*Cache) GetProjectAliasStrings ¶
func (*Cache) GetProjectAliases ¶
func (c *Cache) GetProjectAliases(project *projects.Project) []*ProjectAlias
func (*Cache) GetProjectByAlias ¶
func (c *Cache) GetProjectByAlias(alias *ProjectAlias) *projects.Project
func (*Cache) GetProjectByRemoteAndId ¶
func (*Cache) GetProjectStringWithAliases ¶
func (*Cache) GetProjectsByID ¶
Plural form of GetProjectByID Since multiple remotes may have the same project ID, this will return all matching
func (*Cache) GetProjectsWithAliases ¶
func (*Cache) GetUpdated ¶
func (*Cache) Load ¶
Load cache, if already loaded and up to date, nothing is done. If the cache is not yet loaded from disk, it is loaded If the updated timestamp is beyond the set ttl, a refresh is triggered
func (*Cache) LoadRemotes ¶
func (*Cache) OpenProject ¶
Will either read in the current repo, preparing a report on its current state, or will clone the project if it has not already been cloned in its path
func (*Cache) PrepProjectPath ¶
func (*Cache) ProjectStrings ¶
func (*Cache) ReceiveRemoteStream ¶
func (c *Cache) ReceiveRemoteStream(remote remote.Remote, wg *sync.WaitGroup, pBar *pterm.ProgressbarPrinter, progressInfo *load.ProgressInfo)
func (*Cache) Refresh ¶
Iterates through all Git projects the user has access to, updating the project cache where necessary
func (*Cache) SetUpdated ¶
func (c *Cache) SetUpdated()
func (*Cache) UnlockCache ¶
func (c *Cache) UnlockCache()