Documentation ¶
Index ¶
- Constants
- Variables
- func AddRepoToIssue(repoName string, issueID IssueID) error
- func FinishWorkingOnIssue(issueID IssueID) error
- func OpenPullRequest(issueID IssueID, customTitle string) error
- func StartWorkingOnIssue(customIssueName string, config IssuectlConfig, issueID IssueID) error
- type BackendConfig
- type BackendConfigName
- type BackendType
- type GitHub
- func (g *GitHub) CloseIssue(owner string, repo RepoConfigName, issueID IssueID) error
- func (g *GitHub) GetIssue(owner string, repo RepoConfigName, issueID IssueID) (interface{}, error)
- func (g *GitHub) GetIssueURL(owner string, repo RepoConfigName, issueID IssueID) (string, error)
- func (g *GitHub) LinkIssueToRepo(owner string, repo RepoConfigName, issueID IssueID, pullRequestID string) error
- func (g *GitHub) OpenPullRequest(owner string, repo RepoConfigName, title, body, baseBranch, headBranch string) (*int, error)
- func (g *GitHub) StartIssue(owner string, repo RepoConfigName, issueID IssueID) error
- type GitHubConfig
- type GitLab
- func (g *GitLab) CloseIssue(owner string, repo RepoConfigName, issueID IssueID) error
- func (g *GitLab) GetIssue(owner string, repo RepoConfigName, issueID IssueID) (interface{}, error)
- func (g *GitLab) GetIssueURL(owner string, repo RepoConfigName, issueID IssueID) (string, error)
- func (g *GitLab) LinkIssueToRepo(owner string, repo RepoConfigName, issueID IssueID, pullRequestID string) error
- func (g *GitLab) OpenPullRequest(owner string, repo RepoConfigName, title, body, baseBranch, headBranch string) (*int, error)
- func (g *GitLab) StartIssue(owner string, repo RepoConfigName, issueID IssueID) error
- type GitLabConfig
- type GitUser
- type GitUserName
- type IssueBackend
- type IssueConfig
- type IssueID
- type IssuectlConfig
- type Jira
- func (j *Jira) CloseIssue(owner string, repo RepoConfigName, issueID IssueID) error
- func (j *Jira) GetIssue(owner string, repo RepoConfigName, issueID IssueID) (interface{}, error)
- func (j *Jira) GetIssueURL(owner string, repo RepoConfigName, issueID IssueID) (string, error)
- func (j *Jira) LinkIssueToRepo(owner string, repo RepoConfigName, issueID IssueID, pullRequestID string) error
- func (j *Jira) StartIssue(owner string, repo RepoConfigName, issueID IssueID) error
- type JiraConfig
- type Logger
- type Profile
- type ProfileName
- type RepoConfig
- type RepoConfigName
- type RepoURL
- type RepositoryBackend
- type TextConfig
Constants ¶
View Source
const ( ToDo = "To Do" InProgress = "In Progress" Done = "Done" )
View Source
const ( DefaultStartMessage = "On it 👀" DefaultCloseMessage = "✅" DefaultOpenPRMessage = "Working on changes here: %s" )
View Source
const (
GitHubApi = "https://api.github.com/"
)
Variables ¶
View Source
var DefaultConfigFilePath = getDefaultConfigFilePath()
View Source
var DefaultSSHKeyPath = getDefaultSSHKeyPath()
View Source
var Log = NewLogger()
Log is a global logger
Functions ¶
func AddRepoToIssue ¶ added in v0.1.8
func FinishWorkingOnIssue ¶
FinishWorkingOnIssue finishes work on an issue
func OpenPullRequest ¶
OpenPullRequest opens pull request
func StartWorkingOnIssue ¶
func StartWorkingOnIssue(customIssueName string, config IssuectlConfig, issueID IssueID) error
StartWorkingOnIssue starts work on an issue
Types ¶
type BackendConfig ¶
type BackendConfig struct { // Name of BackendConfig instance Name BackendConfigName `yaml:"name"` // BackendType of this BackendConfig Type BackendType `yaml:"backendType"` GitHub *GitHubConfig `yaml:"github,omitempty"` GitLab *GitLabConfig `yaml:"gitlab,omitempty"` Jira *JiraConfig `yaml:"jira,omitempty"` }
BackendConfig stores configuration for given BackendType
type BackendConfigName ¶
type BackendConfigName string
BackendConfigName is a name of instance of BackendConfig
type BackendType ¶
type BackendType string
BackendType is a name of issue backend
const ( BackendGithub BackendType = "github" BackendGitLab BackendType = "gitlab" BackendJira BackendType = "jira" )
BackendGithub is a BackendType for GitHub
type GitHub ¶
type GitHub struct {
// contains filtered or unexported fields
}
func NewGitHubClient ¶
func (*GitHub) CloseIssue ¶
func (g *GitHub) CloseIssue(owner string, repo RepoConfigName, issueID IssueID) error
func (*GitHub) GetIssue ¶
func (g *GitHub) GetIssue(owner string, repo RepoConfigName, issueID IssueID) (interface{}, error)
func (*GitHub) GetIssueURL ¶ added in v0.1.6
func (*GitHub) LinkIssueToRepo ¶
func (*GitHub) OpenPullRequest ¶
func (*GitHub) StartIssue ¶ added in v0.0.12
func (g *GitHub) StartIssue(owner string, repo RepoConfigName, issueID IssueID) error
type GitHubConfig ¶ added in v0.0.12
type GitLab ¶ added in v0.0.5
type GitLab struct {
// contains filtered or unexported fields
}
func NewGitLabClient ¶ added in v0.0.5
func (*GitLab) CloseIssue ¶ added in v0.0.5
func (g *GitLab) CloseIssue(owner string, repo RepoConfigName, issueID IssueID) error
func (*GitLab) GetIssue ¶ added in v0.0.5
func (g *GitLab) GetIssue(owner string, repo RepoConfigName, issueID IssueID) (interface{}, error)
func (*GitLab) GetIssueURL ¶ added in v0.1.6
func (*GitLab) LinkIssueToRepo ¶ added in v0.0.5
func (*GitLab) OpenPullRequest ¶ added in v0.0.5
func (*GitLab) StartIssue ¶ added in v0.0.12
func (g *GitLab) StartIssue(owner string, repo RepoConfigName, issueID IssueID) error
type GitLabConfig ¶ added in v0.0.12
type GitUser ¶ added in v0.0.6
type GitUser struct { Name GitUserName Email string SSHKey string }
GitUser holds config for git user
type GitUserName ¶ added in v0.0.6
type GitUserName string
type IssueBackend ¶
type IssueBackend interface { LinkIssueToRepo(owner string, repo RepoConfigName, issueID IssueID, pullRequestID string) error CloseIssue(owner string, repo RepoConfigName, issueID IssueID) error StartIssue(owner string, repo RepoConfigName, issueID IssueID) error GetIssue(owner string, repo RepoConfigName, issueID IssueID) (interface{}, error) GetIssueURL(owner string, repo RepoConfigName, issueID IssueID) (string, error) }
type IssueConfig ¶
type IssueConfig struct { Name string `yaml:"name"` ID IssueID `yaml:"id"` RepoBackend BackendConfigName `yaml:"repoBackend"` IssueBackend BackendConfigName `yaml:"issueBackend"` BranchName string `yaml:"branchName"` Repositories []RepoConfigName `yaml:"repositories"` Dir string `yaml:"dir"` Profile ProfileName `yaml:"profile"` }
IssueConfig stores configuration for single issue
type IssuectlConfig ¶
type IssuectlConfig interface { GetInMemory() IssuectlConfig GetPersistent() IssuectlConfig // Profile AddProfile(*Profile) error DeleteProfile(profileName ProfileName) error GetCurrentProfile() ProfileName GetProfile(ProfileName) *Profile GetProfiles() map[ProfileName]*Profile UpdateProfile(*Profile) error UseProfile(profile ProfileName) error // Issues AddIssue(issueConfig *IssueConfig) error DeleteIssue(issueID IssueID) error GetIssue(IssueID) (*IssueConfig, bool) GetIssues() map[IssueID]*IssueConfig // Repositories AddRepository(repoConfig *RepoConfig) error GetRepository(name RepoConfigName) *RepoConfig GetRepositories() map[RepoConfigName]*RepoConfig // Backends AddBackend(backend *BackendConfig) error DeleteBackend(backendName BackendConfigName) error GetBackend(backendName BackendConfigName) *BackendConfig GetBackends() map[BackendConfigName]*BackendConfig // GitUsers AddGitUser(user *GitUser) error DeleteGitUser(userName GitUserName) error GetGitUser(userName GitUserName) (*GitUser, bool) GetGitUsers() map[GitUserName]*GitUser Save() error // TODO: this shouldn't be exposed }
func GetConfig ¶ added in v0.0.11
func GetConfig(cn ProfileName, r map[RepoConfigName]*RepoConfig, b map[BackendConfigName]*BackendConfig, gu map[GitUserName]*GitUser, p map[ProfileName]*Profile) IssuectlConfig
func GetEmptyConfig ¶ added in v0.0.11
func GetEmptyConfig() IssuectlConfig
func LoadConfig ¶
func LoadConfig() IssuectlConfig
type Jira ¶ added in v0.0.12
type Jira struct {
// contains filtered or unexported fields
}
func NewJiraClient ¶ added in v0.0.12
func (*Jira) CloseIssue ¶ added in v0.0.12
func (j *Jira) CloseIssue(owner string, repo RepoConfigName, issueID IssueID) error
func (*Jira) GetIssue ¶ added in v0.0.12
func (j *Jira) GetIssue(owner string, repo RepoConfigName, issueID IssueID) (interface{}, error)
func (*Jira) GetIssueURL ¶ added in v0.1.6
func (*Jira) LinkIssueToRepo ¶ added in v0.0.12
func (*Jira) StartIssue ¶ added in v0.0.12
func (j *Jira) StartIssue(owner string, repo RepoConfigName, issueID IssueID) error
type JiraConfig ¶ added in v0.0.12
type Logger ¶
type Logger struct {
// contains filtered or unexported fields
}
Logger struct holds the verbosity level
func NewLogger ¶
func NewLogger() *Logger
NewLogger parses command line argument for verbosity level and returns a new Logger
type Profile ¶
type Profile struct { Name ProfileName `yaml:"name"` WorkDir string `yaml:"workDir"` IssueBackend BackendConfigName `yaml:"issueBackend"` RepoBackend BackendConfigName `yaml:"repoBackend"` GitUserName GitUserName `yaml:"gituser"` Repositories []RepoConfigName `yaml:"repositories"` // DefaultRepository is now used for Github IssueBackend DefaultRepository RepoConfigName `yaml:"defaultRepository"` }
Profile is a config profile
func (*Profile) AddRepository ¶ added in v0.0.4
func (p *Profile) AddRepository(repo RepoConfigName) error
type RepoConfig ¶
type RepoConfig struct { // Name of this repo Name RepoConfigName `yaml:"name"` // Repo owner Owner string `yaml:"owner"` // URL to this repo RepoURL RepoURL `yaml:"url"` }
RepoConfig stores configuration for given git repo
type RepositoryBackend ¶ added in v0.0.5
type RepositoryBackend interface {
OpenPullRequest(owner string, repo RepoConfigName, title, body, baseBranch, headBranch string) (*int, error)
}
type TextConfig ¶ added in v0.1.5
Click to show internal directories.
Click to hide internal directories.