cmd

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2026 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitCommand

func InitCommand(build BuildInfo) cobra.Command

InitCommand initializes the root command of the CLI application with its subcommands and flags.

func RunCommand

func RunCommand(ctx context.Context, flags *cmdFlags) error

RunCommand initializes the logger, loads configuration, creates the core and API services, and starts the API service. It returns an error if any step fails.

Types

type BuildInfo

type BuildInfo struct {
	Version string
	AppName string
}

BuildInfo holds the build metadata injected at compile time.

type ContextHandler

type ContextHandler struct {
	slog.Handler
	// contains filtered or unexported fields
}

ContextHandler is a custom slog.Handler that enriches log records with application-specific attributes. It embeds a slog.Handler and adds attributes like application name and version, as well as request-specific context data.

func (ContextHandler) Handle

func (h ContextHandler) Handle(ctx context.Context, r slog.Record) error

type SearchConfig

type SearchConfig struct {
	IndexPath string `mapstructure:"index_path"`
}

SearchConfig holds configuration for the search engine.

type StorageConfig

type StorageConfig struct {
	Path string         `mapstructure:"path"`
	Type string         `mapstructure:"type"`
	S3   s3store.Config `mapstructure:"s3"`
}

StorageConfig holds configuration for document storage. Type selects the storage backend: "local" (default) or "s3".

Jump to

Keyboard shortcuts

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