45 lines
1,016 B
Go
45 lines
1,016 B
Go
|
|
package cli
|
||
|
|
|
||
|
|
import (
|
||
|
|
"context"
|
||
|
|
"errors"
|
||
|
|
"io"
|
||
|
|
"os"
|
||
|
|
|
||
|
|
"email-mcp/internal/secretstore"
|
||
|
|
)
|
||
|
|
|
||
|
|
var errSecretStoreNotConfigured = errors.New("secret store is not available in this build yet")
|
||
|
|
var errMCPRunnerNotConfigured = errors.New("mcp runner is not available in this build yet")
|
||
|
|
|
||
|
|
type placeholderStore struct{}
|
||
|
|
|
||
|
|
func (placeholderStore) Save(context.Context, string, secretstore.Credential) error {
|
||
|
|
return errSecretStoreNotConfigured
|
||
|
|
}
|
||
|
|
|
||
|
|
func (placeholderStore) Load(context.Context, string) (secretstore.Credential, error) {
|
||
|
|
return secretstore.Credential{}, errSecretStoreNotConfigured
|
||
|
|
}
|
||
|
|
|
||
|
|
type placeholderRunner struct{}
|
||
|
|
|
||
|
|
func (placeholderRunner) Run(context.Context) error {
|
||
|
|
return errMCPRunnerNotConfigured
|
||
|
|
}
|
||
|
|
|
||
|
|
func BuildApp() *App {
|
||
|
|
return buildApp(os.Stdin, os.Stdout, os.Stderr)
|
||
|
|
}
|
||
|
|
|
||
|
|
func buildApp(stdin io.Reader, stdout io.Writer, stderr io.Writer) *App {
|
||
|
|
_ = stdout
|
||
|
|
|
||
|
|
return NewAppWithDependencies(
|
||
|
|
NewInteractiveSetupPrompter(stdin, stderr),
|
||
|
|
placeholderStore{},
|
||
|
|
placeholderRunner{},
|
||
|
|
stderr,
|
||
|
|
)
|
||
|
|
}
|