data

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2025 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type TextTemplateValues

type TextTemplateValues struct {
	// BranchName is the specified name of a new git branch
	BranchName string
	// CommitMessage  is the given message of a commit
	CommitMessage string
	// Datetime specific values
	DTYear   string
	DTMonth  string
	DTDay    string
	DTHour   string
	DTMinute string
	DTSecond string
	// Flags custom defined
	Flags map[string]string
	// Git specific values
	GitRemote      string
	GitRepoHttpURL string
	GitRepoName    string
	// GitCommitLogs with information about a single commit
	GitCommitLogs []git.CommitLog
	// UserHomeDir is the home direcotry path of the current user
	UserHomeDir string
	// Type is the specified type flag
	Type string
	// Release specific values
	ReleaseTag    string
	ReleaseTarget string
}

TextTemplateValues has data fields which could be used in text templates (https://golangforall.com/en/post/templates.html)

func NewTextTemplateValues

func NewTextTemplateValues() *TextTemplateValues

NewTextTemplateValues returns a new pointer instance of TextTemplateValues with default values

func (*TextTemplateValues) AddFlag

func (ttv *TextTemplateValues) AddFlag(key, value string)

AddFlag addes or overwrites an new entry into the Flag field under the given key

func (*TextTemplateValues) ParseTemplateString

func (ttv *TextTemplateValues) ParseTemplateString(templateStr string) (string, error)

ParseTemplateString uses a given template string, parses it with the specified fields in the struct and returns the result as string. An error is returned in cases of any error during the process.

Jump to

Keyboard shortcuts

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