feat: rename config to cli
This commit is contained in:
@@ -5,7 +5,7 @@ import (
|
|||||||
|
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
|
|
||||||
"git.maximhutz.com/max/lambda/internal/config"
|
"git.maximhutz.com/max/lambda/internal/cli"
|
||||||
"git.maximhutz.com/max/lambda/internal/registry"
|
"git.maximhutz.com/max/lambda/internal/registry"
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -27,14 +27,14 @@ func LambdaReduce() *cobra.Command {
|
|||||||
inputPath := args[0]
|
inputPath := args[0]
|
||||||
|
|
||||||
// Get input source.
|
// Get input source.
|
||||||
var source config.Source
|
var source cli.Source
|
||||||
if inputPath == "-" {
|
if inputPath == "-" {
|
||||||
source = config.StdinSource{}
|
source = cli.StdinSource{}
|
||||||
} else {
|
} else {
|
||||||
source = config.FileSource{Path: inputPath}
|
source = cli.FileSource{Path: inputPath}
|
||||||
}
|
}
|
||||||
|
|
||||||
destination := config.StdoutDestination{}
|
destination := cli.StdoutDestination{}
|
||||||
|
|
||||||
r := GetRegistry()
|
r := GetRegistry()
|
||||||
|
|
||||||
|
|||||||
@@ -1,17 +1,17 @@
|
|||||||
package config
|
package cli
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
)
|
)
|
||||||
|
|
||||||
// A method of writing output to the user.
|
// A Destination is method of writing output to the user.
|
||||||
type Destination interface {
|
type Destination interface {
|
||||||
// Write data to this destination.
|
// Write data to this destination.
|
||||||
Write(data string) error
|
Write(data string) error
|
||||||
}
|
}
|
||||||
|
|
||||||
// A destination writing to stdout.
|
// An StdoutDestination writes to stdout.
|
||||||
type StdoutDestination struct{}
|
type StdoutDestination struct{}
|
||||||
|
|
||||||
func (d StdoutDestination) Write(data string) error {
|
func (d StdoutDestination) Write(data string) error {
|
||||||
@@ -19,7 +19,7 @@ func (d StdoutDestination) Write(data string) error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// A destination writing to a file.
|
// A FileDestination writes to a file.
|
||||||
type FileDestination struct{ Path string }
|
type FileDestination struct{ Path string }
|
||||||
|
|
||||||
func (d FileDestination) Write(data string) error {
|
func (d FileDestination) Write(data string) error {
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package config
|
package cli
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"io"
|
"io"
|
||||||
Reference in New Issue
Block a user