workspace

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2025 License: MPL-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BumpFilename

func BumpFilename(base string, suffix string) string

func CollectBumps

func CollectBumps(ctx context.Context, logger *slog.Logger, dir string, cfg *Config) (map[string]*ReleaseGroupStatus, error)

func ConfigFilename

func ConfigFilename(base string) string

func DeleteBumps

func DeleteBumps(ctx context.Context, dir string) error

func Dir

func Dir(base string) string

func GetCurrentVersion

func GetCurrentVersion(ctx context.Context, dir string, group ReleaseGroup) (*semver.Version, error)

func GetNextVersion

func GetNextVersion(ctx context.Context, dir string, group ReleaseGroup, level BumpLevel) (string, error)

func GetWd

func GetWd(start string) (wd string, err error)

func Initialize

func Initialize(baseDir string) error

func ResolveGitInfoForBumps

func ResolveGitInfoForBumps(ctx context.Context, logger *slog.Logger, repo *git.Repository, bumpFiles []string) (map[string]*vcsCommit, error)

func SaveConfig

func SaveConfig(baseDir string, cfg *Config) error

func VersionFilename

func VersionFilename(base string) string

Types

type BumpLevel

type BumpLevel int
const (
	BumpLevelNone  BumpLevel = 0
	BumpLevelPatch BumpLevel = 1
	BumpLevelMinor BumpLevel = 2
	BumpLevelMajor BumpLevel = 3
)

func (BumpLevel) String

func (b BumpLevel) String() string

type Config

type Config struct {
	Groups []ReleaseGroup `json:"groups,omitempty,omitzero" toml:"groups,omitempty,omitzero" yaml:"groups,omitempty,omitzero"`
}

func LoadConfig

func LoadConfig(baseDir string) (*Config, error)

func (*Config) IndexReleaseGroups

func (c *Config) IndexReleaseGroups() map[string]ReleaseGroup

type InvalidConfigError

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

func (*InvalidConfigError) Error

func (e *InvalidConfigError) Error() string

type LogEntry

type LogEntry struct {
	Timestamp int64
	Commit    string
	Content   string
}

type ReleaseGroup

type ReleaseGroup struct {
	Name         string   `json:"name" toml:"name" yaml:"name"`
	DisplayName  string   `json:"display_name,omitempty" toml:"display_name,omitempty" yaml:"display_name,omitempty"`
	ChangelogCMD []string `json:"changelog_cmd,omitempty,omitzero" toml:"changelog_cmd,omitempty,omitzero" yaml:"changelog_cmd,omitempty,omitzero"`
	CatCMD       []string `json:"cat_cmd,omitempty,omitzero" toml:"cat_cmd,omitempty,omitzero" yaml:"cat_cmd,omitempty,omitzero"`
	CurrentCMD   []string `json:"current_cmd,omitempty,omitzero" toml:"current_cmd,omitempty,omitzero" yaml:"current_cmd,omitempty,omitzero"`
	NextCMD      []string `json:"next_cmd,omitempty,omitzero" toml:"next_cmd,omitempty,omitzero" yaml:"next_cmd,omitempty,omitzero"`
}

type ReleaseGroupStatus

type ReleaseGroupStatus struct {
	Level     BumpLevel
	MajorLogs []LogEntry
	MinorLogs []LogEntry
	PatchLogs []LogEntry
}

Jump to

Keyboard shortcuts

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