Documentation ¶
Index ¶
- Constants
- Variables
- func ConfigPath(rootDir string) string
- func EnsureCurrentGit() (string, error)
- func EnsureDir(paths ...string) error
- func GetRootDir() (string, error)
- func ParseRepositoryGroup(name string) (string, string, error)
- func SortRepositories(repos []*Repository)
- func SortRepositoryAttachments(attaches []*RepositoryAttachment)
- type Config
- type Remote
- type RemoteGroup
- type RemoteRepository
- type Repository
- func (repo *Repository) ColorName() string
- func (repo *Repository) Exists() (bool, error)
- func (repo *Repository) FullName() string
- func (repo *Repository) Git() *git.Repository
- func (repo *Repository) Normalize() error
- func (repo *Repository) Path() string
- func (repo *Repository) PathWithRemote() string
- type RepositoryAttachment
- type RepositoryMergeOptions
- type RepositoryProvider
- type RepositoryRelease
- type RepositoryReleaseFile
- type RepositorySearchOptions
- type RepositoryStorage
- type RepositoryUploadReleaseFileOptions
Constants ¶
View Source
const ( ProtocolHTTPS = "https" ProtocolSSH = "ssh" )
View Source
const ( ProviderGithub = "github" ProviderGitlab = "gitlab" )
Variables ¶
View Source
var (
Fs = afero.NewOsFs()
)
Functions ¶
func ConfigPath ¶
func EnsureCurrentGit ¶
func GetRootDir ¶
func SortRepositories ¶
func SortRepositories(repos []*Repository)
func SortRepositoryAttachments ¶
func SortRepositoryAttachments(attaches []*RepositoryAttachment)
Types ¶
type Config ¶
type Config struct { Workspace string `toml:"workspace"` SearchLimit int `toml:"search_limit"` Editor string `toml:"editor"` Remotes []*Remote `toml:"remotes"` // contains filtered or unexported fields }
func InitConfig ¶
func ReadConfig ¶
type Remote ¶
type Remote struct { Name string `toml:"name"` Host string `toml:"host"` Protocol string `toml:"protocol"` User string `toml:"user"` Email string `toml:"email"` Provider string `toml:"provider"` Token string `toml:"token"` API string `toml:"api"` Groups []*RemoteGroup `toml:"groups"` // contains filtered or unexported fields }
type RemoteGroup ¶
type RemoteRepository ¶
type RemoteRepository struct { Name string Remote *Remote WebURL string DefaultBranch string Upstream *RemoteRepository Archived bool }
func (*RemoteRepository) Convert ¶
func (r *RemoteRepository) Convert() (*Repository, error)
func (*RemoteRepository) GetUpstreamName ¶ added in v0.0.2
func (r *RemoteRepository) GetUpstreamName() string
func (*RemoteRepository) GetUpstreamURL ¶ added in v0.0.2
func (r *RemoteRepository) GetUpstreamURL() string
type Repository ¶
type Repository struct { Name string Attach string View int Remote *Remote Protocol string User string Email string CloneURL string Group string Base string // contains filtered or unexported fields }
func NewRepository ¶
func NewRepository(remote *Remote, name string) (*Repository, error)
func ParseRepositoryFullPath ¶
func ParseRepositoryFullPath(cfg *Config, repoFull string) (*Repository, error)
func (*Repository) ColorName ¶
func (repo *Repository) ColorName() string
func (*Repository) Exists ¶
func (repo *Repository) Exists() (bool, error)
func (*Repository) FullName ¶
func (repo *Repository) FullName() string
func (*Repository) Git ¶
func (repo *Repository) Git() *git.Repository
func (*Repository) Normalize ¶
func (repo *Repository) Normalize() error
func (*Repository) Path ¶
func (repo *Repository) Path() string
func (*Repository) PathWithRemote ¶
func (repo *Repository) PathWithRemote() string
type RepositoryAttachment ¶
func (*RepositoryAttachment) FullName ¶
func (a *RepositoryAttachment) FullName() string
type RepositoryMergeOptions ¶
type RepositoryMergeOptions struct { Title string SourceBranch string TargetBranch string Upstream *Repository }
type RepositoryProvider ¶
type RepositoryProvider interface { Create(repo *Repository) error Remove(repo *Repository) error Get(remote *Remote, name string) (*RemoteRepository, error) Search(remote *Remote, opts RepositorySearchOptions) ([]*RemoteRepository, error) List(remote *Remote, group string) ([]*RemoteRepository, error) GetMerge(repo *Repository, opts RepositoryMergeOptions) (string, error) CreateMerge(repo *Repository, opts RepositoryMergeOptions) (string, error) Fork(repo *Repository, name string) (*RemoteRepository, error) GetRelease(repo *Repository, tag string) (*RepositoryRelease, error) CreateRelease(repo *Repository, release *RepositoryRelease) (*RepositoryRelease, error) UploadReleaseFile(repo *Repository, id interface{}, opts RepositoryUploadReleaseFileOptions) error }
type RepositoryRelease ¶
type RepositoryReleaseFile ¶
type RepositorySearchOptions ¶
type RepositoryStorage ¶
type RepositoryStorage interface { Save(repo *Repository) error Remove(repo *Repository) error Get(remote *Remote, name string) (*Repository, error) GetAttach(path string) (*Repository, error) List(remote *Remote) ([]*Repository, error) Close() error }
Click to show internal directories.
Click to hide internal directories.