workflow

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2022 License: MIT Imports: 28 Imported by: 0

Documentation

Index

Constants

Variables

View Source
var (
	ErrNoUpstream = errors.New("this repo does not have an upstream")
	ErrNoRelease  = errors.New("this repo does not have release config")

	ErrHasUncommittedChanges = errors.New("you have uncommitted changes in current branch, please handle them first")
)
View Source
var EmptyCompResult = &CompResult{
	Flag: cobra.ShellCompDirectiveNoFileComp,
}
View Source
var ErrNoProvider = errors.New("require remote provider")

Functions

func Comp

func Comp(actions ...CompAction) func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective)

Types

type Action

type Action interface {
	PreRun(cmd *cobra.Command)

	Run(ctx *Context) error
}

type AttachRepo

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

func (AttachRepo) PreRun

func (AttachRepo) PreRun(cmd *cobra.Command)

func (*AttachRepo) Run

func (wf *AttachRepo) Run(ctx *Context) error

type BranchContext

type BranchContext struct {
	Locals  []*git.BranchDetail
	Current *git.BranchDetail
}

func (*BranchContext) GetBranch added in v0.0.2

func (ctx *BranchContext) GetBranch(name string) (*git.BranchDetail, error)

func (*BranchContext) GetLocalNames added in v0.0.2

func (ctx *BranchContext) GetLocalNames(current bool) []string

type CheckoutLocal

type CheckoutLocal struct{}

func (*CheckoutLocal) PreRun

func (wf *CheckoutLocal) PreRun(cmd *cobra.Command)

func (*CheckoutLocal) Run

func (wf *CheckoutLocal) Run(ctx *Context) error

type CheckoutRemote

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

func (*CheckoutRemote) PreRun

func (wf *CheckoutRemote) PreRun(cmd *cobra.Command)

func (*CheckoutRemote) Run

func (wf *CheckoutRemote) Run(ctx *Context) error

type CheckoutTag

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

func (CheckoutTag) PreRun

func (CheckoutTag) PreRun(cmd *cobra.Command)

func (*CheckoutTag) Run

func (wf *CheckoutTag) Run(ctx *Context) error

type CompAction

type CompAction func(ctx *Context) (*CompResult, error)

type CompResult

type CompResult struct {
	Items []string
	Flag  cobra.ShellCompDirective
}

func CompBranchRemote

func CompBranchRemote(ctx *Context) (*CompResult, error)

func CompBranchRemoteName

func CompBranchRemoteName(ctx *Context) (*CompResult, error)

func CompGroups

func CompGroups(ctx *Context) (*CompResult, error)

func CompJobName

func CompJobName(ctx *Context) (*CompResult, error)

func CompLocalBranches

func CompLocalBranches(ctx *Context) (*CompResult, error)

func CompLocalBranchesNoCurrent

func CompLocalBranchesNoCurrent(ctx *Context) (*CompResult, error)

func CompRemotes

func CompRemotes(ctx *Context) (*CompResult, error)

func CompRepos

func CompRepos(ctx *Context) (*CompResult, error)

func CompTags

func CompTags(ctx *Context) (*CompResult, error)

type ConfigRepo

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

func (*ConfigRepo) PreRun

func (wf *ConfigRepo) PreRun(cmd *cobra.Command)

func (*ConfigRepo) Run

func (wf *ConfigRepo) Run(ctx *Context) error

type Context

type Context struct {
	Config *core.Config

	RepoStorage core.RepositoryStorage

	Args []string

	Remote *core.Remote
	Repo   *core.Repository

	RemoteRepo *core.RemoteRepository

	RepoConfig *repoconfig.Config

	Branch *BranchContext

	Tag *TagContext

	JobManager *job.Manager
	RepoJob    *job.Repository
	SelectJob  *job.Job
	// contains filtered or unexported fields
}

func NewContext

func NewContext(args []string) (*Context, error)

func (*Context) Close

func (ctx *Context) Close() error

func (*Context) GetArg added in v0.0.2

func (ctx *Context) GetArg(idx int, defaultValue string) string

func (*Context) GetArgFunc added in v0.0.2

func (ctx *Context) GetArgFunc(idx int, f func() (string, error)) (string, error)

func (*Context) OnClose

func (ctx *Context) OnClose(f func())

func (*Context) Provider

func (ctx *Context) Provider() (core.RepositoryProvider, error)

func (*Context) RunLoad

func (ctx *Context) RunLoad(f func() error, msg string, args ...interface{}) error

func (*Context) RunProvider

func (ctx *Context) RunProvider(f func(p core.RepositoryProvider) error, msg string, args ...interface{}) error

type CreateBranch

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

func (*CreateBranch) PreRun

func (wf *CreateBranch) PreRun(cmd *cobra.Command)

func (*CreateBranch) Run

func (wf *CreateBranch) Run(ctx *Context) error

type CreateJob

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

func (*CreateJob) PreRun

func (wf *CreateJob) PreRun(cmd *cobra.Command)

func (*CreateJob) Run

func (wf *CreateJob) Run(ctx *Context) error

type CreateTag

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

func (*CreateTag) PreRun

func (wf *CreateTag) PreRun(cmd *cobra.Command)

func (*CreateTag) Run

func (wf *CreateTag) Run(ctx *Context) error

type DescribeBranch added in v0.0.2

type DescribeBranch struct{}

func (*DescribeBranch) PreRun added in v0.0.2

func (wf *DescribeBranch) PreRun(cmd *cobra.Command)

func (*DescribeBranch) Run added in v0.0.2

func (wf *DescribeBranch) Run(ctx *Context) error

type DescribeRepo added in v0.0.2

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

func (*DescribeRepo) PreRun added in v0.0.2

func (wf *DescribeRepo) PreRun(cmd *cobra.Command)

func (*DescribeRepo) Run added in v0.0.2

func (wf *DescribeRepo) Run(ctx *Context) error

type EditJob

type EditJob struct{}

func (*EditJob) PreRun

func (wf *EditJob) PreRun(cmd *cobra.Command)

func (*EditJob) Run

func (wf *EditJob) Run(ctx *Context) error

type Home

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

func (Home) PreRun

func (Home) PreRun(cmd *cobra.Command)

func (*Home) Run

func (wf *Home) Run(ctx *Context) error

type Import

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

func (*Import) PreRun

func (wf *Import) PreRun(cmd *cobra.Command)

func (*Import) Run

func (wf *Import) Run(ctx *Context) error

type InitBranch

type InitBranch struct {
	NoFetch       bool
	BackupCurrent bool
	// contains filtered or unexported fields
}

func (InitBranch) PreRun

func (InitBranch) PreRun(cmd *cobra.Command)

func (*InitBranch) Run

func (wf *InitBranch) Run(ctx *Context) error

type InitRemote

type InitRemote struct {
	Require bool
	// contains filtered or unexported fields
}

func (*InitRemote) PreRun

func (wf *InitRemote) PreRun(cmd *cobra.Command)

func (*InitRemote) Run

func (wf *InitRemote) Run(ctx *Context) error

type InitRepo

type InitRepo struct {
	Local  bool
	Remote bool

	RequireRemote bool

	MustExists    bool
	MustNotExists bool

	MustNoUncommittedChanges bool
	// contains filtered or unexported fields
}

func (*InitRepo) PreRun

func (wf *InitRepo) PreRun(cmd *cobra.Command)

func (*InitRepo) Run

func (wf *InitRepo) Run(ctx *Context) error

type InitTag

type InitTag struct {
	Option bool
	Latest bool

	NoFetch bool

	SelectArg bool
	// contains filtered or unexported fields
}

func (*InitTag) PreRun

func (wf *InitTag) PreRun(cmd *cobra.Command)

func (*InitTag) Run

func (wf *InitTag) Run(ctx *Context) error

type Job

type Job struct {
	Select bool
}

func (*Job) PreRun

func (wf *Job) PreRun(cmd *cobra.Command)

func (*Job) Run

func (wf *Job) Run(ctx *Context) error

type ListBranch

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

func (*ListBranch) PreRun

func (wf *ListBranch) PreRun(cmd *cobra.Command)

func (*ListBranch) Run

func (wf *ListBranch) Run(ctx *Context) error

type ListJob

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

func (ListJob) PreRun

func (ListJob) PreRun(cmd *cobra.Command)

func (*ListJob) Run

func (wf *ListJob) Run(ctx *Context) error

type ListRepo

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

func (ListRepo) PreRun

func (ListRepo) PreRun(cmd *cobra.Command)

func (*ListRepo) Run

func (wf *ListRepo) Run(ctx *Context) error

type ListSize added in v0.0.2

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

func (*ListSize) PreRun added in v0.0.2

func (wf *ListSize) PreRun(cmd *cobra.Command)

func (*ListSize) Run added in v0.0.2

func (wf *ListSize) Run(ctx *Context) error

type ListTag

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

func (ListTag) PreRun

func (ListTag) PreRun(cmd *cobra.Command)

func (*ListTag) Run

func (wf *ListTag) Run(ctx *Context) error

type Merge

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

func (*Merge) PreRun

func (wf *Merge) PreRun(cmd *cobra.Command)

func (*Merge) Run

func (wf *Merge) Run(ctx *Context) error

type OpenBranch added in v0.0.2

type OpenBranch struct{}

func (*OpenBranch) PreRun added in v0.0.2

func (wf *OpenBranch) PreRun(cmd *cobra.Command)

func (*OpenBranch) Run added in v0.0.2

func (wf *OpenBranch) Run(ctx *Context) error

type OpenRelease

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

func (*OpenRelease) PreRun

func (wf *OpenRelease) PreRun(cmd *cobra.Command)

func (*OpenRelease) Run

func (wf *OpenRelease) Run(ctx *Context) error

type OpenRepo

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

func (OpenRepo) PreRun

func (OpenRepo) PreRun(cmd *cobra.Command)

func (*OpenRepo) Run

func (wf *OpenRepo) Run(ctx *Context) error

type OpenUpstream added in v0.0.2

type OpenUpstream struct {
}

func (*OpenUpstream) PreRun added in v0.0.2

func (wf *OpenUpstream) PreRun(cmd *cobra.Command)

func (*OpenUpstream) Run added in v0.0.2

func (wf *OpenUpstream) Run(ctx *Context) error

type RemoveBranch

type RemoveBranch struct{}

func (*RemoveBranch) PreRun

func (wf *RemoveBranch) PreRun(cmd *cobra.Command)

func (*RemoveBranch) Run

func (wf *RemoveBranch) Run(ctx *Context) error

type RemoveJob

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

func (RemoveJob) PreRun

func (RemoveJob) PreRun(cmd *cobra.Command)

func (*RemoveJob) Run

func (wf *RemoveJob) Run(ctx *Context) error

type RemoveRepo

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

func (*RemoveRepo) PreRun

func (wf *RemoveRepo) PreRun(cmd *cobra.Command)

func (*RemoveRepo) Run

func (wf *RemoveRepo) Run(ctx *Context) error

type RemoveTag

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

func (*RemoveTag) PreRun

func (wf *RemoveTag) PreRun(cmd *cobra.Command)

func (*RemoveTag) Run

func (wf *RemoveTag) Run(ctx *Context) error

type RunJob

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

func (*RunJob) PreRun

func (wf *RunJob) PreRun(cmd *cobra.Command)

func (*RunJob) Run

func (wf *RunJob) Run(ctx *Context) error

type RunRelease

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

func (*RunRelease) PreRun

func (wf *RunRelease) PreRun(cmd *cobra.Command)

func (*RunRelease) Run

func (wf *RunRelease) Run(ctx *Context) error

type SyncBranch

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

func (SyncBranch) PreRun

func (SyncBranch) PreRun(cmd *cobra.Command)

func (*SyncBranch) Run

func (wf *SyncBranch) Run(ctx *Context) error

type SyncJob

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

func (*SyncJob) PreRun

func (wf *SyncJob) PreRun(cmd *cobra.Command)

func (*SyncJob) Run

func (wf *SyncJob) Run(ctx *Context) error

type SyncRepo

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

func (SyncRepo) PreRun

func (SyncRepo) PreRun(cmd *cobra.Command)

func (*SyncRepo) Run

func (wf *SyncRepo) Run(ctx *Context) error

type SyncUpstream added in v0.0.2

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

func (*SyncUpstream) PreRun added in v0.0.2

func (wf *SyncUpstream) PreRun(cmd *cobra.Command)

func (*SyncUpstream) Run added in v0.0.2

func (wf *SyncUpstream) Run(ctx *Context) error

type SyncWorkspace

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

func (SyncWorkspace) PreRun

func (SyncWorkspace) PreRun(cmd *cobra.Command)

func (*SyncWorkspace) Run

func (wf *SyncWorkspace) Run(ctx *Context) error

type TagContext

type TagContext struct {
	Tags   []string
	Latest string

	Select string
}

Jump to

Keyboard shortcuts

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