cli

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2026 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrMCPRuntimeUnavailable = errors.New("runtime is not running; run dataporch run")
)

Functions

This section is empty.

Types

type CommandRunner

type CommandRunner interface {
	Run(context.Context, string, ...string) ([]byte, error)
}

func NewCommandRunner

func NewCommandRunner(command func(context.Context, string, ...string) *exec.Cmd) CommandRunner

type Dependencies

type Dependencies struct {
	Stdin                  *os.File
	Stdout, Stderr         io.Writer
	LookupEnv              config.LookupEnv
	UserHomeDir            config.UserHomeDir
	IsTerminal             func(int) bool
	ReadPassword           func(int) ([]byte, error)
	ReadConfirmation       func(*os.File) (string, error)
	InitializeSecrets      func(config.Config) error
	RunApplication         func(context.Context, config.Config) error
	NewClient              func(string) (ImportClient, error)
	NewAdminClient         func(string) (MCPTokenClient, error)
	Version                string
	InvocationPath         string
	ProtectedFileValidator ProtectedFileValidator
	NewServiceManager      func(config.Config) (ServiceManager, error)
	HealthChecker          HealthChecker
	RunMCPAdapter          RunMCPAdapter
}

type EnvironmentVariable

type EnvironmentVariable struct{ Name, Value string }

type HealthChecker

type HealthChecker interface {
	Check(context.Context, string) error
	Wait(context.Context, string) error
}

func NewHealthChecker

func NewHealthChecker() HealthChecker

type ImportClient

type ImportClient interface {
	Import(context.Context, connection.ImportRequest) (connection.ImportResult, error)
}

func NewUnixClient

func NewUnixClient(socketPath string) (ImportClient, error)

type MCPTokenClient

type MCPTokenClient interface {
	CreateMCPToken(context.Context) (string, mcptoken.Metadata, error)
	MCPTokenStatus(context.Context) (mcptoken.Status, error)
	RotateMCPToken(context.Context) (string, mcptoken.Metadata, error)
	RevokeMCPToken(context.Context) error
}

func NewMCPTokenClient

func NewMCPTokenClient(socketPath string) (MCPTokenClient, error)

type NativeState

type NativeState string
const (
	NativeRunning NativeState = "running"
	NativeStopped NativeState = "stopped"
	NativeFailed  NativeState = "failed"
)

type NativeStatus

type NativeStatus struct {
	Registered bool
	State      NativeState
	PID        int
}

type ProtectedFileValidator

type ProtectedFileValidator func(string) error

type RunMCPAdapter

type RunMCPAdapter func(context.Context, config.Config, io.Reader, io.Writer) error

type Runner

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

func New

func New(dependencies Dependencies) (*Runner, error)

func (*Runner) Execute

func (r *Runner) Execute(ctx context.Context, args []string) int

type ServiceDefinition

type ServiceDefinition struct {
	Executable             string
	Arguments              []string
	Environment            []EnvironmentVariable
	StdoutPath, StderrPath string
}

type ServiceManager

type ServiceManager interface {
	Register(context.Context, ServiceDefinition) error
	Start(context.Context) error
	Restart(context.Context) error
	Stop(context.Context) error
	Unregister(context.Context) error
	Status(context.Context) (NativeStatus, error)
	DefinitionPath() string
	LogLocation() string
}

func NewNativeServiceManager

func NewNativeServiceManager(goos, home string, uid int, runner CommandRunner) (ServiceManager, error)

Jump to

Keyboard shortcuts

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