branch

package
v0.0.11 Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2020 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Branch

type Branch interface {
	Checkout(branchName string) error
}

Branch is the interface for the branch package

func New

func New(g git.Git) Branch

New returns a new intance of Tag interface

type Name

type Name struct {
	Delimiter string
	Prefix    string
	Suffix    string
	Title     string
}

Name struct is for branch names

func NewName

func NewName(delimiter string) *Name

NewName returns a new pointer instance of Name

func (Name) FormatStringWithRegexAndDelimiter

func (n Name) FormatStringWithRegexAndDelimiter(str string) string

FormatStringWithRegexAndDelimiter formates a String using a regex with valid chars for branch names

func (Name) Join

func (n Name) Join() string

Join joins n.Prefix, n.Title and n.Suffix together usign the given delimiter. Empty strings are ignored.

func (*Name) SetPrefixWithTemplate

func (n *Name) SetPrefixWithTemplate(prefixTemplatePattern string, templateValues map[string]string) error

SetPrefixWithTemplate sets the Prefix attribute with a Go template pattern string

func (*Name) SetSuffixWithTemplate

func (n *Name) SetSuffixWithTemplate(suffixTemplatePattern string, templateValues map[string]string) error

SetSuffixWithTemplate sets the Suffix attribute with a Go template pattern string

func (*Name) SetTitleWithTemplate

func (n *Name) SetTitleWithTemplate(titleTemplatePattern string, templateValues map[string]string) error

SetTitleWithTemplate sets the Title attribute with a Go template pattern string

func (Name) ValidCharsRegex

func (n Name) ValidCharsRegex() *regexp.Regexp

ValidCharsRegex gives the regex which chars are allowed for branch names

type Obj

type Obj struct {
	Git git.Git
}

Obj is the data structure struct for the branch package

func (Obj) Checkout

func (b Obj) Checkout(branchName string) error

Checkout checks the branch out with the given name using git checkout -b NAME

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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