Documentation
¶
Index ¶
- Variables
- func CleanupTempConfigFile(configPath string)
- func CleanupUserCache(cachePath string)
- func GetUserCachePath(userID uuid.UUID) string
- func GetUserConfigPath(userID uuid.UUID) (string, error)
- func HandlePairRequest(c *gin.Context)
- func IsUserPaired(userID uuid.UUID) bool
- func LoadUserConfig(userID uuid.UUID) (string, error)
- func NewCommand(user *database.User, args ...string) (*exec.Cmd, func())
- func NewSimpleCommand(user *database.User, args ...string) *exec.Cmd
- func PairHandler(c *gin.Context)
- func RunPair(stdout, stderr io.Writer) error
- func SaveUserConfig(userID uuid.UUID, configContent string) error
- func SetPostPairingCallback(callback PostPairingCallback)
- func UnpairHandler(c *gin.Context)
- type PostPairingCallback
Constants ¶
This section is empty.
Variables ¶
var ExecCommand = exec.Command
ExecCommand is exec.Command by default, but can be overridden in tests
Functions ¶
func CleanupTempConfigFile ¶
func CleanupTempConfigFile(configPath string)
CleanupTempConfigFile removes a temporary config file if it exists
func CleanupUserCache ¶ added in v1.6.5
func CleanupUserCache(cachePath string)
CleanupUserCache removes a user's cache directory if it exists
func GetUserCachePath ¶ added in v1.6.5
GetUserCachePath returns the cache directory path for a user This is used to isolate rmapi cache between users in multi-user mode
func GetUserConfigPath ¶
GetUserConfigPath returns the config path for a user In multi-user mode: creates temporary file from database content In single-user mode: returns ~/.config/rmapi/rmapi.conf
func HandlePairRequest ¶
HandlePairRequest handles pairing requests for both single-user and multi-user modes
func IsUserPaired ¶
IsUserPaired checks if a user has valid rmapi configuration Handles both single-user (filesystem) and multi-user (database) modes automatically
func LoadUserConfig ¶
LoadUserConfig loads rmapi configuration for a user In multi-user mode: loads from database In single-user mode: returns path to ~/.config/rmapi/rmapi.conf
func NewCommand ¶
NewCommand creates a new rmapi command with user-specific configuration Returns the command and a cleanup function that should be called after execution
func NewSimpleCommand ¶
NewSimpleCommand creates a new rmapi command without cleanup (for simple operations) Deprecated: Use NewCommand instead for proper temp file management
func PairHandler ¶
PairHandler handles rmapi pairing for multi-user mode
func RunPair ¶
RunPair runs the interactive rmapi pairing process for single-user mode This is called by the CLI command `aviary pair`
func SaveUserConfig ¶
SaveUserConfig saves rmapi configuration for a user In multi-user mode: saves to database In single-user mode: not supported (configs are managed by rmapi directly)
func SetPostPairingCallback ¶
func SetPostPairingCallback(callback PostPairingCallback)
SetPostPairingCallback sets the callback to be called after successful pairing
func UnpairHandler ¶
UnpairHandler removes the rmapi configuration for the current user
Types ¶
type PostPairingCallback ¶
PostPairingCallback is called after successful pairing
func GetPostPairingCallback ¶
func GetPostPairingCallback() PostPairingCallback
GetPostPairingCallback returns the current post-pairing callback