cli

package
v0.2.3 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2025 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Execute

func Execute() error

Execute runs the root command.

func FindAvailablePort

func FindAvailablePort(startPort, endPort int) (int, error)

FindAvailablePort finds an available port in the given range.

func OpenBrowser

func OpenBrowser(url string) error

OpenBrowser opens the default browser to the given URL.

func SetServices

func SetServices(s *Services)

SetServices injects service implementations for CLI commands.

func SetTUIConfig

func SetTUIConfig(config *TUIConfig)

SetTUIConfig sets the configuration for the TUI command.

func SetVersion

func SetVersion(v string)

SetVersion sets the version string for the CLI.

Types

type OAuthCallbackServer

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

OAuthCallbackServer handles OAuth redirect callbacks. It starts a local HTTP server to receive the authorization code.

func NewOAuthCallbackServer

func NewOAuthCallbackServer(port int, expectedState string) *OAuthCallbackServer

NewOAuthCallbackServer creates a new OAuth callback server. The expectedState is used to validate the callback matches the request.

func (*OAuthCallbackServer) Port

func (s *OAuthCallbackServer) Port() int

Port returns the port the server is listening on.

func (*OAuthCallbackServer) RedirectURI

func (s *OAuthCallbackServer) RedirectURI() string

RedirectURI returns the redirect URI for this callback server.

func (*OAuthCallbackServer) Start

func (s *OAuthCallbackServer) Start() error

Start starts the callback server on the configured port.

func (*OAuthCallbackServer) Stop

func (s *OAuthCallbackServer) Stop() error

Stop shuts down the callback server.

func (*OAuthCallbackServer) WaitForCode

func (s *OAuthCallbackServer) WaitForCode(timeout time.Duration) (string, error)

WaitForCode blocks until the authorization code is received or timeout.

type Services

type Services struct {
	Search            driving.SearchService
	Source            driving.SourceService
	Sync              driving.SyncOrchestrator
	Document          driving.DocumentService
	ConnectorRegistry driving.ConnectorRegistry
	ProviderRegistry  driving.ProviderRegistry
	Settings          driving.SettingsService
	AuthProvider      driving.AuthProviderService
	Credentials       driving.CredentialsService
}

Services holds configuration for CLI commands.

type TUIConfig

type TUIConfig struct {
	SearchService       driving.SearchService
	SourceService       driving.SourceService
	SyncOrchestrator    driving.SyncOrchestrator
	ResultActionService driving.ResultActionService
	DocumentService     driving.DocumentService
	ConnectorRegistry   driving.ConnectorRegistry
	ProviderRegistry    driving.ProviderRegistry
	SettingsService     driving.SettingsService
	CredentialsService  driving.CredentialsService
	AuthProviderService driving.AuthProviderService
	Scheduler           driving.Scheduler
	SchedulerConfig     domain.SchedulerConfig
}

TUIConfig holds configuration for the TUI command.

Jump to

Keyboard shortcuts

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