gitops

package
v0.14.0 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2023 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RefPrefix       = "refs/"
	RefHeadPrefix   = RefPrefix + "heads/"
	RefRemotePrefix = RefPrefix + "remotes/"
	Head            = "HEAD"
)

Variables

View Source
var (
	ErrDetachedHead = errors.New("detached head")
)

Functions

This section is empty.

Types

type Branch added in v0.6.0

type Branch struct {
	Name   string
	Remote string
}

func (*Branch) GetGitMode added in v0.6.0

func (b *Branch) GetGitMode() config.GitMode

func (*Branch) IsLocal added in v0.6.0

func (b *Branch) IsLocal() bool

func (*Branch) Short added in v0.6.0

func (b *Branch) Short() string

func (*Branch) String added in v0.6.0

func (b *Branch) String() string

type CheckoutResult added in v0.6.0

type CheckoutResult string
const (
	CheckoutOk       CheckoutResult = "success"
	CheckoutNotFound CheckoutResult = "not found"
	CheckoutError    CheckoutResult = "error"
)

func (*CheckoutResult) String added in v0.6.0

func (r *CheckoutResult) String() string

type CloneResult

type CloneResult string
const (
	ClonedSuccessfully CloneResult = "cloned"
	ClonedAlready      CloneResult = "already cloned"
	ClonedAgain        CloneResult = "re-cloned"
	CloneError         CloneResult = "error"
)

func (*CloneResult) String added in v0.6.0

func (r *CloneResult) String() string

type Commit added in v0.8.0

type Commit struct {
	Id         string
	AuthorDate time.Time
	Author     CommitUser
	CommitDate time.Time
	Committer  CommitUser
}

type CommitUser added in v0.12.0

type CommitUser struct {
	Name  string
	Email string
}

func (*CommitUser) String added in v0.12.0

func (u *CommitUser) String() string

type CreateResult added in v0.6.0

type CreateResult string
const (
	CreateOk    CreateResult = "created"
	CreateError CreateResult = "error"
)

func (*CreateResult) String added in v0.6.0

func (r *CreateResult) String() string

type GitService added in v0.10.0

type GitService struct {
	// contains filtered or unexported fields
}

func NewGitService added in v0.10.0

func NewGitService(sh shell.Shell) GitService

func (*GitService) Checkout added in v0.10.0

func (g *GitService) Checkout(repo *model.Repo, ref string) (CheckoutResult, error)

func (*GitService) CleanBranches added in v0.10.0

func (g *GitService) CleanBranches(repo *model.Repo, mode config.GitMode) (string, error)

func (*GitService) CloneRepo added in v0.10.0

func (g *GitService) CloneRepo(repo *model.Repo, recreate bool) (CloneResult, error)

func (*GitService) Commit added in v0.10.0

func (g *GitService) Commit(repo *model.Repo, pattern string, message string) error

func (*GitService) CreateBranch added in v0.10.0

func (g *GitService) CreateBranch(repo *model.Repo, name string) (CreateResult, error)

func (*GitService) Discard added in v0.10.0

func (g *GitService) Discard(repo *model.Repo) error

func (*GitService) Fetch added in v0.10.0

func (g *GitService) Fetch(repo *model.Repo) error

func (*GitService) GetBranches added in v0.10.0

func (g *GitService) GetBranches(repo *model.Repo, mode config.GitMode, pattern string) ([]Branch, error)

func (*GitService) GetDefaultBranch added in v0.12.0

func (g *GitService) GetDefaultBranch(repo *model.Repo) (*Branch, error)

func (*GitService) GetUnmergedBranches added in v0.12.0

func (g *GitService) GetUnmergedBranches(repo *model.Repo, mode config.GitMode, ref string) ([]Branch, error)

GetUnmergedBranches returns branches that are not merged to `ref`

func (*GitService) GetUnmergedCommits added in v0.12.0

func (g *GitService) GetUnmergedCommits(repo *model.Repo, branch Branch, ref string) ([]Commit, error)

GetUnmergedCommits returns commits from branch `branch` that are not merged to ref `ref`. The commits are ordered by `committedAt` attribute Returns an error when `branch` and `ref` don't have a common parent

func (*GitService) Pull added in v0.10.0

func (g *GitService) Pull(repo *model.Repo) error

func (*GitService) Push added in v0.10.0

func (g *GitService) Push(repo *model.Repo, branch string, allBranches bool, force bool) error

func (*GitService) RemoveBranch added in v0.10.0

func (g *GitService) RemoveBranch(repo *model.Repo, branch Branch) error

func (*GitService) Status added in v0.10.0

func (g *GitService) Status(repo *model.Repo) (StatusResult, string, error)

type StatusResult added in v0.4.0

type StatusResult string
const (
	StatusClean   StatusResult = "clean"
	StatusDirty   StatusResult = "dirty"
	StatusMissing StatusResult = "missing"
	StatusError   StatusResult = "error"
)

func (*StatusResult) String added in v0.6.0

func (r *StatusResult) String() string

Jump to

Keyboard shortcuts

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