types

package
v1.5.8 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2025 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Replace        FileExistsAction = "replace"
	Skip           FileExistsAction = "skip"
	ReplaceIfNewer FileExistsAction = "replace_if_newer"

	Commit ChangelogType = "commit"
	Tag    ChangelogType = "tag"

	Include ChangelogConditionType = "include"
	Exclude ChangelogConditionType = "exclude"

	Asc  SortingType = "asc"
	Desc SortingType = "desc"

	StripPrefix TransformType = "stripPrefix"
	StripSuffix TransformType = "stripSuffix"
	RemoveAll   TransformType = "removeAll"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type BuildType

type BuildType string

type Builds

type Builds struct {
	Release     []string `yaml:"release"`
	LastVersion []string `yaml:"lastVersion,omitempty"`
}

type ChangelogConditionType

type ChangelogConditionType string

type ChangelogType

type ChangelogType string

type Changes

type Changes struct {
	Added    []string
	Modified []string
	Deleted  []string
	Moved    []string
}

func (*Changes) IsChangedFile

func (o *Changes) IsChangedFile(path string) bool

IsChangedFile checks whether the given file path corresponds to a file that has been added or modified.

Parameters:

  • path: The file path to check.

Returns:

  • true if the file is in the list of added or modified files.
  • false otherwise.

Behavior:

  • Iterates through the `Added` and `Modified` slices of the `Changes` struct.
  • Uses `strings.HasSuffix` to check if the provided path ends with any of the added or modified file names.
  • Returns true on the first match, otherwise false.

Notes:

  • This method assumes that `o.Added` and `o.Modified` contain relative or base file names.
  • If files are stored with full paths in `o.Added` and `o.Modified`, this method may produce false negatives.

Example:

changes := Changes{
    Added:    []string{"file1.txt", "dir/file2.go"},
    Modified: []string{"config.yaml"},
}
fmt.Println(changes.IsChangedFile("project/dir/file2.go")) // true
fmt.Println(changes.IsChangedFile("config.yaml"))         // true
fmt.Println(changes.IsChangedFile("untracked.txt"))       // false

type FileExistsAction

type FileExistsAction string

type Log added in v1.5.4

type Log struct {
	Dir        string `yaml:"dir"`
	MaxSize    int    `yaml:"maxSize"`
	MaxBackups int    `yaml:"maxBackups"`
	MaxAge     int    `yaml:"maxAge"`
	LocalTime  bool   `yaml:"localTime"`
	Compress   bool   `yaml:"compress"`
}

type Path added in v1.5.1

type Path struct {
	From           string
	To             string
	ActionIfExists FileExistsAction
	Convert        bool
}

type Prompt added in v1.4.2

type Prompt struct {
	Value string
}

func NewPrompt added in v1.4.2

func NewPrompt() *Prompt

func (*Prompt) GetValue added in v1.4.2

func (p *Prompt) GetValue() string

func (*Prompt) Input added in v1.4.2

func (p *Prompt) Input(title string, validator func(string) error) error

type SortingType added in v1.4.4

type SortingType string

type Stage

type Stage struct {
	Name               string           `yaml:"name"`
	To                 string           `yaml:"to"`
	ActionIfFileExists FileExistsAction `yaml:"actionIfFileExists"`
	From               []string         `yaml:"from"`
	Filter             []string         `yaml:"filter,omitempty"`
	ConvertTo1251      bool             `yaml:"convertTo1251,omitempty"`
}

type TransformType added in v1.5.5

type TransformType string

type TypeValue

type TypeValue[T1 any, T2 any] struct {
	Type  T1 `yaml:"type"`
	Value T2 `yaml:"value"`
}

type VersionLabel added in v1.4.4

type VersionLabel string
const (
	Alpha  VersionLabel = "alpha"
	Beta   VersionLabel = "beta"
	Stable VersionLabel = "stable"
)

type Versions added in v1.4.4

type Versions map[string]VersionLabel

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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