frostfs-sdk-go/container/network.go
Pavel Karpy 4c779423f5 Move to frostfs-sdk-go
Signed-off-by: Pavel Karpy <p.karpy@yadro.com>
2022-12-14 09:59:29 +03:00

20 lines
605 B
Go

package container
import (
"github.com/TrueCloudLab/frostfs-sdk-go/netmap"
)
// ApplyNetworkConfig applies network configuration to the
// container. Changes the container if it does not satisfy
// network configuration.
func ApplyNetworkConfig(cnr *Container, cfg netmap.NetworkInfo) {
if cfg.HomomorphicHashingDisabled() {
DisableHomomorphicHashing(cnr)
}
}
// AssertNetworkConfig checks if a container matches passed
// network configuration.
func AssertNetworkConfig(cnr Container, cfg netmap.NetworkInfo) bool {
return IsHomomorphicHashingDisabled(cnr) == cfg.HomomorphicHashingDisabled()
}