Documentation
¶
Overview ¶
Package converge provides the command structure for the "converge" CLI tool. This command uses a FileConverger interface to merge multiple files from a source directory into a single file. The design allows for future support of different file types by implementing additional FileConverger variants.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Command ¶
type Command struct {
// contains filtered or unexported fields
}
Command holds the configuration and dependencies for the "converge" command. If a destination file (dst) is specified, it takes precedence over the writer. Otherwise, output defaults to os.Stdout or the provided writer.
func NewCommand ¶
func NewCommand(fc FileConverger, dir string, opts ...Option) *Command
NewCommand returns a new Command with standard defaults.
type FileConverger ¶
type FileConverger interface {
// ConvergeFiles converges all files in the given directory and
// package into one and writes the result to the given output.
ConvergeFiles(ctx context.Context, dir string, w io.Writer) error
}
FileConverger is a type that can converge multiple files into one.
type Option ¶
type Option func(*Command)
Option is a function that configures a Command.
func WithDstFile ¶
WithDstFile sets the destination file to use for the output.
func WithWriter ¶
WithWriter sets the writer to use for the output.