forge_lib_git_commit

package
v0.55.0 Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2026 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const ConfigID = ControllerID

ConfigID is the string used to identify this config object.

View Source
const ControllerID = "forge/lib/git/commit"

ControllerID is the ID of the controller.

Variables

View Source
var Version = controller.MustParseVersion("0.0.1")

Version is the version of the controller implementation.

Functions

This section is empty.

Types

type Config

type Config struct {
	// WorktreeObjectKey is the git/worktree object to commit from.
	WorktreeObjectKey string `json:"worktreeObjectKey,omitempty"`
	// RepoObjectKey is the linked git/repo object that owns the index.
	RepoObjectKey string `json:"repoObjectKey,omitempty"`
	// CommitRequest describes the staged paths and commit identity.
	CommitRequest *s4wave_git.CommitFilesRequest `json:"commitRequest,omitempty"`
}

Config is the configuration for committing staged Git Worktree files.

func (*Config) EqualVT

func (c *Config) EqualVT(other *Config) bool

EqualVT checks if two configs are equal.

func (*Config) EqualsConfig

func (c *Config) EqualsConfig(other config.Config) bool

EqualsConfig checks if the other config is equal.

func (*Config) GetCommitRequest

func (c *Config) GetCommitRequest() *s4wave_git.CommitFilesRequest

GetCommitRequest returns the commit request.

func (*Config) GetConfigID

func (c *Config) GetConfigID() string

GetConfigID returns the unique string for this configuration type. This string is stored with the encoded config.

func (*Config) GetRepoObjectKey

func (c *Config) GetRepoObjectKey() string

GetRepoObjectKey returns the Repo object key.

func (*Config) GetWorktreeObjectKey

func (c *Config) GetWorktreeObjectKey() string

GetWorktreeObjectKey returns the Worktree object key.

func (*Config) IsEmpty

func (c *Config) IsEmpty() bool

IsEmpty checks if there are no operations in the config.

func (*Config) MarshalBlock

func (c *Config) MarshalBlock() ([]byte, error)

MarshalBlock marshals the block to binary. This is the initial step of marshaling, before transformations.

func (*Config) MarshalJSON

func (c *Config) MarshalJSON() ([]byte, error)

MarshalJSON marshals the config to JSON.

func (*Config) MarshalProtoJSON

func (c *Config) MarshalProtoJSON(s *json.MarshalState)

MarshalProtoJSON marshals the Config message to JSON.

func (*Config) MarshalToSizedBufferVT

func (c *Config) MarshalToSizedBufferVT(dst []byte) (int, error)

MarshalToSizedBufferVT marshals into a sized buffer.

func (*Config) MarshalVT

func (c *Config) MarshalVT() ([]byte, error)

MarshalVT marshals the config.

func (*Config) ProtoMessage

func (*Config) ProtoMessage()

ProtoMessage marks Config as a protobuf-like message.

func (*Config) Reset

func (c *Config) Reset()

Reset resets the message.

func (*Config) SizeVT

func (c *Config) SizeVT() int

SizeVT returns the marshaled size.

func (*Config) UnmarshalBlock

func (c *Config) UnmarshalBlock(data []byte) error

UnmarshalBlock unmarshals the block to the object. This is the final step of decoding, after transformations.

func (*Config) UnmarshalJSON

func (c *Config) UnmarshalJSON(data []byte) error

UnmarshalJSON unmarshals the config from JSON.

func (*Config) UnmarshalProtoJSON

func (c *Config) UnmarshalProtoJSON(s *json.UnmarshalState)

UnmarshalProtoJSON unmarshals the Config message from JSON.

func (*Config) UnmarshalVT

func (c *Config) UnmarshalVT(data []byte) error

UnmarshalVT unmarshals the config.

func (*Config) Validate

func (c *Config) Validate() error

Validate validates the configuration.

type Controller

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

Controller implements the git commit controller.

func NewController

func NewController(
	le *logrus.Entry,
	bus bus.Bus,
	conf *Config,
) *Controller

NewController constructs a new git commit controller.

func (*Controller) Close

func (c *Controller) Close() error

Close releases any resources used by the controller. Error indicates any issue encountered releasing.

func (*Controller) Execute

func (c *Controller) Execute(ctx context.Context) error

Execute executes the controller goroutine. Returning nil ends execution. Returning an error triggers a retry with backoff.

func (*Controller) GetControllerInfo

func (c *Controller) GetControllerInfo() *controller.Info

GetControllerInfo returns information about the controller.

func (*Controller) HandleDirective

func (c *Controller) HandleDirective(ctx context.Context, inst directive.Instance) ([]directive.Resolver, error)

HandleDirective asks if the handler can resolve the directive.

func (*Controller) InitForgeExecController

func (c *Controller) InitForgeExecController(
	ctx context.Context,
	inputVals forge_target.InputMap,
	handle forge_target.ExecControllerHandle,
) error

InitForgeExecController initializes the Forge execution controller. This is called before Execute(). Any error returned cancels execution of the controller.

type Factory

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

Factory constructs a git commit controller.

func NewFactory

func NewFactory(bus bus.Bus) *Factory

NewFactory builds a factory.

func (*Factory) Construct

func (t *Factory) Construct(
	ctx context.Context,
	conf config.Config,
	opts controller.ConstructOpts,
) (controller.Controller, error)

Construct constructs the associated controller given configuration.

func (*Factory) ConstructConfig

func (t *Factory) ConstructConfig() config.Config

ConstructConfig constructs an instance of the controller configuration.

func (*Factory) GetConfigID

func (t *Factory) GetConfigID() string

GetConfigID returns the configuration ID for the controller.

func (*Factory) GetControllerID

func (t *Factory) GetControllerID() string

GetControllerID returns the unique ID for the controller.

func (*Factory) GetVersion

func (t *Factory) GetVersion() controller.Version

GetVersion returns the version of this controller.

Jump to

Keyboard shortcuts

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