Files
Luis Pater e50cabac4b chore: upgrade CLIProxyAPI dependency to v7 across the project
- Updated all references from v6 to v7 for `github.com/router-for-me/CLIProxyAPI`.
- Ensured consistency in imports within core libraries, tests, and integration tests.
- Added missing tests for new features in Redis Protocol integration.
2026-05-08 11:46:46 +08:00

26 lines
529 B
Go

package home
import "sync/atomic"
var currentClient atomic.Value // *Client
// SetCurrent sets the active home client used by runtime integrations.
func SetCurrent(client *Client) {
currentClient.Store(client)
}
// Current returns the active home client instance, if any.
func Current() *Client {
if v := currentClient.Load(); v != nil {
if client, ok := v.(*Client); ok {
return client
}
}
return nil
}
// ClearCurrent removes the active home client.
func ClearCurrent() {
currentClient.Store((*Client)(nil))
}