Documentation ¶
Index ¶
- Constants
- Variables
- func CreateGitHubPR(client *github.Client, title string, body string, branchName string, ...) (*github.PullRequest, error)
- func GetRepoName(localpath string) (string, error)
- type AuthMethod
- type CheckoutOp
- type CloneOp
- type CommitOp
- type GithubRepoFullId
- type LocalRepository
- func CloneToLocalRepository(op CloneOp) (*LocalRepository, error)
- func InitLocalRepository(path string, dryRun bool) (*LocalRepository, error)
- func OpenAndResetRepositoryState(path string, dryRun bool) (*LocalRepository, error)
- func OpenLocalRepository(path string, dryRun bool) (*LocalRepository, error)
- func (localRepo *LocalRepository) AddAll() error
- func (localRepo *LocalRepository) AddFiles(paths ...string) error
- func (localRepo *LocalRepository) CheckoutBranch(op *CheckoutOp) error
- func (localRepo *LocalRepository) Commit(op *CommitOp) error
- func (localRepo *LocalRepository) CurrentBranch() (string, error)
- func (localRepo *LocalRepository) GetRemoteRepoName() (string, error)
- func (localRepo *LocalRepository) HeadShortCommitHash() (string, error)
- func (localRepo *LocalRepository) IsLocalChangesPresent() (bool, error)
- func (localRepo *LocalRepository) Path() string
- func (localRepo *LocalRepository) Pull(auth AuthMethod) (*PullResult, error)
- func (localRepo *LocalRepository) Push(op PushOp) error
- func (localRepo *LocalRepository) Repository() *git.Repository
- func (localRepo *LocalRepository) ResetState() error
- func (localRepo *LocalRepository) SetRemote(url string) error
- func (localRepo *LocalRepository) Worktree() *git.Worktree
- type PullResult
- type PushOp
- type RepositoryCloneErr
- type RepositoryErr
- type RepositoryFullname
Constants ¶
View Source
const MainBranch = "main"
View Source
const OriginRemote = "origin"
Variables ¶
View Source
var (
ErrLocalChangesIsPresent = errors.New("local changes are present")
)
Functions ¶
func CreateGitHubPR ¶ added in v0.25.2
func GetRepoName ¶ added in v0.26.3
Types ¶
type AuthMethod ¶
type AuthMethod interface {
// contains filtered or unexported methods
}
func UrlTokenAuthMethod ¶
func UrlTokenAuthMethod(token string) AuthMethod
type CheckoutOp ¶
type CloneOp ¶
type CloneOp struct { URL string TargetPath string Auth AuthMethod }
type GithubRepoFullId ¶
type GithubRepoFullId struct { RepositoryFullname // contains filtered or unexported fields }
func NewGithubRepoFullId ¶
func NewGithubRepoFullId(repository *github.Repository) GithubRepoFullId
func (GithubRepoFullId) Id ¶
func (i GithubRepoFullId) Id() int
type LocalRepository ¶
type LocalRepository struct { DryRun bool // contains filtered or unexported fields }
func CloneToLocalRepository ¶
func CloneToLocalRepository(op CloneOp) (*LocalRepository, error)
func InitLocalRepository ¶
func InitLocalRepository(path string, dryRun bool) (*LocalRepository, error)
func OpenAndResetRepositoryState ¶
func OpenAndResetRepositoryState(path string, dryRun bool) (*LocalRepository, error)
func OpenLocalRepository ¶
func OpenLocalRepository(path string, dryRun bool) (*LocalRepository, error)
func (*LocalRepository) AddAll ¶
func (localRepo *LocalRepository) AddAll() error
func (*LocalRepository) AddFiles ¶
func (localRepo *LocalRepository) AddFiles(paths ...string) error
func (*LocalRepository) CheckoutBranch ¶
func (localRepo *LocalRepository) CheckoutBranch(op *CheckoutOp) error
func (*LocalRepository) Commit ¶
func (localRepo *LocalRepository) Commit(op *CommitOp) error
func (*LocalRepository) CurrentBranch ¶
func (localRepo *LocalRepository) CurrentBranch() (string, error)
func (*LocalRepository) GetRemoteRepoName ¶ added in v0.23.0
func (localRepo *LocalRepository) GetRemoteRepoName() (string, error)
func (*LocalRepository) HeadShortCommitHash ¶ added in v0.23.0
func (localRepo *LocalRepository) HeadShortCommitHash() (string, error)
HeadShortCommitHash returns short commit hash, currently no support for this feature in go-git lib (some discussions: https://github.com/src-d/go-git/issues/602)
func (*LocalRepository) IsLocalChangesPresent ¶
func (localRepo *LocalRepository) IsLocalChangesPresent() (bool, error)
func (*LocalRepository) Path ¶
func (localRepo *LocalRepository) Path() string
func (*LocalRepository) Pull ¶
func (localRepo *LocalRepository) Pull(auth AuthMethod) (*PullResult, error)
func (*LocalRepository) Push ¶
func (localRepo *LocalRepository) Push(op PushOp) error
func (*LocalRepository) Repository ¶
func (localRepo *LocalRepository) Repository() *git.Repository
func (*LocalRepository) ResetState ¶
func (localRepo *LocalRepository) ResetState() error
func (*LocalRepository) SetRemote ¶
func (localRepo *LocalRepository) SetRemote(url string) error
func (*LocalRepository) Worktree ¶
func (localRepo *LocalRepository) Worktree() *git.Worktree
type PullResult ¶
type PullResult struct {
IsUpdated bool
}
type PushOp ¶ added in v0.25.0
type PushOp struct { Auth AuthMethod BranchName string }
type RepositoryCloneErr ¶ added in v0.23.0
type RepositoryCloneErr struct {
RepositoryErr
}
type RepositoryErr ¶ added in v0.23.0
type RepositoryErr struct {
// contains filtered or unexported fields
}
func (RepositoryErr) Error ¶ added in v0.23.0
func (r RepositoryErr) Error() string
type RepositoryFullname ¶
type RepositoryFullname struct {
// contains filtered or unexported fields
}
func DeriveRepositoryFullname ¶
func DeriveRepositoryFullname(localRepo *LocalRepository) (RepositoryFullname, error)
func DeriveRepositoryFullnameFromUrl ¶
func DeriveRepositoryFullnameFromUrl(githubRepoUrl string) (RepositoryFullname, error)
func (RepositoryFullname) ActionsHttpUrl ¶
func (n RepositoryFullname) ActionsHttpUrl() string
func (RepositoryFullname) HttpUrl ¶
func (n RepositoryFullname) HttpUrl() string
func (RepositoryFullname) Name ¶
func (n RepositoryFullname) Name() string
func (RepositoryFullname) Organization ¶
func (n RepositoryFullname) Organization() string
func (RepositoryFullname) String ¶
func (n RepositoryFullname) String() string
Click to show internal directories.
Click to hide internal directories.