operations

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package operations provides reusable operations for module manipulation.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BumpOperation

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

BumpOperation performs a version bump on a module.

func NewBumpOperation

func NewBumpOperation(fs core.FileSystem, bumpType BumpType, preRelease, metadata string, preserveMetadata bool) *BumpOperation

NewBumpOperation creates a new bump operation.

func (*BumpOperation) Execute

func (op *BumpOperation) Execute(ctx context.Context, mod *workspace.Module) error

Execute performs the bump operation on the module.

func (*BumpOperation) Name

func (op *BumpOperation) Name() string

Name returns the name of this operation.

type BumpType

type BumpType string

BumpType represents the type of version bump to perform.

const (
	BumpPatch   BumpType = "patch"
	BumpMinor   BumpType = "minor"
	BumpMajor   BumpType = "major"
	BumpRelease BumpType = "release"
	BumpAuto    BumpType = "auto"
	BumpPre     BumpType = "pre"
)

type PreOperation

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

PreOperation sets or increments pre-release labels on a module.

func NewPreOperation

func NewPreOperation(fs core.FileSystem, label string, increment bool) *PreOperation

NewPreOperation creates a new pre-release operation.

func (*PreOperation) Execute

func (op *PreOperation) Execute(ctx context.Context, mod *workspace.Module) error

Execute performs the pre-release operation on the module.

func (*PreOperation) Name

func (op *PreOperation) Name() string

Name returns the name of this operation.

type SetOperation

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

SetOperation sets the version of a module to a specific value.

func NewSetOperation

func NewSetOperation(fs core.FileSystem, version string) *SetOperation

NewSetOperation creates a new set operation.

func (*SetOperation) Execute

func (op *SetOperation) Execute(ctx context.Context, mod *workspace.Module) error

Execute sets the version on the module.

func (*SetOperation) Name

func (op *SetOperation) Name() string

Name returns the name of this operation.

type ShowOperation

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

ShowOperation reads and displays the current version of a module.

func NewShowOperation

func NewShowOperation(fs core.FileSystem) *ShowOperation

NewShowOperation creates a new show operation.

func (*ShowOperation) Execute

func (op *ShowOperation) Execute(ctx context.Context, mod *workspace.Module) error

Execute reads the version from the module. The version is stored in the module's CurrentVersion field.

func (*ShowOperation) Name

func (op *ShowOperation) Name() string

Name returns the name of this operation.

type ValidateOperation

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

ValidateOperation validates the version file of a module.

func NewValidateOperation

func NewValidateOperation(fs core.FileSystem) *ValidateOperation

NewValidateOperation creates a new validate operation.

func (*ValidateOperation) Execute

func (op *ValidateOperation) Execute(ctx context.Context, mod *workspace.Module) error

Execute validates the version file in the module. The current version is stored in the module's CurrentVersion field on success.

func (*ValidateOperation) Name

func (op *ValidateOperation) Name() string

Name returns the name of this operation.

Jump to

Keyboard shortcuts

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