datapath

package
v0.107.34 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LiveAgentHomeEnv = "LIVEAGENT_HOME"
	LegacyHomeEnv    = "K_BRAIN_HOME"
	LiveAgentDirName = ".liveagent"
	LegacyDirName    = ".k-brain"
)

Variables

This section is empty.

Functions

func InTempDir added in v0.107.28

func InTempDir(path string) bool

InTempDir reports whether path lies inside the system temporary directory, comparing both the paths as written and with symbolic links resolved (on macOS the temporary directory is reached through /var -> /private/var).

func LegacyProjectDir

func LegacyProjectDir(project string) string

func LegacyUserDir added in v0.107.28

func LegacyUserDir() string

LegacyUserDir is the pre-LiveAgent global directory (~/.k-brain) that is imported once. Under `go test` it is "" unless the home directory is a temporary one: tests must not read a developer's real data.

func Migrate

func Migrate(src, dst string) error

Migrate imports a legacy directory once. Completed imports are not replayed after users delete or archive data in the destination. Root symlinks are rejected; links inside the source are copied verbatim without following them.

func MigrateProjectDir

func MigrateProjectDir(project string) error

func ProjectDir

func ProjectDir(project string) string

ProjectDir returns the project-scoped data directory. It uses .liveagent exclusively; .k-brain remains available for one-way prompt compatibility.

func Report

func Report(err error)

Report keeps migration failures visible in discovery APIs without error returns.

func Resolve

func Resolve(home, preferred, legacyOverride string) (string, error)

func TestRedirect added in v0.107.28

func TestRedirect(home, preferred, legacy string) string

TestRedirect reports the directory UserDir would use, when a test process must not use it because it lies outside the temporary directory; "" when it is safe.

func UserDir

func UserDir() (string, error)

UserDir resolves the global data directory and imports legacy entries without replacing files already present in the new directory.

Types

This section is empty.

Jump to

Keyboard shortcuts

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