Documentation ¶
Index ¶
- Constants
- func GetConfigContents() ([]byte, error)
- func GetDb(ctx context.Context) *gorm.DB
- func GetHome(ctx context.Context) string
- func GetLogger() *logrus.Logger
- func InitConfig() error
- func MakeContext() context.Context
- func MakeHishtoryDir() error
- func OpenLocalSqliteDb() (*gorm.DB, error)
- func SetConfig(config *ClientConfig) error
- type ClientConfig
- type ColorScheme
- type CustomColumnDefinition
Constants ¶
View Source
const ( ConfigCtxKey hishtoryContextKey = "config" DbCtxKey hishtoryContextKey = "db" HomedirCtxKey hishtoryContextKey = "homedir" )
Variables ¶
This section is empty.
Functions ¶
func GetConfigContents ¶
func InitConfig ¶
func InitConfig() error
func MakeContext ¶
func MakeHishtoryDir ¶
func MakeHishtoryDir() error
func OpenLocalSqliteDb ¶
func SetConfig ¶
func SetConfig(config *ClientConfig) error
Types ¶
type ClientConfig ¶
type ClientConfig struct { // The user secret that is used to derive encryption keys for syncing history entries UserSecret string `json:"user_secret" yaml:"-"` // Whether hishtory recording is enabled IsEnabled bool `json:"is_enabled" yaml:"-"` // A device ID used to track which history entry came from which device for remote syncing DeviceId string `json:"device_id" yaml:"-"` // Used for skipping history entries prefixed with a space in bash LastPreSavedHistoryLine string `json:"last_presaved_history_line" yaml:"-"` // Used for skipping history entries prefixed with a space in bash LastSavedHistoryLine string `json:"last_saved_history_line" yaml:"-"` // Used for uploading history entries that we failed to upload due to a missing network connection HaveMissedUploads bool `json:"have_missed_uploads" yaml:"-"` MissedUploadTimestamp int64 `json:"missed_upload_timestamp" yaml:"-"` // Used for uploading deletion requests that we failed to upload due to a missed network connection // Note that this is only applicable for deleting pre-saved entries. For interactive deletion, we just // show the user an error message if they're offline. PendingDeletionRequests []shared.DeletionRequest `json:"pending_deletion_requests" yaml:"-"` // Used for avoiding double imports of .bash_history HaveCompletedInitialImport bool `json:"have_completed_initial_import" yaml:"-"` // Whether control-r bindings are enabled ControlRSearchEnabled bool `json:"enable_control_r_search"` // The set of columns that the user wants to be displayed DisplayedColumns []string `json:"displayed_columns"` // Custom columns CustomColumns []CustomColumnDefinition `json:"custom_columns"` // Whether to force enable a compact mode for the TUI ForceCompactMode bool `json:"force_compact_mode"` // Whether this is an offline instance of hishtory with no syncing IsOffline bool `json:"is_offline"` // Whether duplicate commands should be displayed FilterDuplicateCommands bool `json:"filter_duplicate_commands"` // A format string for the timestamp TimestampFormat string `json:"timestamp_format"` // Beta mode, enables unspecified additional beta features // Currently: This enables pre-saving of history entries to better handle long-running commands BetaMode bool `json:"beta_mode"` // Whether to highlight matches in search results HighlightMatches bool `json:"highlight_matches"` // Whether to enable AI completion AiCompletion bool `json:"ai_completion"` // Whether to enable presaving EnablePresaving bool `json:"enable_presaving"` // The current color scheme for the TUI ColorScheme ColorScheme `json:"color_scheme"` // A default filter that will be applied to all search queries DefaultFilter string `json:"default_filter"` // The endpoint to use for AI suggestions AiCompletionEndpoint string `json:"ai_completion_endpoint"` // Custom key bindings for the TUI KeyBindings keybindings.SerializableKeyMap `json:"key_bindings"` // The log level for hishtory (e.g., "debug", "info", "warn", "error") LogLevel logrus.Level `json:"log_level"` // Whether the TUI should render in full-screen mode FullScreenRendering bool `json:"full_screen_rendering"` }
func GetConf ¶
func GetConf(ctx context.Context) *ClientConfig
func GetConfig ¶
func GetConfig() (ClientConfig, error)
type ColorScheme ¶
func GetDefaultColorScheme ¶
func GetDefaultColorScheme() ColorScheme
type CustomColumnDefinition ¶
Click to show internal directories.
Click to hide internal directories.