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.
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
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))
|
||||
}
|
||||
Reference in New Issue
Block a user