domain

package
v0.0.0-...-360a601 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 11, 2024 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthConfig

type AuthConfig struct {
	Host  string `json:"host,omitempty"`
	Token string `json:"token,omitempty"`
}

type BranchProvider

type BranchProvider interface {
	GetBranchName(issue Issue, repo Repository) (branchName string, err error)
}

type Config

type Config map[string]IssueTrackerConfig

type ConfigProvider

type ConfigProvider interface {
	GetConfigByIssueTracker(issueTracker string) (IssueTrackerConfig, error)
	GetConfigFilePath() string
	SaveConfigByIssueTracker(issueTracker string, config IssueTrackerConfig) error
}

type GitProvider

type GitProvider interface {
	BranchExists(branch string) bool
	FetchBranchFromOrigin(branch string) (err error)
	CheckoutNewBranchFromOrigin(branch string, base string) (err error)
	GetCurrentBranch() (branchName string, err error)
	FindBranch(substring string) (branch string, exists bool)
	CheckoutBranch(branch string) (err error)
	GetCommitsToPush(branch string) (commits []string, err error)
	RemoteBranchExists(branch string) (exists bool)
	CommitEmpty(message string) (err error)
	PushBranch(branch string) (err error)
}

type Issue

type Issue interface {
	FormatID() string
	ID() string
	Title() string
	Body() string
	URL() string
	TypeLabel() string
	TrackerType() IssueTrackerType
	Type() issue_types.IssueType
}

type IssueTrackerConfig

type IssueTrackerConfig struct {
	Auth AuthConfig `json:"auth,omitempty"`
}

type IssueTrackerProvider

type IssueTrackerProvider interface {
	GetIssue(identifier string) (issue Issue, err error)
	ParseIssueId(identifier string) (issueId string)
}

type IssueTrackerType

type IssueTrackerType string
const (
	IssueTrackerTypeGithub IssueTrackerType = "github"
	IssueTrackerTypeJira   IssueTrackerType = "jira"
)

func (IssueTrackerType) String

func (i IssueTrackerType) String() string

type Label

type Label struct {
	Id          string
	Name        string
	Description string
	Color       string
}

type PullRequest

type PullRequest struct {
	Title       string
	Number      int
	State       string
	Closed      bool
	Url         string
	HeadRefName string
	BaseRefName string
	Labels      []Label
}

type PullRequestProvider

type PullRequestProvider interface {
	GetPullRequestForBranch(branch string) (pullRequest *PullRequest, err error)
	CreatePullRequest(title string, body string, baseBranch string, headBranch string, draft bool, labels []string) (prUrl string, err error)
}

type Repository

type Repository struct {
	Name             string
	Owner            string
	NameWithOwner    string
	DefaultBranchRef string
}

type RepositoryProvider

type RepositoryProvider interface {
	GetRepository() (repo *Repository, err error)
}

type UserInteractionProvider

type UserInteractionProvider interface {
	AskUserForConfirmation(msg string, defaultAnswer bool) (answer bool, err error)
	SelectOrInputPrompt(message string, validValues []string, variable *string, required bool) error
	SelectOrInput(name string, validValues []string, variable *string, required bool) error
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL