rmapi

package
v1.8.3 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2026 License: AGPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
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

func GetUserCachePath(userID uuid.UUID) string

GetUserCachePath returns the cache directory path for a user This is used to isolate rmapi cache between users in multi-user mode

func GetUserConfigPath

func GetUserConfigPath(userID uuid.UUID) (string, error)

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

func HandlePairRequest(c *gin.Context)

HandlePairRequest handles pairing requests for both single-user and multi-user modes

func IsUserPaired

func IsUserPaired(userID uuid.UUID) bool

IsUserPaired checks if a user has valid rmapi configuration Handles both single-user (filesystem) and multi-user (database) modes automatically

func LoadUserConfig

func LoadUserConfig(userID uuid.UUID) (string, error)

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

func NewCommand(user *database.User, args ...string) (*exec.Cmd, func())

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

func NewSimpleCommand(user *database.User, args ...string) *exec.Cmd

NewSimpleCommand creates a new rmapi command without cleanup (for simple operations) Deprecated: Use NewCommand instead for proper temp file management

func PairHandler

func PairHandler(c *gin.Context)

PairHandler handles rmapi pairing for multi-user mode

func RunPair

func RunPair(stdout, stderr io.Writer) error

RunPair runs the interactive rmapi pairing process for single-user mode This is called by the CLI command `aviary pair`

func SaveUserConfig

func SaveUserConfig(userID uuid.UUID, configContent string) error

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

func UnpairHandler(c *gin.Context)

UnpairHandler removes the rmapi configuration for the current user

Types

type PostPairingCallback

type PostPairingCallback func(userID string, singleUserMode bool)

PostPairingCallback is called after successful pairing

func GetPostPairingCallback

func GetPostPairingCallback() PostPairingCallback

GetPostPairingCallback returns the current post-pairing callback

Jump to

Keyboard shortcuts

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