Add projects

This commit is contained in:
Alois 2026-08-24 00:10:41 +02:00
commit 8b607dd700
Signed by: alois
SSH key fingerprint: SHA256:GBzT2DXvAuGV9XIV5W3WrzVpjU54FThmxHXdbz95J24
1802 changed files with 503346 additions and 2 deletions

View file

@ -0,0 +1,27 @@
package home
import "sync/atomic"
var currentClient atomic.Pointer[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 {
return currentClient.Load()
}
// ClearCurrent removes the active home client.
func ClearCurrent() {
currentClient.Store(nil)
}
// ClearCurrentIf removes the active client only when it is client.
func ClearCurrentIf(client *Client) {
if client != nil {
currentClient.CompareAndSwap(client, nil)
}
}