shared

package
v0.28.0 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2026 License: MIT Imports: 23 Imported by: 0

Documentation

Overview

Package shared provides shared state and configuration for TokMan CLI commands.

The shared package centralizes CLI flag state management through the AppState struct, replacing global variables with a testable, concurrent design.

State Management

AppState encapsulates all CLI flag state with proper mutex protection:

state := shared.Global()
if state.IsVerbose() { ... }

Flag Configuration

Use SetFlags to atomically update all flag values:

shared.SetFlags(shared.FlagConfig{
    Verbose: 2,
    DryRun: false,
    TokenBudget: 2000,
})

Backward Compatibility

Package-level accessor functions (e.g., shared.IsVerbose()) are provided for backward compatibility with existing code. New code should pass AppState explicitly where possible.

Index

Constants

This section is empty.

Variables

View Source
var (
	CfgFile              string
	Verbose              int
	DryRun               bool
	UltraCompact         bool
	SkipEnv              bool
	QueryIntent          string
	LLMEnabled           bool
	TokenBudget          int
	FallbackArgs         []string
	LayerPreset          string
	LayerProfile         string
	OutputFile           string
	QuietMode            bool
	JSONOutput           bool
	RemoteMode           bool
	CompressionAddr      string
	AnalyticsAddr        string
	RemoteTimeout        int
	CompactionEnabled    bool
	CompactionThreshold  int
	CompactionPreserve   int
	CompactionMaxTokens  int
	CompactionSnapshot   bool
	CompactionAutoDetect bool
	ReversibleEnabled    bool
	EnableLayers         []string
	DisableLayers        []string
	StreamMode           bool
	PolicyRouter         bool
	Extractive           bool
	ExtractiveMax        int
	ExtractiveHead       int
	ExtractiveTail       int
	ExtractiveSignal     int
	QualityGuardrail     bool
	DiffAdapt            bool
	EPiC                 bool
	SSDP                 bool
	AgentOCR             bool
	S2MAD                bool
	ACON                 bool
	ResearchPack         bool
	LatentCollab         bool
	GraphCoT             bool
	RoleBudget           bool
	SWEAdaptive          bool
	AgentOCRHistory      bool
	PlanBudget           bool
	LightMem             bool
	PathShorten          bool
	JSONSampler          bool
	ContextCrunch        bool
	SearchCrunch         bool
	StructCollapse       bool
)
View Source
var Version string = "dev"

Version is set at build time.

Functions

func ExecuteAndRecord

func ExecuteAndRecord(name string, fn func() (string, string, error)) error

ExecuteAndRecord runs a command function, prints output, and records metrics. This consolidates the common pattern of: time -> execute -> print -> record. Returns an error instead of calling os.Exit so callers control exit behavior.

func GetAnalyticsAddr

func GetAnalyticsAddr() string

GetAnalyticsAddr returns the analytics service address.

func GetBuffer

func GetBuffer() *bytes.Buffer

func GetCachedConfig

func GetCachedConfig() (*config.Config, error)

GetCachedConfig returns the cached config, loading it on first access.

func GetCompressionAddr

func GetCompressionAddr() string

GetCompressionAddr returns the compression service address.

func GetConfig

func GetConfig() (*config.Config, error)

GetConfig returns the cached configuration.

func GetConfigDir

func GetConfigDir() string

GetConfigDir returns the directory that contains the effective config file.

func GetConfigPath

func GetConfigPath() string

GetConfigPath returns the effective config path, honoring the shared override when --config is provided.

func GetDataPath

func GetDataPath() string

GetDataPath returns the TokMan data directory.

func GetDatabasePath

func GetDatabasePath() string

GetDatabasePath returns the effective tracking database path using the loaded config when available, falling back to default path resolution.

func GetDisableLayers

func GetDisableLayers() []string

GetDisableLayers returns layers to explicitly disable.

func GetEnableLayers

func GetEnableLayers() []string

GetEnableLayers returns layers to explicitly enable.

func GetExtractiveHead added in v0.28.0

func GetExtractiveHead() int

GetExtractiveHead returns preserved head lines for extractive prefilter.

func GetExtractiveMax added in v0.28.0

func GetExtractiveMax() int

GetExtractiveMax returns max lines for extractive prefilter.

func GetExtractiveSignal added in v0.28.0

func GetExtractiveSignal() int

GetExtractiveSignal returns signal line budget for extractive prefilter.

func GetExtractiveTail added in v0.28.0

func GetExtractiveTail() int

GetExtractiveTail returns preserved tail lines for extractive prefilter.

func GetFiltersDir

func GetFiltersDir() string

GetFiltersDir returns the effective user filters directory.

func GetHooksPath

func GetHooksPath() string

GetHooksPath returns the TokMan hooks directory.

func GetLayerPreset

func GetLayerPreset() string

GetLayerPreset returns the layer preset from flag or environment.

func GetLayerProfile

func GetLayerProfile() string

GetLayerProfile returns the compression profile from flag or environment.

func GetProjectPath

func GetProjectPath() string

GetProjectPath returns the canonical current working directory.

func GetQueryIntent

func GetQueryIntent() string

GetQueryIntent returns the query intent from flag or environment.

func GetRemoteTimeout

func GetRemoteTimeout() int

GetRemoteTimeout returns the remote operation timeout in seconds.

func GetTokenBudget

func GetTokenBudget() int

GetTokenBudget returns the token budget from flag or environment.

func IsACONEnabled added in v0.28.0

func IsACONEnabled() bool

IsACONEnabled returns true if ACON layer is enabled.

func IsAgentOCREnabled added in v0.28.0

func IsAgentOCREnabled() bool

IsAgentOCREnabled returns true if AgentOCR layer is enabled.

func IsAgentOCRHistoryEnabled added in v0.28.0

func IsAgentOCRHistoryEnabled() bool

IsAgentOCRHistoryEnabled returns true if agent-ocr-history layer is enabled.

func IsContextCrunchEnabled added in v0.28.0

func IsContextCrunchEnabled() bool

IsContextCrunchEnabled returns true if context-crunch layer is enabled.

func IsDiffAdaptEnabled added in v0.28.0

func IsDiffAdaptEnabled() bool

IsDiffAdaptEnabled returns true if DiffAdapt layer is enabled.

func IsEPiCEnabled added in v0.28.0

func IsEPiCEnabled() bool

IsEPiCEnabled returns true if EPiC layer is enabled.

func IsExtractiveEnabled added in v0.28.0

func IsExtractiveEnabled() bool

IsExtractiveEnabled returns true if extractive prefilter is enabled.

func IsGraphCoTEnabled added in v0.28.0

func IsGraphCoTEnabled() bool

IsGraphCoTEnabled returns true if graph-cot layer is enabled.

func IsJSONSamplerEnabled added in v0.28.0

func IsJSONSamplerEnabled() bool

IsJSONSamplerEnabled returns true if json-sampler layer is enabled.

func IsLLMEnabled

func IsLLMEnabled() bool

IsLLMEnabled returns true if LLM compression is enabled.

func IsLatentCollabEnabled added in v0.28.0

func IsLatentCollabEnabled() bool

IsLatentCollabEnabled returns true if latent-collab layer is enabled.

func IsLightMemEnabled added in v0.28.0

func IsLightMemEnabled() bool

IsLightMemEnabled returns true if lightmem layer is enabled.

func IsPathShortenEnabled added in v0.28.0

func IsPathShortenEnabled() bool

IsPathShortenEnabled returns true if path-shorten layer is enabled.

func IsPlanBudgetEnabled added in v0.28.0

func IsPlanBudgetEnabled() bool

IsPlanBudgetEnabled returns true if plan-budget layer is enabled.

func IsPolicyRouterEnabled added in v0.28.0

func IsPolicyRouterEnabled() bool

IsPolicyRouterEnabled returns true if policy router is enabled.

func IsQualityGuardrailEnabled added in v0.28.0

func IsQualityGuardrailEnabled() bool

IsQualityGuardrailEnabled returns true if quality guardrail is enabled.

func IsQuietMode

func IsQuietMode() bool

IsQuietMode returns true if quiet mode is enabled.

func IsRemoteMode

func IsRemoteMode() bool

IsRemoteMode returns true if remote mode is enabled.

func IsResearchPackEnabled added in v0.28.0

func IsResearchPackEnabled() bool

IsResearchPackEnabled returns true if research layer pack is enabled.

func IsReversibleEnabled

func IsReversibleEnabled() bool

IsReversibleEnabled returns true if reversible mode is enabled.

func IsRoleBudgetEnabled added in v0.28.0

func IsRoleBudgetEnabled() bool

IsRoleBudgetEnabled returns true if role-budget layer is enabled.

func IsS2MADEnabled added in v0.28.0

func IsS2MADEnabled() bool

IsS2MADEnabled returns true if S2-MAD layer is enabled.

func IsSSDPEnabled added in v0.28.0

func IsSSDPEnabled() bool

IsSSDPEnabled returns true if SSDP layer is enabled.

func IsSWEAdaptiveEnabled added in v0.28.0

func IsSWEAdaptiveEnabled() bool

IsSWEAdaptiveEnabled returns true if swe-adaptive-loop layer is enabled.

func IsSearchCrunchEnabled added in v0.28.0

func IsSearchCrunchEnabled() bool

IsSearchCrunchEnabled returns true if search-crunch layer is enabled.

func IsStreamMode

func IsStreamMode() bool

IsStreamMode returns true if streaming mode is enabled for large inputs.

func IsStructCollapseEnabled added in v0.28.0

func IsStructCollapseEnabled() bool

IsStructCollapseEnabled returns true if structural-collapse layer is enabled.

func IsUltraCompact

func IsUltraCompact() bool

IsUltraCompact returns true if ultra-compact mode is enabled.

func IsVerbose

func IsVerbose() bool

IsVerbose returns true if verbose mode is enabled.

func OpenTracker

func OpenTracker() (*tracking.Tracker, error)

OpenTracker opens the tracking database using the effective configured path.

func PrintTokenSavings

func PrintTokenSavings(originalTokens, filteredTokens int)

PrintTokenSavings prints token savings info to stderr when in verbose mode.

func PutBuffer

func PutBuffer(buf *bytes.Buffer)

func RecordCommand

func RecordCommand(command, originalOutput, filteredOutput string, execTimeMs int64, success bool) error

RecordCommand records command execution metrics to the tracking database.

func RemoteCompress

func RemoteCompress(input, mode string, budget int) (output string, tokensSaved int, err error)

RemoteCompress performs compression via gRPC service. Returns the compressed output and tokens saved, or an error.

func RemoteRecordAnalytics

func RemoteRecordAnalytics(command string, originalTokens, filteredTokens int, execTimeMs int64, success bool) error

RemoteRecordAnalytics sends command metrics to the analytics service.

func RootCmd

func RootCmd() any

RootCmd returns the stored root command.

func RunAndCapture

func RunAndCapture(cmd string, args []string) (output string, exitCode int, err error)

RunAndCapture executes a command and captures stdout/stderr. This consolidates the common pattern of: exec.Command -> StdoutPipe -> StderrPipe -> Start -> Wait. Returns combined stdout and stderr, exit code, and any execution error.

func SanitizeArgs

func SanitizeArgs(args []string) error

SanitizeArgs validates and sanitizes command arguments. Returns error if arguments contain dangerous patterns.

func SetConfig deprecated

func SetConfig(cfg FlagConfig)

Backward compatibility: SetConfig alias for SetFlags

Deprecated: Use SetFlags instead. This alias exists only for callers that haven't migrated to the new naming convention.

func SetConfigFile

func SetConfigFile(path string)

SetConfigFile sets the config file path.

func SetFlags

func SetFlags(cfg FlagConfig)

SetFlags sets all flag values atomically on the global state.

func SetRootCmd

func SetRootCmd(cmd any)

SetRootCmd stores the root command reference.

func ShortenPath

func ShortenPath(path string) string

ShortenPath shortens a file path for display.

func TeeOnFailure

func TeeOnFailure(raw string, commandSlug string, err error) string

TeeOnFailure writes output to tee file on error.

func Truncate

func Truncate(s string, maxLen int) string

Truncate truncates a string to maxLen characters including the "..." suffix.

func TruncateLine

func TruncateLine(line string, maxLen int) string

TruncateLine truncates a line to maxLen characters.

func TryJSONSchema

func TryJSONSchema(jsonStr string, maxDepth int) string

TryJSONSchema generates a JSON schema from a JSON string.

Types

type AppState

type AppState struct {

	// Global flags set by CLI
	CfgFile      string
	Verbose      int
	DryRun       bool
	UltraCompact bool
	SkipEnv      bool
	QueryIntent  string
	LLMEnabled   bool
	TokenBudget  int
	FallbackArgs []string
	LayerPreset  string
	LayerProfile string
	OutputFile   string
	QuietMode    bool
	JSONOutput   bool

	// Remote mode flags (Phase 4)
	RemoteMode      bool
	CompressionAddr string
	AnalyticsAddr   string
	RemoteTimeout   int // seconds

	// Compaction flags
	CompactionEnabled    bool
	CompactionThreshold  int
	CompactionPreserve   int
	CompactionMaxTokens  int
	CompactionSnapshot   bool
	CompactionAutoDetect bool

	// Reversible mode
	ReversibleEnabled bool

	// Custom layer configuration
	EnableLayers     []string
	DisableLayers    []string
	StreamMode       bool
	PolicyRouter     bool
	Extractive       bool
	ExtractiveMax    int
	ExtractiveHead   int
	ExtractiveTail   int
	ExtractiveSignal int
	QualityGuardrail bool
	DiffAdapt        bool
	EPiC             bool
	SSDP             bool
	AgentOCR         bool
	S2MAD            bool
	ACON             bool
	ResearchPack     bool
	LatentCollab     bool
	GraphCoT         bool
	RoleBudget       bool
	SWEAdaptive      bool
	AgentOCRHistory  bool
	PlanBudget       bool
	LightMem         bool
	PathShorten      bool
	JSONSampler      bool
	ContextCrunch    bool // Enable ContextCrunch (merged LogCrunch + DiffCrunch)
	SearchCrunch     bool
	StructCollapse   bool
	AdaptiveLearning bool // Enable AdaptiveLearning (merged EngramLearner + TieredSummary)
	// contains filtered or unexported fields
}

AppState encapsulates all CLI flag state in a single struct. This replaces the global variable pattern and enables: - Testability (pass different state to different tests) - Concurrency (multiple commands with different configs) - Dependency injection (pass state explicitly)

func Global

func Global() *AppState

Global returns the global AppState instance. Deprecated: Pass AppState explicitly where possible.

func (*AppState) GetAnalyticsAddr

func (s *AppState) GetAnalyticsAddr() string

GetAnalyticsAddr returns the analytics service address.

func (*AppState) GetCompressionAddr

func (s *AppState) GetCompressionAddr() string

GetCompressionAddr returns the compression service address.

func (*AppState) GetDisableLayers

func (s *AppState) GetDisableLayers() []string

GetDisableLayers returns layers to explicitly disable.

func (*AppState) GetEnableLayers

func (s *AppState) GetEnableLayers() []string

GetEnableLayers returns layers to explicitly enable.

func (*AppState) GetExtractiveHead added in v0.28.0

func (s *AppState) GetExtractiveHead() int

GetExtractiveHead returns preserved head lines for extractive prefilter.

func (*AppState) GetExtractiveMax added in v0.28.0

func (s *AppState) GetExtractiveMax() int

GetExtractiveMax returns max lines for extractive prefilter.

func (*AppState) GetExtractiveSignal added in v0.28.0

func (s *AppState) GetExtractiveSignal() int

GetExtractiveSignal returns signal line budget for extractive prefilter.

func (*AppState) GetExtractiveTail added in v0.28.0

func (s *AppState) GetExtractiveTail() int

GetExtractiveTail returns preserved tail lines for extractive prefilter.

func (*AppState) GetLayerPreset

func (s *AppState) GetLayerPreset() string

GetLayerPreset returns the layer preset from flag or environment.

func (*AppState) GetQueryIntent

func (s *AppState) GetQueryIntent() string

GetQueryIntent returns the query intent from flag or environment.

func (*AppState) GetRemoteTimeout

func (s *AppState) GetRemoteTimeout() int

GetRemoteTimeout returns the remote operation timeout in seconds.

func (*AppState) GetTokenBudget

func (s *AppState) GetTokenBudget() int

GetTokenBudget returns the token budget from flag or environment.

func (*AppState) IsACONEnabled added in v0.28.0

func (s *AppState) IsACONEnabled() bool

IsACONEnabled returns true if ACON layer is enabled.

func (*AppState) IsAgentOCREnabled added in v0.28.0

func (s *AppState) IsAgentOCREnabled() bool

IsAgentOCREnabled returns true if AgentOCR layer is enabled.

func (*AppState) IsAgentOCRHistoryEnabled added in v0.28.0

func (s *AppState) IsAgentOCRHistoryEnabled() bool

IsAgentOCRHistoryEnabled returns true if agent OCR history layer is enabled.

func (*AppState) IsContextCrunchEnabled added in v0.28.0

func (s *AppState) IsContextCrunchEnabled() bool

IsContextCrunchEnabled returns true if context-crunch layer is enabled.

func (*AppState) IsDiffAdaptEnabled added in v0.28.0

func (s *AppState) IsDiffAdaptEnabled() bool

IsDiffAdaptEnabled returns true if DiffAdapt layer is enabled.

func (*AppState) IsEPiCEnabled added in v0.28.0

func (s *AppState) IsEPiCEnabled() bool

IsEPiCEnabled returns true if EPiC layer is enabled.

func (*AppState) IsExtractiveEnabled added in v0.28.0

func (s *AppState) IsExtractiveEnabled() bool

IsExtractiveEnabled returns true if extractive prefilter is enabled.

func (*AppState) IsGraphCoTEnabled added in v0.28.0

func (s *AppState) IsGraphCoTEnabled() bool

IsGraphCoTEnabled returns true if graph-CoT layer is enabled.

func (*AppState) IsJSONSamplerEnabled added in v0.28.0

func (s *AppState) IsJSONSamplerEnabled() bool

IsJSONSamplerEnabled returns true if json-sampler layer is enabled.

func (*AppState) IsLLMEnabled

func (s *AppState) IsLLMEnabled() bool

IsLLMEnabled returns true if LLM compression is enabled.

func (*AppState) IsLatentCollabEnabled added in v0.28.0

func (s *AppState) IsLatentCollabEnabled() bool

IsLatentCollabEnabled returns true if latent collaboration layer is enabled.

func (*AppState) IsLightMemEnabled added in v0.28.0

func (s *AppState) IsLightMemEnabled() bool

IsLightMemEnabled returns true if lightmem layer is enabled.

func (*AppState) IsPathShortenEnabled added in v0.28.0

func (s *AppState) IsPathShortenEnabled() bool

IsPathShortenEnabled returns true if path-shorten layer is enabled.

func (*AppState) IsPlanBudgetEnabled added in v0.28.0

func (s *AppState) IsPlanBudgetEnabled() bool

IsPlanBudgetEnabled returns true if plan-budget layer is enabled.

func (*AppState) IsPolicyRouterEnabled added in v0.28.0

func (s *AppState) IsPolicyRouterEnabled() bool

IsPolicyRouterEnabled returns true if policy router mode is enabled.

func (*AppState) IsQualityGuardrailEnabled added in v0.28.0

func (s *AppState) IsQualityGuardrailEnabled() bool

IsQualityGuardrailEnabled returns true if quality guardrail is enabled.

func (*AppState) IsQuietMode

func (s *AppState) IsQuietMode() bool

IsQuietMode returns true if quiet mode is enabled.

func (*AppState) IsRemoteMode

func (s *AppState) IsRemoteMode() bool

IsRemoteMode returns true if remote mode is enabled.

func (*AppState) IsResearchPackEnabled added in v0.28.0

func (s *AppState) IsResearchPackEnabled() bool

IsResearchPackEnabled returns true if research pack is enabled.

func (*AppState) IsReversibleEnabled

func (s *AppState) IsReversibleEnabled() bool

IsReversibleEnabled returns true if reversible mode is enabled.

func (*AppState) IsRoleBudgetEnabled added in v0.28.0

func (s *AppState) IsRoleBudgetEnabled() bool

IsRoleBudgetEnabled returns true if role-budget layer is enabled.

func (*AppState) IsS2MADEnabled added in v0.28.0

func (s *AppState) IsS2MADEnabled() bool

IsS2MADEnabled returns true if S2-MAD layer is enabled.

func (*AppState) IsSSDPEnabled added in v0.28.0

func (s *AppState) IsSSDPEnabled() bool

IsSSDPEnabled returns true if SSDP layer is enabled.

func (*AppState) IsSWEAdaptiveEnabled added in v0.28.0

func (s *AppState) IsSWEAdaptiveEnabled() bool

IsSWEAdaptiveEnabled returns true if SWE adaptive loop is enabled.

func (*AppState) IsSearchCrunchEnabled added in v0.28.0

func (s *AppState) IsSearchCrunchEnabled() bool

IsSearchCrunchEnabled returns true if search-crunch layer is enabled.

func (*AppState) IsStreamMode

func (s *AppState) IsStreamMode() bool

IsStreamMode returns true if streaming mode is enabled for large inputs.

func (*AppState) IsStructCollapseEnabled added in v0.28.0

func (s *AppState) IsStructCollapseEnabled() bool

IsStructCollapseEnabled returns true if structural-collapse layer is enabled.

func (*AppState) IsUltraCompact

func (s *AppState) IsUltraCompact() bool

IsUltraCompact returns true if ultra-compact mode is enabled.

func (*AppState) IsVerbose

func (s *AppState) IsVerbose() bool

func (*AppState) Set

func (s *AppState) Set(cfg FlagConfig)

Set sets all flag values atomically.

type CompressionClient added in v0.28.0

type CompressionClient struct{}

CompressionClient is a stub for compression operations.

func (*CompressionClient) Compress added in v0.28.0

func (c *CompressionClient) Compress(ctx context.Context, input, mode string, budget int) (*CompressionResult, error)

Compress performs compression (stub - returns input unchanged).

type CompressionResult added in v0.28.0

type CompressionResult struct {
	Output           string
	OriginalTokens   int
	CompressedTokens int
	SavingsPercent   float64
}

CompressionResult holds compression results.

type FallbackHandler

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

FallbackHandler handles commands via TOML filter system.

func GetFallback

func GetFallback() *FallbackHandler

GetFallback returns the global fallback handler (singleton).

func NewFallbackHandler

func NewFallbackHandler() *FallbackHandler

NewFallbackHandler creates a new fallback handler.

func (*FallbackHandler) Handle

func (h *FallbackHandler) Handle(args []string) (string, bool, error)

Handle processes a command through the TOML filter system.

type FlagConfig

type FlagConfig struct {
	Verbose              int
	DryRun               bool
	UltraCompact         bool
	SkipEnv              bool
	QueryIntent          string
	LLMEnabled           bool
	TokenBudget          int
	FallbackArgs         []string
	LayerPreset          string
	LayerProfile         string
	OutputFile           string
	QuietMode            bool
	JSONOutput           bool
	RemoteMode           bool
	CompressionAddr      string
	AnalyticsAddr        string
	RemoteTimeout        int
	CompactionEnabled    bool
	CompactionThreshold  int
	CompactionPreserve   int
	CompactionMaxTokens  int
	CompactionSnapshot   bool
	CompactionAutoDetect bool
	ReversibleEnabled    bool
	EnableLayers         []string
	DisableLayers        []string
	StreamMode           bool
	PolicyRouter         bool
	Extractive           bool
	ExtractiveMax        int
	ExtractiveHead       int
	ExtractiveTail       int
	ExtractiveSignal     int
	QualityGuardrail     bool
	DiffAdapt            bool
	EPiC                 bool
	SSDP                 bool
	AgentOCR             bool
	S2MAD                bool
	ACON                 bool
	ResearchPack         bool
	LatentCollab         bool
	GraphCoT             bool
	RoleBudget           bool
	SWEAdaptive          bool
	AgentOCRHistory      bool
	PlanBudget           bool
	LightMem             bool
	PathShorten          bool
	JSONSampler          bool
	ContextCrunch        bool // Enable ContextCrunch (merged LogCrunch + DiffCrunch)
	SearchCrunch         bool
	StructCollapse       bool
	AdaptiveLearning     bool // Enable AdaptiveLearning (merged EngramLearner + TieredSummary)
}

type OutputType

type OutputType int

OutputType represents the type of command output.

const (
	OutputTypeTest OutputType = iota
	OutputTypeBuild
	OutputTypeLog
	OutputTypeList
	OutputTypeJSON
	OutputTypeGeneric
)

type RemoteClient added in v0.28.0

type RemoteClient struct{}

RemoteClient is a stub for the remote client (functionality removed).

func GetRemoteClient

func GetRemoteClient() *RemoteClient

GetRemoteClient returns the global gRPC client (lazy initialization). Returns nil if remote mode is not enabled or connection failed.

func NewRemoteClient added in v0.28.0

func NewRemoteClient(cfg *RemoteConfig) (*RemoteClient, error)

NewRemoteClient creates a new remote client (stub - returns nil).

func (*RemoteClient) Compression added in v0.28.0

func (c *RemoteClient) Compression() *CompressionClient

Compression returns a compression client (stub).

type RemoteConfig added in v0.28.0

type RemoteConfig struct {
	CompressionAddr string
	AnalyticsAddr   string
	Timeout         time.Duration
}

RemoteConfig holds remote client configuration.

Jump to

Keyboard shortcuts

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