mirror of
https://github.com/yusing/godoxy.git
synced 2026-03-18 07:13:50 +01:00
20 lines
398 B
Go
20 lines
398 B
Go
package docker
|
|
|
|
import (
|
|
"github.com/puzpuzpuz/xsync/v4"
|
|
)
|
|
|
|
var idDockerHostMap = xsync.NewMap[string, string](xsync.WithPresize(100))
|
|
|
|
func GetDockerHostByContainerID(id string) (string, bool) {
|
|
return idDockerHostMap.Load(id)
|
|
}
|
|
|
|
func SetDockerHostByContainerID(id, host string) {
|
|
idDockerHostMap.Store(id, host)
|
|
}
|
|
|
|
func DeleteDockerHostByContainerID(id string) {
|
|
idDockerHostMap.Delete(id)
|
|
}
|